Author: fbricon
Date: 2011-10-18 14:02:11 -0400 (Tue, 18 Oct 2011)
New Revision: 35770
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java
Log:
JBIDE-9863 : ProjectExamplesFix assumes the Eclipse project name is identical to the
Example name, which is wrong in case of archetype-based projects, so need to check if
project exists before looking for error markers.
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java
===================================================================
---
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java 2011-10-18
17:58:45 UTC (rev 35769)
+++
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java 2011-10-18
18:02:11 UTC (rev 35770)
@@ -223,13 +223,17 @@
String projectName) throws CoreException {
IProject eclipseProject = ResourcesPlugin.getWorkspace()
.getRoot().getProject(projectName);
- IMarker[] projectMarkers = eclipseProject.findMarkers(
- IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
- for (int i = 0; i < projectMarkers.length; i++) {
- if (projectMarkers[i].getAttribute(IMarker.SEVERITY,
- IMarker.SEVERITY_ERROR) == IMarker.SEVERITY_ERROR) {
- markers.add(projectMarkers[i]);
+ if (eclipseProject.isAccessible()) {
+ IMarker[] projectMarkers = eclipseProject.findMarkers(
+ IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
+ for (int i = 0; i < projectMarkers.length; i++) {
+ if (projectMarkers[i].getAttribute(IMarker.SEVERITY,
+ IMarker.SEVERITY_ERROR) == IMarker.SEVERITY_ERROR) {
+ markers.add(projectMarkers[i]);
+ }
}
+ } else {
+ log(projectName + " is inaccessible");
}
return markers;
}
Show replies by date