@Override public void acceptResult(CompilationResult result) { assert this.bytes == null : "duplicate result"; //$NON-NLS-1$ ClassFile[] classFiles = result.getClassFiles(); assert classFiles.length == 1; this.bytes = classFiles[0].getBytes(); } }
@Override public void acceptResult(CompilationResult result) { assert this.bytes == null : "duplicate result"; //$NON-NLS-1$ ClassFile[] classFiles = result.getClassFiles(); assert classFiles.length == 1; this.bytes = classFiles[0].getBytes(); } }
public void cleanUp() { if (this.types != null) { for (int i = 0, max = this.types.length; i < max; i++) { cleanUp(this.types[i]); } for (int i = 0, max = this.localTypeCount; i < max; i++) { LocalTypeBinding localType = this.localTypes[i]; // null out the type's scope backpointers localType.scope = null; // local members are already in the list localType.enclosingCase = null; } } this.compilationResult.recoveryScannerData = null; // recovery is already done ClassFile[] classFiles = this.compilationResult.getClassFiles(); for (int i = 0, max = classFiles.length; i < max; i++) { // clear the classFile back pointer to the bindings ClassFile classFile = classFiles[i]; // null out the classfile backpointer to a type binding classFile.referenceBinding = null; classFile.innerClassesBindings = null; classFile.missingTypes = null; classFile.visitedTypes = null; } this.suppressWarningAnnotations = null; }
public void cleanUp() { if (this.types != null) { for (int i = 0, max = this.types.length; i < max; i++) { cleanUp(this.types[i]); } for (int i = 0, max = this.localTypeCount; i < max; i++) { LocalTypeBinding localType = this.localTypes[i]; // null out the type's scope backpointers localType.scope = null; // local members are already in the list localType.enclosingCase = null; } } this.compilationResult.recoveryScannerData = null; // recovery is already done ClassFile[] classFiles = this.compilationResult.getClassFiles(); for (int i = 0, max = classFiles.length; i < max; i++) { // clear the classFile back pointer to the bindings ClassFile classFile = classFiles[i]; // null out the classfile backpointer to a type binding classFile.referenceBinding = null; classFile.innerClassesBindings = null; classFile.missingTypes = null; classFile.visitedTypes = null; } this.suppressWarningAnnotations = null; }
public void cleanUp() { if (this.types != null) { for (int i = 0, max = this.types.length; i < max; i++) { cleanUp(this.types[i]); } for (int i = 0, max = this.localTypeCount; i < max; i++) { LocalTypeBinding localType = this.localTypes[i]; // null out the type's scope backpointers localType.scope = null; // local members are already in the list localType.enclosingCase = null; } } this.compilationResult.recoveryScannerData = null; // recovery is already done ClassFile[] classFiles = this.compilationResult.getClassFiles(); for (int i = 0, max = classFiles.length; i < max; i++) { // clear the classFile back pointer to the bindings ClassFile classFile = classFiles[i]; // null out the classfile backpointer to a type binding classFile.referenceBinding = null; classFile.innerClassesBindings = null; classFile.missingTypes = null; classFile.visitedTypes = null; } this.suppressWarningAnnotations = null; }
public void cleanUp() { if (this.types != null) { for (int i = 0, max = this.types.length; i < max; i++) { cleanUp(this.types[i]); } for (int i = 0, max = this.localTypeCount; i < max; i++) { LocalTypeBinding localType = this.localTypes[i]; // null out the type's scope backpointers localType.scope = null; // local members are already in the list localType.enclosingCase = null; } } this.compilationResult.recoveryScannerData = null; // recovery is already done ClassFile[] classFiles = this.compilationResult.getClassFiles(); for (int i = 0, max = classFiles.length; i < max; i++) { // clear the classFile back pointer to the bindings ClassFile classFile = classFiles[i]; // null out the classfile backpointer to a type binding classFile.referenceBinding = null; classFile.innerClassesBindings = null; classFile.bootstrapMethods = null; classFile.missingTypes = null; classFile.visitedTypes = null; } this.suppressWarningAnnotations = null; }
public void cleanUp() { if (this.types != null) { for (int i = 0, max = this.types.length; i < max; i++) { cleanUp(this.types[i]); } for (int i = 0, max = this.localTypeCount; i < max; i++) { LocalTypeBinding localType = this.localTypes[i]; // null out the type's scope backpointers localType.scope = null; // local members are already in the list localType.enclosingCase = null; } } this.compilationResult.recoveryScannerData = null; // recovery is already done ClassFile[] classFiles = this.compilationResult.getClassFiles(); for (int i = 0, max = classFiles.length; i < max; i++) { // clear the classFile back pointer to the bindings ClassFile classFile = classFiles[i]; // null out the classfile backpointer to a type binding classFile.referenceBinding = null; classFile.innerClassesBindings = null; classFile.bootstrapMethods = null; classFile.missingTypes = null; classFile.visitedTypes = null; } this.suppressWarningAnnotations = null; }
@Override public void acceptResult(CompilationResult result) { if (result.hasErrors()) { errors = result.getErrors(); } else { classFiles = result.getClassFiles(); } }
@Override public void acceptResult(CompilationResult result) { if (result.hasErrors()) { errors = result.getErrors(); } else { classFiles = result.getClassFiles(); } }
private static Map<String, byte[]> classes(final CompilationResult result) { final Map<String, byte[]> classes = new HashMap<String, byte[]>(); if (!result.hasErrors()) { for (final ClassFile cls : result.getClassFiles()) { final String className = CharOperation .toString(cls.getCompoundName()); classes.put(className, cls.getBytes()); } } return classes; }
public void acceptResult(CompilationResult result) { boolean hasErrors = false; if (result.hasProblems()) { problems = result.getProblems(); } if (!hasErrors) { ClassFile[] classFiles = result.getClassFiles(); for (int i = 0; i < classFiles.length; i++) { ClassFile classFile = classFiles[i]; char[][] compoundName = classFile.getCompoundName(); StringBuilder className = new StringBuilder(); String sep = ""; for (int j = 0; j < compoundName.length; j++) { className.append(sep); className.append(new String(compoundName[j])); sep = "."; } byte[] bytes = classFile.getBytes(); compiledClassFiles.put(className.toString(), bytes); } } } }
public void acceptResult( org.eclipse.jdt.internal.compiler.CompilationResult result ) { if (result.hasProblems()) { if (result.hasErrors()) hasErrors = true; problems.addAll(Arrays.asList((IProblem[]) result.getProblems())); } if (!result.hasErrors()) { ClassFile[] clazzFiles = result.getClassFiles(); for (ClassFile clazzFile : clazzFiles) { char[][] compoundName = clazzFile.getCompoundName(); StringBuffer clazzName = new StringBuffer(); for (char[] part : compoundName) { if (clazzName.length() > 0) { clazzName.append('.'); } clazzName.append(part); } byteCode.put(clazzName.toString(), clazzFile.getBytes()); } } } }
@Override public void acceptResult(CompilationResult result) { if (result.hasErrors()) { IProblem[] problems = result.getProblems(); if (problemList == null) problemList = new ArrayList<>(problems.length); Collections.addAll(problemList, problems); } else { ClassFile[] classFiles = result.getClassFiles(); for (ClassFile classFile : classFiles) targetClassLoader.addClass(className, classFile.getBytes()); } }
@Override public void acceptResult(CompilationResult result) { if (result.hasErrors()) { IProblem[] problems = result.getProblems(); if (problemList == null) problemList = new ArrayList<>(problems.length); Collections.addAll(problemList, problems); } else { ClassFile[] classFiles = result.getClassFiles(); for (ClassFile classFile : classFiles) targetClassLoader.addClass(className, classFile.getBytes()); } }
@Override public void acceptResult(CompilationResult result) { if (result.hasErrors()) { IProblem[] problems = result.getProblems(); if (problemList == null) problemList = new ArrayList<>(problems.length); Collections.addAll(problemList, problems); } else { ClassFile[] classFiles = result.getClassFiles(); for (ClassFile classFile : classFiles) targetClassLoader.addClass(className, classFile.getBytes()); } }
ClassFile[] classFiles = this.compilationResult.getClassFiles(); for (int i = 0, max = classFiles.length; i < max; i++) {
public void acceptResult( final CompilationResult pResult ) { if (pResult.hasProblems()) { for (IProblem iproblem : pResult.getProblems()) { final CompilationProblem problem = new EclipseCompilationProblem(iproblem); if (problemHandler != null) { problemHandler.handle(problem); } problems.add(problem); } } if (!pResult.hasErrors()) { final ClassFile[] clazzFiles = pResult.getClassFiles(); for (ClassFile clazzFile : clazzFiles) { final char[][] compoundName = clazzFile.getCompoundName(); final StringBuilder clazzName = new StringBuilder(); for (int j = 0; j < compoundName.length; j++) { if (j != 0) { clazzName.append('.'); } clazzName.append(compoundName[j]); } pStore.write(clazzName.toString().replace('.', '/') + ".class", clazzFile.getBytes()); } } } };
public void acceptResult( final CompilationResult pResult ) { if (pResult.hasProblems()) { final IProblem[] iproblems = pResult.getProblems(); for (int i = 0; i < iproblems.length; i++) { final IProblem iproblem = iproblems[i]; final CompilationProblem problem = new EclipseCompilationProblem(iproblem); if (problemHandler != null) { problemHandler.handle(problem); } problems.add(problem); } } if (!pResult.hasErrors()) { final ClassFile[] clazzFiles = pResult.getClassFiles(); for (int i = 0; i < clazzFiles.length; i++) { final ClassFile clazzFile = clazzFiles[i]; final char[][] compoundName = clazzFile.getCompoundName(); final StringBuilder clazzName = new StringBuilder(); for (int j = 0; j < compoundName.length; j++) { if (j != 0) { clazzName.append('.'); } clazzName.append(compoundName[j]); } pStore.write(clazzName.toString().replace('.', '/') + ".class", clazzFile.getBytes()); } } } };
@Override public void acceptResult(CompilationResult result) { if (result.hasErrors()) { for (CategorizedProblem problem: result.getProblems()) { if (problem.isError()) { problemList.add(problem.getMessage()); } } } else { for (ClassFile clazz: result.getClassFiles()) { try { MemJavaFileObject jfo = (MemJavaFileObject) fileManager .getJavaFileForOutput(StandardLocation.CLASS_OUTPUT, new String(clazz.fileName()), JavaFileObject.Kind.CLASS, null); OutputStream os = jfo.openOutputStream(); os.write(clazz.getBytes()); } catch (IOException ex) { throw new RuntimeException(ex); } } } } };
public void acceptResult(CompilationResult result) { if (result.hasProblems()) { if (pProblemHandler != null) { final IProblem[] problems = result.getProblems(); for (int i = 0; i < problems.length; i++) { final IProblem problem = problems[i]; pProblemHandler.handle(new EclipseCompilationProblem(problem)); } } } if (!result.hasErrors()) { final ClassFile[] clazzFiles = result.getClassFiles(); for (int i = 0; i < clazzFiles.length; i++) { final ClassFile clazzFile = clazzFiles[i]; final char[][] compoundName = clazzFile.getCompoundName(); final StringBuffer clazzName = new StringBuffer(); for (int j = 0; j < compoundName.length; j++) { if (j != 0) { clazzName.append('.'); } clazzName.append(compoundName[j]); } pStore.write(clazzName.toString(), clazzFile.getBytes()); } } } };