Author: akazakov
Date: 2009-12-17 16:32:58 -0500 (Thu, 17 Dec 2009)
New Revision: 19453
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5518
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java 2009-12-17
21:11:35 UTC (rev 19452)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java 2009-12-17
21:32:58 UTC (rev 19453)
@@ -450,7 +450,7 @@
*/
public boolean shouldValidate(IProject project) {
try {
- return project.hasNature(JSFNature.NATURE_ID) &&
KbProject.checkKBBuilderInstalled(project);
+ return project!=null && project.isAccessible() &&
project.hasNature(JSFNature.NATURE_ID) &&
KbProject.checkKBBuilderInstalled(project);
} catch (CoreException e) {
JSFModelPlugin.getDefault().logError(e);
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2009-12-17
21:11:35 UTC (rev 19452)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2009-12-17
21:32:58 UTC (rev 19453)
@@ -878,7 +878,7 @@
* @param resource
*/
public static boolean checkKBBuilderInstalled(IResource resource) {
- IProject project = resource == null ? null : resource.getProject();
+ IProject project = resource == null || !resource.isAccessible() ? null :
resource.getProject();
if (project == null)
return false; // Cannot check anything
@@ -942,20 +942,22 @@
private static IMarker[] getOwnedMarkers(IResource r) {
ArrayList<IMarker> l = null;
try {
- IMarker[] ms = r.findMarkers(null, false, 1);
- if(ms != null) {
- for (int i = 0; i < ms.length; i++) {
- if(ms[i] == null) continue;
-
- String _type = ms[i].getType();
- if(_type == null) continue;
- if(!_type.equals(KB_PROBLEM_MARKER_TYPE)) continue;
- if(!ms[i].isSubtypeOf(IMarker.PROBLEM)) continue;
+ if(r!=null && r.isAccessible()) {
+ IMarker[] ms = r.findMarkers(null, false, 1);
+ if(ms != null) {
+ for (int i = 0; i < ms.length; i++) {
+ if(ms[i] == null) continue;
- if(l == null)
- l = new ArrayList<IMarker>();
-
- l.add(ms[i]);
+ String _type = ms[i].getType();
+ if(_type == null) continue;
+ if(!_type.equals(KB_PROBLEM_MARKER_TYPE)) continue;
+ if(!ms[i].isSubtypeOf(IMarker.PROBLEM)) continue;
+
+ if(l == null)
+ l = new ArrayList<IMarker>();
+
+ l.add(ms[i]);
+ }
}
}
} catch (CoreException e) {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2009-12-17
21:11:35 UTC (rev 19452)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2009-12-17
21:32:58 UTC (rev 19453)
@@ -104,7 +104,7 @@
SeamProjectsSet set = new SeamProjectsSet(project);
IProject war = set.getWarProject();
IValidationContext rootContext = null;
- if(war!=null) {
+ if(war!=null && war.isAccessible()) {
IKbProject kbProject = KbProjectFactory.getKbProject(war, false);
if(kbProject!=null) {
rootContext = kbProject.getValidationContext();
@@ -126,7 +126,9 @@
List<IProject> projects = new ArrayList<IProject>();
IProject[] array = set.getAllProjects();
for (int i = 0; i < array.length; i++) {
- projects.add(array[i]);
+ if(array[i].isAccessible()) {
+ projects.add(array[i]);
+ }
}
return new ValidatingProjectSet(project, projects, rootContext);
}
@@ -138,7 +140,7 @@
public boolean shouldValidate(IProject project) {
try {
// TODO check preferences
- return project.hasNature(ISeamProject.NATURE_ID);
+ return project!=null && project.isAccessible() &&
project.hasNature(ISeamProject.NATURE_ID);
} catch (CoreException e) {
SeamCorePlugin.getDefault().logError(e);
}