@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 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 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); } }
path = new TreePath(taskEvent.getCompilationUnit());
@Override public void finished(TaskEvent e) { switch (e.getKind()) { case PARSE: todo.add(e.getCompilationUnit()); break; } }
public void finished(TaskEvent e) { CompilationUnitTree ct = e.getCompilationUnit(); if (ct != null) { compUnits.add(ct); } listener.finished(e); }
public void finished(TaskEvent e) { CompilationUnitTree ct = e.getCompilationUnit(); if (ct != null) { compUnits.add(ct); } listener.finished(e); }
@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 e) { switch (e.getKind()) { case PARSE: todo.add(e.getCompilationUnit()); break; } }
@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()); } } } }
private void process( TaskEvent e ) { Set<String> typesToProcess = new HashSet<>(); ExpressionTree pkg = e.getCompilationUnit().getPackageName(); String packageQualifier = pkg == null ? "" : (pkg.toString() + '.'); for( Tree classDecl : e.getCompilationUnit().getTypeDecls() ) { if( classDecl instanceof JCTree.JCClassDecl ) { typesToProcess.add( packageQualifier + ((JCTree.JCClassDecl)classDecl).getSimpleName() ); insertBootstrap( (JCTree.JCClassDecl)classDecl ); } } _typeProcessor.addTypesToProcess( typesToProcess ); }
@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()); } }
@Override public void started( TaskEvent te ) { if( JreUtil.isJava8() ) { return; } CompilationUnitTree compilationUnit = te.getCompilationUnit(); if( !(compilationUnit instanceof JCTree.JCCompilationUnit) ) { return; } if( _done ) { return; } _done = true; openModule( _ctx, "jdk.compiler" ); }
@Override public void started( TaskEvent te ) { if( JreUtil.isJava8() ) { return; } CompilationUnitTree compilationUnit = te.getCompilationUnit(); if( !(compilationUnit instanceof JCTree.JCCompilationUnit) ) { return; } if( _done ) { return; } _done = true; openModule( _ctx, "jdk.compiler" ); }
@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); } }
private void addInputFile( TaskEvent e ) { if( !_initialized ) { CompilationUnitTree compilationUnit = e.getCompilationUnit(); ExpressionTree pkg = compilationUnit.getPackageName(); String packageQualifier = pkg == null ? "" : (pkg.toString() + '.'); for( Tree classDecl : compilationUnit.getTypeDecls() ) { if( classDecl instanceof JCTree.JCClassDecl ) { _javaInputFiles.add( new Pair<>( packageQualifier + ((JCTree.JCClassDecl)classDecl).getSimpleName(), compilationUnit.getSourceFile() ) ); } } } }
@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.GENERATE ) { return; } // // Process trees that were generated and therefore not available during ANALYZE // For instance, we must process bridge methods // TypeElement elem = e.getTypeElement(); if( elem instanceof Symbol.ClassSymbol ) { if( _typesToProcess.containsKey( elem.getQualifiedName().toString() ) ) { _tree = findTopLevel( (Symbol.ClassSymbol)elem, e.getCompilationUnit().getTypeDecls() ); } else { _tree = _innerClassForGeneration.get( ((Symbol.ClassSymbol)elem).flatName().toString() ); } if( _tree != null ) { _compilationUnit = e.getCompilationUnit(); _generate = true; process( elem, _issueReporter ); } } }
@Override public void finished(TaskEvent e) { TaskEventKind kind = getTaskEventKind(e.getKind(), sourceFileCount, analyzed); if (kind == TaskEventKind.PARSE) { sourceFileCount++; } else if (kind == TaskEventKind.ANALYZE || kind == TaskEventKind.LAST_ANALYZE) { analyzed++; CompilationUnitTree compilationUnit = e.getCompilationUnit(); new DeptectiveTreeVisitor(task, log, handler).scan(compilationUnit, null); // On JDK 8 there's no callback for the completion of the compilation, // so this handler is invoked after analyzing the last source file if (kind == TaskEventKind.LAST_ANALYZE) { handler.onCompletingCompilation(); } } else if (kind == TaskEventKind.COMPILATION) { handler.onCompletingCompilation(); } } });
@Override public void finished( TaskEvent e ) { if( e.getKind() != TaskEvent.Kind.PARSE ) { return; } try { // Uninstall the handler after the file parses (we create new handler for each file) Log.instance( _javacTask.getContext() ).popDiagnosticHandler( _manDiagnosticHandler ); } catch( Throwable ignore ) {} for( Tree tree : e.getCompilationUnit().getTypeDecls() ) { if( !(tree instanceof JCTree.JCClassDecl) ) { continue; } JCTree.JCClassDecl classDecl = (JCTree.JCClassDecl)tree; classDecl.accept( this ); } }