Lines 50-55
Link Here
|
50 |
|
50 |
|
51 |
private boolean inCompiler; |
51 |
private boolean inCompiler; |
52 |
|
52 |
|
|
|
53 |
protected String missingClassFileName; |
53 |
protected SimpleSet filesWithAnnotations = null; |
54 |
protected SimpleSet filesWithAnnotations = null; |
54 |
|
55 |
|
55 |
public static int MAX_AT_ONCE = 2000; // best compromise between space used and speed |
56 |
public static int MAX_AT_ONCE = 2000; // best compromise between space used and speed |
Lines 84-89
Link Here
|
84 |
this.nameEnvironment = javaBuilder.nameEnvironment; |
85 |
this.nameEnvironment = javaBuilder.nameEnvironment; |
85 |
this.sourceLocations = this.nameEnvironment.sourceLocations; |
86 |
this.sourceLocations = this.nameEnvironment.sourceLocations; |
86 |
this.notifier = javaBuilder.notifier; |
87 |
this.notifier = javaBuilder.notifier; |
|
|
88 |
this.missingClassFileName = null; |
87 |
|
89 |
|
88 |
if (buildStarting) { |
90 |
if (buildStarting) { |
89 |
this.newState = newState == null ? new State(javaBuilder) : newState; |
91 |
this.newState = newState == null ? new State(javaBuilder) : newState; |
Lines 546-553
Link Here
|
546 |
*/ |
548 |
*/ |
547 |
protected void storeProblemsFor(SourceFile sourceFile, CategorizedProblem[] problems) throws CoreException { |
549 |
protected void storeProblemsFor(SourceFile sourceFile, CategorizedProblem[] problems) throws CoreException { |
548 |
if (sourceFile == null || problems == null || problems.length == 0) return; |
550 |
if (sourceFile == null || problems == null || problems.length == 0) return; |
|
|
551 |
// once a classpath error is found, ignore all other problems for this project so the user can see the main error |
552 |
// but still try to compile as many source files as possible to help the case when the base libraries are in source |
553 |
if (this.missingClassFileName != null) return; |
549 |
|
554 |
|
550 |
String missingClassFile = null; |
|
|
551 |
IResource resource = sourceFile.resource; |
555 |
IResource resource = sourceFile.resource; |
552 |
HashSet managedMarkerTypes = JavaModelManager.getJavaModelManager().compilationParticipants.managedMarkerTypes(); |
556 |
HashSet managedMarkerTypes = JavaModelManager.getJavaModelManager().compilationParticipants.managedMarkerTypes(); |
553 |
for (int i = 0, l = problems.length; i < l; i++) { |
557 |
for (int i = 0, l = problems.length; i < l; i++) { |
Lines 556-569
Link Here
|
556 |
if (id == IProblem.IsClassPathCorrect) { |
560 |
if (id == IProblem.IsClassPathCorrect) { |
557 |
JavaBuilder.removeProblemsAndTasksFor(javaBuilder.currentProject); // make this the only problem for this project |
561 |
JavaBuilder.removeProblemsAndTasksFor(javaBuilder.currentProject); // make this the only problem for this project |
558 |
String[] args = problem.getArguments(); |
562 |
String[] args = problem.getArguments(); |
559 |
missingClassFile = args[0]; |
563 |
this.missingClassFileName = args[0]; |
|
|
564 |
|
565 |
if (JavaBuilder.DEBUG) |
566 |
System.out.println(Messages.bind(Messages.build_incompleteClassPath, this.missingClassFileName)); |
567 |
IMarker marker = this.javaBuilder.currentProject.createMarker(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER); |
568 |
marker.setAttribute(IMarker.MESSAGE, Messages.bind(Messages.build_incompleteClassPath, this.missingClassFileName)); |
569 |
marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR); |
570 |
marker.setAttribute(IJavaModelMarker.CATEGORY_ID, CategorizedProblem.CAT_BUILDPATH); |
560 |
} |
571 |
} |
561 |
|
572 |
|
562 |
String markerType = problem.getMarkerType(); |
573 |
String markerType = problem.getMarkerType(); |
563 |
if (IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER.equals(markerType) |
574 |
if (IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER.equals(markerType) || managedMarkerTypes.contains(markerType)) { |
564 |
|| managedMarkerTypes.contains(markerType)) { |
|
|
565 |
IMarker marker = resource.createMarker(markerType); |
575 |
IMarker marker = resource.createMarker(markerType); |
566 |
|
576 |
|
567 |
// standard attributes |
577 |
// standard attributes |
568 |
marker.setAttributes( |
578 |
marker.setAttributes( |
569 |
JAVA_PROBLEM_MARKER_ATTRIBUTE_NAMES, |
579 |
JAVA_PROBLEM_MARKER_ATTRIBUTE_NAMES, |
Lines 585-592
Link Here
|
585 |
marker.setAttributes(extraAttributeNames, problem.getExtraMarkerAttributeValues()); |
595 |
marker.setAttributes(extraAttributeNames, problem.getExtraMarkerAttributeValues()); |
586 |
} |
596 |
} |
587 |
} |
597 |
} |
588 |
if (missingClassFile != null) |
598 |
if (this.missingClassFileName != null) return; // only want the one error recorded on this source file |
589 |
throw new MissingClassFileException(missingClassFile); |
|
|
590 |
} |
599 |
} |
591 |
} |
600 |
} |
592 |
|
601 |
|