Author: scabanovich
Date: 2012-01-06 19:27:05 -0500 (Fri, 06 Jan 2012)
New Revision: 37705
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/WebValidator.java
Log:
JBIDE-10601
https://issues.joss.org/browse/JBIDE-10601
Check that EclipseUtil.getCompilationUnit(IFile) returns not null to determine if Java
file should be validated.
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/WebValidator.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/WebValidator.java 2012-01-07
00:26:17 UTC (rev 37704)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/WebValidator.java 2012-01-07
00:27:05 UTC (rev 37705)
@@ -15,6 +15,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.jboss.tools.common.EclipseUtil;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.validation.ContextValidationHelper;
import org.jboss.tools.common.validation.IProjectValidationContext;
@@ -79,6 +80,10 @@
if(shouldValidateJavaSources()) {
for (int i = 0; currentSources!=null && i < currentSources.length; i++) {
if(currentSources[i].getLocation().isPrefixOf(file.getLocation())) {
+ if(JAVA_EXT.equalsIgnoreCase(file.getFileExtension())) {
+ //check that Java is not excluded from class path.
+ return EclipseUtil.getCompilationUnit(file) != null;
+ }
return true;
}
}