public boolean isSuccess() { for (final CompilationResult res : results) { if (res.getProblems() != null) { for (final CategorizedProblem problem : res.getProblems()) { if (problem.isError()) { return false; } } } } return true; }
public String errorsAsString() { final StringBuilder msgBuilder = new StringBuilder(); for (final CompilationResult res : results) { if (res.getProblems() != null) { for (final CategorizedProblem problem : res.getProblems()) { if (problem.isError()) { msgBuilder.append(problem.getMessage()); msgBuilder.append("\n"); } } } } return msgBuilder.toString(); }
protected void updateProblemsFor(SourceFile sourceFile, CompilationResult result) throws CoreException { CategorizedProblem[] problems = result.getProblems(); if (problems == null || problems.length == 0) return; this.notifier.updateProblemCounts(problems); storeProblemsFor(sourceFile, problems); }
protected void updateProblemsFor(SourceFile sourceFile, CompilationResult result) throws CoreException { CategorizedProblem[] problems = result.getProblems(); if (problems == null || problems.length == 0) return; this.notifier.updateProblemCounts(problems); storeProblemsFor(sourceFile, problems); }
protected void updateProblemsFor(SourceFile sourceFile, CompilationResult result) throws CoreException { CategorizedProblem[] problems = result.getProblems(); if (problems == null || problems.length == 0) return; this.notifier.updateProblemCounts(problems); storeProblemsFor(sourceFile, problems); }
protected void updateProblemsFor(SourceFile sourceFile, CompilationResult result) throws CoreException { CategorizedProblem[] problems = result.getProblems(); if (problems == null || problems.length == 0) return; this.notifier.updateProblemCounts(problems); storeProblemsFor(sourceFile, problems); }
protected void updateProblemsFor(SourceFile sourceFile, CompilationResult result) throws CoreException { CategorizedProblem[] problems = result.getProblems(); if (problems == null || problems.length == 0) return; this.notifier.updateProblemCounts(problems); storeProblemsFor(sourceFile, problems); }
protected void updateProblemsFor(SourceFile sourceFile, CompilationResult result) throws CoreException { CategorizedProblem[] problems = result.getProblems(); if (problems == null || problems.length == 0) return; this.notifier.updateProblemCounts(problems); storeProblemsFor(sourceFile, problems); }
/** * Answer the errors encountered during compilation. */ public CategorizedProblem[] getErrors() { CategorizedProblem[] reportedProblems = getProblems(); int errorCount = 0; for (int i = 0; i < this.problemCount; i++) { if (reportedProblems[i].isError()) errorCount++; } if (errorCount == this.problemCount) return reportedProblems; CategorizedProblem[] errors = new CategorizedProblem[errorCount]; int index = 0; for (int i = 0; i < this.problemCount; i++) { if (reportedProblems[i].isError()) errors[index++] = reportedProblems[i]; } return errors; }
/** * Answer the errors encountered during compilation. */ public CategorizedProblem[] getErrors() { CategorizedProblem[] reportedProblems = getProblems(); int errorCount = 0; for (int i = 0; i < this.problemCount; i++) { if (reportedProblems[i].isError()) errorCount++; } if (errorCount == this.problemCount) return reportedProblems; CategorizedProblem[] errors = new CategorizedProblem[errorCount]; int index = 0; for (int i = 0; i < this.problemCount; i++) { if (reportedProblems[i].isError()) errors[index++] = reportedProblems[i]; } return errors; }
/** * Answer the errors encountered during compilation. */ public CategorizedProblem[] getErrors() { CategorizedProblem[] reportedProblems = getProblems(); int errorCount = 0; for (int i = 0; i < this.problemCount; i++) { if (reportedProblems[i].isError()) errorCount++; } if (errorCount == this.problemCount) return reportedProblems; CategorizedProblem[] errors = new CategorizedProblem[errorCount]; int index = 0; for (int i = 0; i < this.problemCount; i++) { if (reportedProblems[i].isError()) errors[index++] = reportedProblems[i]; } return errors; }
/** * Answer the errors encountered during compilation. */ public CategorizedProblem[] getErrors() { CategorizedProblem[] reportedProblems = getProblems(); int errorCount = 0; for (int i = 0; i < this.problemCount; i++) { if (reportedProblems[i].isError()) errorCount++; } if (errorCount == this.problemCount) return reportedProblems; CategorizedProblem[] errors = new CategorizedProblem[errorCount]; int index = 0; for (int i = 0; i < this.problemCount; i++) { if (reportedProblems[i].isError()) errors[index++] = reportedProblems[i]; } return errors; }
/** * Answer the errors encountered during compilation. */ public CategorizedProblem[] getErrors() { CategorizedProblem[] reportedProblems = getProblems(); int errorCount = 0; for (int i = 0; i < this.problemCount; i++) { if (reportedProblems[i].isError()) errorCount++; } if (errorCount == this.problemCount) return reportedProblems; CategorizedProblem[] errors = new CategorizedProblem[errorCount]; int index = 0; for (int i = 0; i < this.problemCount; i++) { if (reportedProblems[i].isError()) errors[index++] = reportedProblems[i]; } return errors; }
/** * Answer the errors encountered during compilation. */ public CategorizedProblem[] getErrors() { CategorizedProblem[] reportedProblems = getProblems(); int errorCount = 0; for (int i = 0; i < this.problemCount; i++) { if (reportedProblems[i].isError()) errorCount++; } if (errorCount == this.problemCount) return reportedProblems; CategorizedProblem[] errors = new CategorizedProblem[errorCount]; int index = 0; for (int i = 0; i < this.problemCount; i++) { if (reportedProblems[i].isError()) errors[index++] = reportedProblems[i]; } return errors; }
@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()); } }
protected void updateProblemsFor(SourceFile sourceFile, CompilationResult result) throws CoreException { IMarker[] markers = JavaBuilder.getProblemsFor(sourceFile.resource); CategorizedProblem[] problems = result.getProblems(); if (problems == null && markers.length == 0) return; this.notifier.updateProblemCounts(markers, problems); JavaBuilder.removeProblemsFor(sourceFile.resource); storeProblemsFor(sourceFile, problems); }
protected void updateProblemsFor(SourceFile sourceFile, CompilationResult result) throws CoreException { if (CharOperation.equals(sourceFile.getMainTypeName(), TypeConstants.PACKAGE_INFO_NAME)) { IResource pkgResource = sourceFile.resource.getParent(); pkgResource.deleteMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_ZERO); } IMarker[] markers = JavaBuilder.getProblemsFor(sourceFile.resource); CategorizedProblem[] problems = result.getProblems(); if (problems == null && markers.length == 0) return; this.notifier.updateProblemCounts(markers, problems); JavaBuilder.removeProblemsFor(sourceFile.resource); storeProblemsFor(sourceFile, problems); }
protected void updateProblemsFor(SourceFile sourceFile, CompilationResult result) throws CoreException { if (CharOperation.equals(sourceFile.getMainTypeName(), TypeConstants.PACKAGE_INFO_NAME)) { IResource pkgResource = sourceFile.resource.getParent(); pkgResource.deleteMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_ZERO); } IMarker[] markers = JavaBuilder.getProblemsFor(sourceFile.resource); CategorizedProblem[] problems = result.getProblems(); if (problems == null && markers.length == 0) return; this.notifier.updateProblemCounts(markers, problems); JavaBuilder.removeProblemsFor(sourceFile.resource); storeProblemsFor(sourceFile, problems); }
protected void updateProblemsFor(SourceFile sourceFile, CompilationResult result) throws CoreException { if (CharOperation.equals(sourceFile.getMainTypeName(), TypeConstants.PACKAGE_INFO_NAME)) { IResource pkgResource = sourceFile.resource.getParent(); pkgResource.deleteMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_ZERO); } IMarker[] markers = JavaBuilder.getProblemsFor(sourceFile.resource); CategorizedProblem[] problems = result.getProblems(); if (problems == null && markers.length == 0) return; this.notifier.updateProblemCounts(markers, problems); JavaBuilder.removeProblemsFor(sourceFile.resource); storeProblemsFor(sourceFile, problems); }