Author: scabanovich
Date: 2012-04-27 14:18:17 -0400 (Fri, 27 Apr 2012)
New Revision: 40576
Modified:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ContextValidationHelper.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidatorManager.java
Log:
JBIDE-11682
https://issues.jboss.org/browse/JBIDE-11682
Do not validate derived resources.
Modified:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ContextValidationHelper.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ContextValidationHelper.java 2012-04-27
18:07:30 UTC (rev 40575)
+++
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ContextValidationHelper.java 2012-04-27
18:18:17 UTC (rev 40576)
@@ -81,6 +81,9 @@
public void registerResource(IResource resource) {
if(resource instanceof IFile) {
IFile file = (IFile)resource;
+ if(file.isDerived(IResource.CHECK_ANCESTORS)) {
+ return;
+ }
if(validationContextManager == null) {
validationContextManager = new ValidationContext(file.getProject());
} else if(validationContextManager.isObsolete()) {
@@ -104,6 +107,7 @@
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
Set<IProject> projects = getAllProjects();
for (int i = 0; i < uris.length; i++) {
+ if(uris[i].endsWith(".jar") || uris[i].endsWith(".classpath"))
continue;
IFile currentFile = root.getFile(new Path(uris[i]));
if(projects.contains(currentFile.getProject())
&& !currentFile.isDerived(IResource.CHECK_ANCESTORS)) {
@@ -119,6 +123,16 @@
return result;
}
+ public boolean isClasspathAffected() {
+ String[] uris = getURIs();
+ for (String uri: uris) {
+ if(uri.endsWith(".jar") || uri.endsWith(".classpath")) {
+ return true;
+ }
+ }
+ return false;
+ }
+
public Set<IFile> getProjectSetRegisteredFiles() {
Set<IFile> result = new HashSet<IFile>();
Set<IFile> files = getValidationContextManager().getRegisteredFiles();
Modified:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidatorManager.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidatorManager.java 2012-04-27
18:07:30 UTC (rev 40575)
+++
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidatorManager.java 2012-04-27
18:18:17 UTC (rev 40576)
@@ -77,7 +77,7 @@
try {
validationContextManager.clearValidatedProjectsList();
Set<IFile> changedFiles = validationHelper.getChangedFiles();
- if(!changedFiles.isEmpty() || validationHelper.getURIs().length > 0) {
+ if((!validationHelper.isClasspathAffected() && (!changedFiles.isEmpty() ||
validationHelper.getURIs().length > 0))) {
status = validate(changedFiles, validationHelper, reporter, rootProjects);
} else if(!validationContextManager.getRegisteredFiles().isEmpty()) {
validationContextManager.clearAllResourceLinks(rootProjects);