@Override public void finished(TaskEvent e) { if (e.getKind() == Kind.COMPILATION) { AnnotationUtils.clear(); } } }
@Override public void started(TaskEvent e) { if (e.getKind() == TaskEvent.Kind.ENTER) { CompilationUnitTree ct = e.getCompilationUnit(); if (ct != null) { compUnits.add(ct); } } }
@Override public void finished(TaskEvent taskEvent) { if (taskEvent.getKind() != Kind.ANALYZE) { return;
@Override public void finished(TaskEvent e) { if (e.getKind() != TaskEvent.Kind.ANALYZE) return; TypeElement elem = e.getTypeElement(); for(Tree t : e.getCompilationUnit().getTypeDecls()) { if (t.getKind() == Tree.Kind.CLASS) { if (((JCClassDecl)t).sym.equals(elem)) { currentClass = (ClassTree)t; break; } } } if (currentClass != null) { verify(currentClass, elem); } }
@Override public void finished(TaskEvent event) { if (event.getKind() != Kind.GENERATE) { return; } RefactoringResult refactoringResult; try { refactoringResult = refactoringCollection.applyChanges(event.getSourceFile().toUri()); } catch (Exception e) { PrintWriter out = Log.instance(context).getWriter(WriterKind.ERROR); out.println(e.getMessage()); out.flush(); return; } if (refactoringResult.type() == RefactoringCollection.RefactoringResultType.CHANGED) { PrintWriter out = Log.instance(context).getWriter(WriterKind.NOTICE); out.println(refactoringResult.message()); out.flush(); } } }
@Override public void finished(TaskEvent e) { if (e.getKind() != TaskEvent.Kind.ANALYZE) return; if (processingEnv == null) { return; } TypeElement elem = e.getTypeElement(); for(Tree t : e.getCompilationUnit().getTypeDecls()) { if (t.getKind() == Tree.Kind.CLASS) { if (((JCClassDecl)t).sym.equals(elem)) { currentClass = (ClassTree)t; break; } } } if (currentClass != null) { verify(currentClass, elem); } }
@Override public void finished(TaskEvent taskEvent) { if (taskEvent.getKind() != Kind.ANALYZE) { return;
@Override public void started(TaskEvent e) { switch (e.getKind()) { case ANALYZE: CompilationUnitTree tree; while ((tree = todo.poll()) != null) ds.scan(tree, null); break; } }
@Override public void finished(TaskEvent e) { switch (e.getKind()) { case PARSE: todo.add(e.getCompilationUnit()); break; } }
@Override public void started(TaskEvent e) { switch (e.getKind()) { case ANALYZE: CompilationUnitTree tree; while ((tree = todo.poll()) != null) ds.scan(tree, null); break; } }
@Override public void finished(TaskEvent e) { switch (e.getKind()) { case PARSE: todo.add(e.getCompilationUnit()); break; } }
@Override public void finished(TaskEvent e) { if (e.getKind() == Kind.COMPILATION) { AnnotationUtils.clear(); } } }
@Override public void finished(TaskEvent e) { if (e.getKind() == Kind.ANALYZE) { JCCompilationUnit toplevel = (JCCompilationUnit) e.getCompilationUnit(); if (toplevel != null && toplevel.sourcefile != null) { flowCompleted.add(toplevel.sourcefile.toUri()); } } } }
@Override public void started( TaskEvent e ) { if( e.getKind() != TaskEvent.Kind.PARSE ) { return; } // Install the handler so we can filter the 'illegal escape character' errors for \$ _manDiagnosticHandler = new ManDiagnosticHandler( _javacTask.getContext() ); }
@Override public void finished( TaskEvent e ) { switch( e.getKind() ) { case PARSE: { addInputFile( e ); break; } case ENTER: process( e ); break; } }
@Override public void started(TaskEvent e) { if (e != null && e.getKind() == TaskEvent.Kind.GENERATE) { JCClassDecl tree = syms2trees.get((ClassSymbol)e.getTypeElement()); if (tree != null) pruneTree(tree, Symtab.instance(jti.getContext()), null); } } @Override
@Override public void finished(TaskEvent e) { if (e.getKind() != TaskEvent.Kind.ANALYZE) return; TypeElement elem = e.getTypeElement(); for(Tree t : e.getCompilationUnit().getTypeDecls()) { if (t.getKind() == Tree.Kind.CLASS) { if (((JCClassDecl)t).sym.equals(elem)) { currentClass = (ClassTree)t; break; } } } if (currentClass != null) { verify(currentClass, elem); } }
@Override public void started( TaskEvent e ) { if( e.getKind() == TaskEvent.Kind.ANALYZE && !replaced ) { // We replace the compilation steps at this point because we have a different Context Context context = getField( compiler, "delegateCompiler.context" ); // Replace the Attribute step to remove errors when encoutering overloaded operators ReflectUtil.<Map> getField( context, "ht" ).values().remove( getField( compiler, "delegateCompiler.attr" ) ); JOpsAttr attr2 = new JOpsAttr( context ); setField( compiler, "delegateCompiler.attr", attr2 ); // Replace the TransTypes step to "desugar" operators into method calls. ReflectUtil.<Map> getField( context, "ht" ).values().remove( getField( compiler, "delegateCompiler.transTypes" ) ); JOpsTransTypes transTypes2 = new JOpsTransTypes( context ); setField( compiler, "delegateCompiler.transTypes", transTypes2 ); replaced = true; } }
@Override public void finished(TaskEvent taskEvent) { if(taskEvent.getKind() == ANALYZE) try { scan(taskEvent.getCompilationUnit(), null); } catch (RuntimeException runtimeException) { trees.printMessage(WARNING, "Unable to finish @End method check: " + runtimeException, taskEvent.getCompilationUnit(), taskEvent.getCompilationUnit()); } }
@Override public void finished(TaskEvent taskEvent) { if(taskEvent.getKind() == ANALYZE) try { scan(taskEvent.getCompilationUnit(), null); } catch (RuntimeException runtimeException) { trees.printMessage(WARNING, "Unable to finish @End method check: " + runtimeException, taskEvent.getCompilationUnit(), getCurrentPath().getCompilationUnit()); } }