Author: akazakov
Date: 2009-02-19 07:27:06 -0500 (Thu, 19 Feb 2009)
New Revision: 13674
Modified:
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-3823 Revalidate unresolver Seam ELs only if
changed file is java source or components.xml. - Fixed
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-02-19
11:00:34 UTC (rev 13673)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2009-02-19
12:27:06 UTC (rev 13674)
@@ -10,12 +10,10 @@
******************************************************************************/
package org.jboss.tools.seam.internal.core.validation;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -124,10 +122,16 @@
// Collect all resources which we must validate.
Set<IPath> resources = new HashSet<IPath>(); // Resources which we have to
validate.
Set<IPath> newResources = new HashSet<IPath>(); // New (unlinked) resources
file
+ boolean validateUnnamedResources = false;
for(IFile currentFile : changedFiles) {
if(reporter.isCancelled()) {
break;
}
+ if(!validateUnnamedResources) {
+ String fileName = currentFile.getName().toLowerCase();
+ // We need to check only file names here.
+ validateUnnamedResources = fileName.endsWith(".java") ||
fileName.equals("components.xml"); //$NON-NLS-1$ $NON-NLS-2$
+ }
if (checkFileExtension(currentFile)) {
validateXMLVersion(currentFile);
// Get all variable names which were linked with this resource.
@@ -175,14 +179,16 @@
validateFactory(linkedResource, markedDuplicateFactoryNames);
}
- // Validate all unnamed resources.
- Set<IPath> unnamedResources = validationContext.getUnnamedCoreResources();
- newResources.addAll(unnamedResources);
- for (IPath path : newResources) {
- displaySubtask(VALIDATING_RESOURCE_MESSAGE_ID, new String[]{projectName,
path.toString()});
- Set<SeamJavaComponentDeclaration> declarations =
((SeamProject)seamProject).findJavaDeclarations(path);
- for (SeamJavaComponentDeclaration d : declarations) {
- validateMethodsOfUnknownComponent(d);
+ // If changed files are *.java or component.xml then re-validate all unnamed
resources.
+ if(validateUnnamedResources) {
+ Set<IPath> unnamedResources = validationContext.getUnnamedCoreResources();
+ newResources.addAll(unnamedResources);
+ for (IPath path : newResources) {
+ displaySubtask(VALIDATING_RESOURCE_MESSAGE_ID, new String[]{projectName,
path.toString()});
+ Set<SeamJavaComponentDeclaration> declarations =
((SeamProject)seamProject).findJavaDeclarations(path);
+ for (SeamJavaComponentDeclaration d : declarations) {
+ validateMethodsOfUnknownComponent(d);
+ }
}
}