@Override protected void storeProblemsFor(SourceFile sourceFile, CategorizedProblem[] problems) throws CoreException { if (sourceFile == null || problems == null || problems.length == 0) return; for (int i = problems.length; --i >= 0;) { CategorizedProblem problem = problems[i]; if (problem != null && problem.getID() == IProblem.UndefinedType) { if (this.typeLocatorsWithUndefinedTypes == null) this.typeLocatorsWithUndefinedTypes = new HashSet<>(3); this.typeLocatorsWithUndefinedTypes.add(sourceFile.typeLocator()); break; } } super.storeProblemsFor(sourceFile, problems); }
@Override protected void compile(SourceFile[] units, SourceFile[] additionalUnits, boolean compilingFirstGroup) { if (compilingFirstGroup && additionalUnits != null) { // add any source file from additionalUnits to units if it defines secondary types // otherwise its possible during testing with MAX_AT_ONCE == 1 that a secondary type // can cause an infinite loop as it alternates between not found and defined, see bug 146324 ArrayList extras = null; for (int i = 0, l = additionalUnits.length; i < l; i++) { SourceFile unit = additionalUnits[i]; if (unit != null && this.newState.getDefinedTypeNamesFor(unit.typeLocator()) != null) { if (JavaBuilder.DEBUG) System.out.println("About to compile file with secondary types "+ unit.typeLocator()); //$NON-NLS-1$ if (extras == null) extras = new ArrayList(3); extras.add(unit); } } if (extras != null) { int oldLength = units.length; int toAdd = extras.size(); System.arraycopy(units, 0, units = new SourceFile[oldLength + toAdd], 0, oldLength); for (int i = 0; i < toAdd; i++) units[oldLength++] = (SourceFile) extras.get(i); } } super.compile(units, additionalUnits, compilingFirstGroup); }
protected void compile(SourceFile[] units, SourceFile[] additionalUnits, boolean compilingFirstGroup) { if (compilingFirstGroup && additionalUnits != null) { // add any source file from additionalUnits to units if it defines secondary types // otherwise its possible during testing with MAX_AT_ONCE == 1 that a secondary type // can cause an infinite loop as it alternates between not found and defined, see bug 146324 ArrayList extras = null; for (int i = 0, l = additionalUnits.length; i < l; i++) { SourceFile unit = additionalUnits[i]; if (unit != null && this.newState.getDefinedTypeNamesFor(unit.typeLocator()) != null) { if (JavaBuilder.DEBUG) System.out.println("About to compile file with secondary types "+ unit.typeLocator()); //$NON-NLS-1$ if (extras == null) extras = new ArrayList(3); extras.add(unit); } } if (extras != null) { int oldLength = units.length; int toAdd = extras.size(); System.arraycopy(units, 0, units = new SourceFile[oldLength + toAdd], 0, oldLength); for (int i = 0; i < toAdd; i++) units[oldLength++] = (SourceFile) extras.get(i); } } super.compile(units, additionalUnits, compilingFirstGroup); }
protected void compile(SourceFile[] units, SourceFile[] additionalUnits, boolean compilingFirstGroup) { if (compilingFirstGroup && additionalUnits != null) { // add any source file from additionalUnits to units if it defines secondary types // otherwise its possible during testing with MAX_AT_ONCE == 1 that a secondary type // can cause an infinite loop as it alternates between not found and defined, see bug 146324 ArrayList extras = null; for (int i = 0, l = additionalUnits.length; i < l; i++) { SourceFile unit = additionalUnits[i]; if (unit != null && this.newState.getDefinedTypeNamesFor(unit.typeLocator()) != null) { if (JavaBuilder.DEBUG) System.out.println("About to compile file with secondary types "+ unit.typeLocator()); //$NON-NLS-1$ if (extras == null) extras = new ArrayList(3); extras.add(unit); } } if (extras != null) { int oldLength = units.length; int toAdd = extras.size(); System.arraycopy(units, 0, units = new SourceFile[oldLength + toAdd], 0, oldLength); for (int i = 0; i < toAdd; i++) units[oldLength++] = (SourceFile) extras.get(i); } } super.compile(units, additionalUnits, compilingFirstGroup); }
protected void compile(SourceFile[] units, SourceFile[] additionalUnits, boolean compilingFirstGroup) { if (compilingFirstGroup && additionalUnits != null) { // add any source file from additionalUnits to units if it defines secondary types // otherwise its possible during testing with MAX_AT_ONCE == 1 that a secondary type // can cause an infinite loop as it alternates between not found and defined, see bug 146324 ArrayList extras = null; for (int i = 0, l = additionalUnits.length; i < l; i++) { SourceFile unit = additionalUnits[i]; if (unit != null && this.newState.getDefinedTypeNamesFor(unit.typeLocator()) != null) { if (JavaBuilder.DEBUG) System.out.println("About to compile file with secondary types "+ unit.typeLocator()); //$NON-NLS-1$ if (extras == null) extras = new ArrayList(3); extras.add(unit); } } if (extras != null) { int oldLength = units.length; int toAdd = extras.size(); System.arraycopy(units, 0, units = new SourceFile[oldLength + toAdd], 0, oldLength); for (int i = 0; i < toAdd; i++) units[oldLength++] = (SourceFile) extras.get(i); } } super.compile(units, additionalUnits, compilingFirstGroup); }
protected void compile(SourceFile[] units, SourceFile[] additionalUnits, boolean compilingFirstGroup) { if (compilingFirstGroup && additionalUnits != null) { // add any source file from additionalUnits to units if it defines secondary types // otherwise its possible during testing with MAX_AT_ONCE == 1 that a secondary type // can cause an infinite loop as it alternates between not found and defined, see bug 146324 ArrayList extras = null; for (int i = 0, l = additionalUnits.length; i < l; i++) { SourceFile unit = additionalUnits[i]; if (unit != null && this.newState.getDefinedTypeNamesFor(unit.typeLocator()) != null) { if (JavaBuilder.DEBUG) System.out.println("About to compile file with secondary types "+ unit.typeLocator()); //$NON-NLS-1$ if (extras == null) extras = new ArrayList(3); extras.add(unit); } } if (extras != null) { int oldLength = units.length; int toAdd = extras.size(); System.arraycopy(units, 0, units = new SourceFile[oldLength + toAdd], 0, oldLength); for (int i = 0; i < toAdd; i++) units[oldLength++] = (SourceFile) extras.get(i); } } super.compile(units, additionalUnits, compilingFirstGroup); }
protected void compile(SourceFile[] units, SourceFile[] additionalUnits, boolean compilingFirstGroup) { if (compilingFirstGroup && additionalUnits != null) { // add any source file from additionalUnits to units if it defines secondary types // otherwise its possible during testing with MAX_AT_ONCE == 1 that a secondary type // can cause an infinite loop as it alternates between not found and defined, see bug 146324 ArrayList extras = null; for (int i = 0, l = additionalUnits.length; i < l; i++) { SourceFile unit = additionalUnits[i]; if (unit != null && this.newState.getDefinedTypeNamesFor(unit.typeLocator()) != null) { if (JavaBuilder.DEBUG) System.out.println("About to compile file with secondary types "+ unit.typeLocator()); //$NON-NLS-1$ if (extras == null) extras = new ArrayList(3); extras.add(unit); } } if (extras != null) { int oldLength = units.length; int toAdd = extras.size(); System.arraycopy(units, 0, units = new SourceFile[oldLength + toAdd], 0, oldLength); for (int i = 0; i < toAdd; i++) units[oldLength++] = (SourceFile) extras.get(i); } } super.compile(units, additionalUnits, compilingFirstGroup); }
protected void storeProblemsFor(SourceFile sourceFile, CategorizedProblem[] problems) throws CoreException { if (sourceFile == null || problems == null || problems.length == 0) return; for (int i = problems.length; --i >= 0;) { CategorizedProblem problem = problems[i]; if (problem != null && problem.getID() == IProblem.UndefinedType) { if (this.typeLocatorsWithUndefinedTypes == null) this.typeLocatorsWithUndefinedTypes = new StringSet(3); this.typeLocatorsWithUndefinedTypes.add(sourceFile.typeLocator()); break; } } super.storeProblemsFor(sourceFile, problems); }
protected void storeProblemsFor(SourceFile sourceFile, CategorizedProblem[] problems) throws CoreException { if (sourceFile == null || problems == null || problems.length == 0) return; for (int i = problems.length; --i >= 0;) { CategorizedProblem problem = problems[i]; if (problem != null && problem.getID() == IProblem.UndefinedType) { if (this.typeLocatorsWithUndefinedTypes == null) this.typeLocatorsWithUndefinedTypes = new StringSet(3); this.typeLocatorsWithUndefinedTypes.add(sourceFile.typeLocator()); break; } } super.storeProblemsFor(sourceFile, problems); }
protected void storeProblemsFor(SourceFile sourceFile, CategorizedProblem[] problems) throws CoreException { if (sourceFile == null || problems == null || problems.length == 0) return; for (int i = problems.length; --i >= 0;) { CategorizedProblem problem = problems[i]; if (problem != null && problem.getID() == IProblem.UndefinedType) { if (this.typeLocatorsWithUndefinedTypes == null) this.typeLocatorsWithUndefinedTypes = new StringSet(3); this.typeLocatorsWithUndefinedTypes.add(sourceFile.typeLocator()); break; } } super.storeProblemsFor(sourceFile, problems); }
protected void storeProblemsFor(SourceFile sourceFile, CategorizedProblem[] problems) throws CoreException { if (sourceFile == null || problems == null || problems.length == 0) return; for (int i = problems.length; --i >= 0;) { CategorizedProblem problem = problems[i]; if (problem != null && problem.getID() == IProblem.UndefinedType) { if (this.typeLocatorsWithUndefinedTypes == null) this.typeLocatorsWithUndefinedTypes = new StringSet(3); this.typeLocatorsWithUndefinedTypes.add(sourceFile.typeLocator()); break; } } super.storeProblemsFor(sourceFile, problems); }
protected void storeProblemsFor(SourceFile sourceFile, CategorizedProblem[] problems) throws CoreException { if (sourceFile == null || problems == null || problems.length == 0) return; for (int i = problems.length; --i >= 0;) { CategorizedProblem problem = problems[i]; if (problem != null && problem.getID() == IProblem.UndefinedType) { if (this.typeLocatorsWithUndefinedTypes == null) this.typeLocatorsWithUndefinedTypes = new StringSet(3); this.typeLocatorsWithUndefinedTypes.add(sourceFile.typeLocator()); break; } } super.storeProblemsFor(sourceFile, problems); }
protected void recordParticipantResult(CompilationParticipantResult result) { // any added/changed/deleted generated files have already been taken care // just record the problems and dependencies - do not expect there to be many // must be called after we're finished with the compilation unit results but before incremental loop adds affected files CategorizedProblem[] problems = result.problems; if (problems != null && problems.length > 0) { // existing problems have already been removed so just add these as new problems this.notifier.updateProblemCounts(problems); try { storeProblemsFor(result.sourceFile, problems); } catch (CoreException e) { // must continue with compile loop so just log the CoreException Util.log(e, "JavaBuilder logging CompilationParticipant's CoreException to help debugging"); //$NON-NLS-1$ } } String[] dependencies = result.dependencies; if (dependencies != null) { ReferenceCollection refs = (ReferenceCollection) this.newState.references.get(result.sourceFile.typeLocator()); if (refs != null) refs.addDependencies(dependencies); } }
protected void recordParticipantResult(CompilationParticipantResult result) { // any added/changed/deleted generated files have already been taken care // just record the problems and dependencies - do not expect there to be many // must be called after we're finished with the compilation unit results but before incremental loop adds affected files CategorizedProblem[] problems = result.problems; if (problems != null && problems.length > 0) { // existing problems have already been removed so just add these as new problems this.notifier.updateProblemCounts(problems); try { storeProblemsFor(result.sourceFile, problems); } catch (CoreException e) { // must continue with compile loop so just log the CoreException Util.log(e, "JavaBuilder logging CompilationParticipant's CoreException to help debugging"); //$NON-NLS-1$ } } String[] dependencies = result.dependencies; if (dependencies != null) { ReferenceCollection refs = (ReferenceCollection) this.newState.references.get(result.sourceFile.typeLocator()); if (refs != null) refs.addDependencies(dependencies); } }
protected void recordParticipantResult(CompilationParticipantResult result) { // any added/changed/deleted generated files have already been taken care // just record the problems and dependencies - do not expect there to be many // must be called after we're finished with the compilation unit results but before incremental loop adds affected files CategorizedProblem[] problems = result.problems; if (problems != null && problems.length > 0) { // existing problems have already been removed so just add these as new problems this.notifier.updateProblemCounts(problems); try { storeProblemsFor(result.sourceFile, problems); } catch (CoreException e) { // must continue with compile loop so just log the CoreException Util.log(e, "JavaBuilder logging CompilationParticipant's CoreException to help debugging"); //$NON-NLS-1$ } } String[] dependencies = result.dependencies; if (dependencies != null) { ReferenceCollection refs = (ReferenceCollection) this.newState.references.get(result.sourceFile.typeLocator()); if (refs != null) refs.addDependencies(dependencies); } }
protected void recordParticipantResult(CompilationParticipantResult result) { // any added/changed/deleted generated files have already been taken care // just record the problems and dependencies - do not expect there to be many // must be called after we're finished with the compilation unit results but before incremental loop adds affected files CategorizedProblem[] problems = result.problems; if (problems != null && problems.length > 0) { // existing problems have already been removed so just add these as new problems this.notifier.updateProblemCounts(problems); try { storeProblemsFor(result.sourceFile, problems); } catch (CoreException e) { // must continue with compile loop so just log the CoreException Util.log(e, "JavaBuilder logging CompilationParticipant's CoreException to help debugging"); //$NON-NLS-1$ } } String[] dependencies = result.dependencies; if (dependencies != null) { ReferenceCollection refs = (ReferenceCollection) this.newState.references.get(result.sourceFile.typeLocator()); if (refs != null) refs.addDependencies(dependencies); } }
protected void recordParticipantResult(CompilationParticipantResult result) { // any added/changed/deleted generated files have already been taken care // just record the problems and dependencies - do not expect there to be many // must be called after we're finished with the compilation unit results but before incremental loop adds affected files CategorizedProblem[] problems = result.problems; if (problems != null && problems.length > 0) { // existing problems have already been removed so just add these as new problems this.notifier.updateProblemCounts(problems); try { storeProblemsFor(result.sourceFile, problems); } catch (CoreException e) { // must continue with compile loop so just log the CoreException Util.log(e, "JavaBuilder logging CompilationParticipant's CoreException to help debugging"); //$NON-NLS-1$ } } String[] dependencies = result.dependencies; if (dependencies != null) { ReferenceCollection refs = (ReferenceCollection) this.newState.references.get(result.sourceFile.typeLocator()); if (refs != null) refs.addDependencies(dependencies); } }
protected void recordParticipantResult(CompilationParticipantResult result) { // any added/changed/deleted generated files have already been taken care // just record the problems and dependencies - do not expect there to be many // must be called after we're finished with the compilation unit results but before incremental loop adds affected files CategorizedProblem[] problems = result.problems; if (problems != null && problems.length > 0) { // existing problems have already been removed so just add these as new problems this.notifier.updateProblemCounts(problems); try { storeProblemsFor(result.sourceFile, problems); } catch (CoreException e) { // must continue with compile loop so just log the CoreException Util.log(e, "JavaBuilder logging CompilationParticipant's CoreException to help debugging"); //$NON-NLS-1$ } } String[] dependencies = result.dependencies; if (dependencies != null) { ReferenceCollection refs = (ReferenceCollection) this.newState.references.get(result.sourceFile.typeLocator()); if (refs != null) refs.addDependencies(dependencies); } }
String typeLocator = sourceFile.typeLocator(); int mdSegmentCount = sourceFile.sourceLocation.sourceFolder.getFullPath().segmentCount(); IPath typePath = sourceFile.resource.getFullPath().removeFirstSegments(mdSegmentCount).removeFileExtension();
String typeLocator = sourceFile.typeLocator(); int mdSegmentCount = sourceFile.sourceLocation.sourceFolder.getFullPath().segmentCount(); IPath typePath = sourceFile.resource.getFullPath().removeFirstSegments(mdSegmentCount).removeFileExtension();