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); } }
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;
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;
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;
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;
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;
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;
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; }
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;
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; }
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 new Operation[] {};