private void computeImports(CompilationController ci, List<String> imports) throws IOException { if (ci.toPhase(Phase.PARSED).compareTo(Phase.PARSED) < 0) { ErrorManager.getDefault().log(ErrorManager.WARNING, "Unable to resolve "+ci.getFileObject()+" to phase "+Phase.RESOLVED+", current phase = "+ci.getPhase()+ "\nDiagnostics = "+ci.getDiagnostics()+ "\nFree memory = "+Runtime.getRuntime().freeMemory()); return; } List importDecl = ci.getCompilationUnit().getImports(); int i = 0; for (Iterator it = importDecl.iterator(); it.hasNext(); i++) { ImportTree itree = (ImportTree) it.next(); String importStr = itree.getQualifiedIdentifier().toString(); imports.add(importStr); } }
if (ci.toPhase(Phase.RESOLVED).compareTo(Phase.RESOLVED) < 0) {//TODO: ELEMENTS_RESOLVED may be sufficient ErrorManager.getDefault().log(ErrorManager.WARNING, "Unable to resolve "+ci.getFileObject()+" to phase "+Phase.RESOLVED+", current phase = "+ci.getPhase()+ "\nDiagnostics = "+ci.getDiagnostics()+ "\nFree memory = "+Runtime.getRuntime().freeMemory());
"Unable to resolve "+ci.getFileObject()+" to phase "+Phase.RESOLVED+", current phase = "+ci.getPhase()+ "\nDiagnostics = "+ci.getDiagnostics()+ "\nFree memory = "+Runtime.getRuntime().freeMemory());
if (ci.toPhase(Phase.RESOLVED).compareTo(Phase.RESOLVED) < 0) {//TODO: ELEMENTS_RESOLVED may be sufficient ErrorManager.getDefault().log(ErrorManager.WARNING, "Unable to resolve "+ci.getFileObject()+" to phase "+Phase.RESOLVED+", current phase = "+ci.getPhase()+ "\nDiagnostics = "+ci.getDiagnostics()+ "\nFree memory = "+Runtime.getRuntime().freeMemory());
if (ci.toPhase(Phase.RESOLVED).compareTo(Phase.RESOLVED) < 0) {//TODO: ELEMENTS_RESOLVED may be sufficient ErrorManager.getDefault().log(ErrorManager.WARNING, "Unable to resolve "+ci.getFileObject()+" to phase "+Phase.RESOLVED+", current phase = "+ci.getPhase()+ "\nDiagnostics = "+ci.getDiagnostics()+ "\nFree memory = "+Runtime.getRuntime().freeMemory());
"Unable to resolve "+ci.getFileObject()+" to phase "+Phase.RESOLVED+", current phase = "+ci.getPhase()+ "\nDiagnostics = "+ci.getDiagnostics()+ "\nFree memory = "+Runtime.getRuntime().freeMemory());
"Unable to resolve "+ci.getFileObject()+" to phase "+Phase.RESOLVED+", current phase = "+ci.getPhase()+ "\nDiagnostics = "+ci.getDiagnostics()+ "\nFree memory = "+Runtime.getRuntime().freeMemory());
private MethodArgument[] computeMethodArguments(CompilationController ci, int methodLineNumber, int offset) throws IOException { MethodArgument args[]; if (ci.toPhase(Phase.RESOLVED).compareTo(Phase.RESOLVED) < 0) { ErrorManager.getDefault().log(ErrorManager.WARNING, "Unable to resolve "+ci.getFileObject()+" to phase "+Phase.RESOLVED+", current phase = "+ci.getPhase()+ "\nDiagnostics = "+ci.getDiagnostics()+ "\nFree memory = "+Runtime.getRuntime().freeMemory()); return null; } Scope scope = ci.getTreeUtilities().scopeFor(offset); Element clazz = scope.getEnclosingClass(); if (clazz == null) { return null; } Tree methodTree = ci.getTrees().getTree(clazz); CompilationUnitTree cu = ci.getCompilationUnit(); MethodArgumentsScanner scanner = new MethodArgumentsScanner(methodLineNumber, cu, ci.getTrees().getSourcePositions(), false, new OperationCreationDelegateImpl()); args = methodTree.accept(scanner, null); args = scanner.getArguments(); return args; }
"Unable to resolve "+ci.getFileObject()+" to phase "+Phase.RESOLVED+", current phase = "+ci.getPhase()+ "\nDiagnostics = "+ci.getDiagnostics()+ "\nFree memory = "+Runtime.getRuntime().freeMemory());
private MethodArgument[] computeMethodArguments(CompilationController ci, Operation operation) throws IOException { MethodArgument args[]; if (ci.toPhase(Phase.RESOLVED).compareTo(Phase.RESOLVED) < 0) { ErrorManager.getDefault().log(ErrorManager.WARNING, "Unable to resolve "+ci.getFileObject()+" to phase "+Phase.RESOLVED+", current phase = "+ci.getPhase()+ "\nDiagnostics = "+ci.getDiagnostics()+ "\nFree memory = "+Runtime.getRuntime().freeMemory()); return null; } int offset = operation.getMethodEndPosition().getOffset(); Scope scope = ci.getTreeUtilities().scopeFor(offset); Element method = scope.getEnclosingMethod(); if (method == null) { return null; } Tree methodTree = ci.getTrees().getTree(method); CompilationUnitTree cu = ci.getCompilationUnit(); MethodArgumentsScanner scanner = new MethodArgumentsScanner(offset, cu, ci.getTrees().getSourcePositions(), true, new OperationCreationDelegateImpl()); args = methodTree.accept(scanner, null); args = scanner.getArguments(); return args; }
private Operation[] computeOperations(CompilationController ci, int offset, int lineNumber, BytecodeProvider bytecodeProvider) throws IOException { if (ci.toPhase(Phase.RESOLVED).compareTo(Phase.RESOLVED) < 0) {//TODO: ELEMENTS_RESOLVED may be sufficient ErrorManager.getDefault().log(ErrorManager.WARNING, "Unable to resolve "+ci.getFileObject()+" to phase "+Phase.RESOLVED+", current phase = "+ci.getPhase()+ "\nDiagnostics = "+ci.getDiagnostics()+ "\nFree memory = "+Runtime.getRuntime().freeMemory());
if (type == null && JavaSource.Phase.RESOLVED.compareTo(controller.getPhase()) > 0) { controller.toPhase(Phase.RESOLVED); type = controller.getTrees().getTypeMirror(new TreePath(methodOrLambdaPath, retTree)); for (ExpressionTree thr : ((MethodTree) methodPath.getLeaf()).getThrows()) { type = trees.getTypeMirror(new TreePath(methodPath, thr)); if (type == null && JavaSource.Phase.RESOLVED.compareTo(controller.getPhase()) > 0) { controller.toPhase(Phase.RESOLVED); type = trees.getTypeMirror(new TreePath(methodPath, thr));
if (JavaSource.Phase.RESOLVED.compareTo(controller.getPhase()) > 0) { LinkedList<TreePath> reversePath = new LinkedList<>(); TreePath treePath = path;