[jbosstools-commits] JBoss Tools SVN: r23600 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Tue Jul 20 11:20:16 EDT 2010


Author: scabanovich
Date: 2010-07-20 11:20:15 -0400 (Tue, 20 Jul 2010)
New Revision: 23600

Modified:
   trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java
Log:
https://jira.jboss.org/browse/JBIDE-6610

Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java	2010-07-20 14:35:26 UTC (rev 23599)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java	2010-07-20 15:20:15 UTC (rev 23600)
@@ -54,11 +54,8 @@
 	IPath webinf = null;
 	
 	public IPath[] getPathsToVisit() {
-		IPath[] dest = new IPath[srcs.length + (webinf==null?0:1)];
-		System.arraycopy(srcs, 0, dest, 0, srcs.length);
-		if(webinf!=null) {
-			dest[srcs.length] = webinf;
-		}
+		IPath[] dest = new IPath[1];
+		dest[0] = p.getProject().getFullPath();
 		return dest;
 	}
 	
@@ -84,6 +81,7 @@
 	public boolean visit(IResource resource) {
 		if(resource instanceof IFile) {
 			IFile f = (IFile)resource;
+			if(!shouldVisitFile(f)) return false;
 			for (int i = 0; i < FILE_SCANNERS.length; i++) {
 				IFileScanner scanner = FILE_SCANNERS[i];
 				if(scanner.isRelevant(f)) {
@@ -104,8 +102,9 @@
 //					System.out.println("Time=" + timeUsed);
 				}
 			}
+			return true;
 		}
-		return true;
+		return shouldVisitFolder(resource);
 	}
 	
 	static long timeUsed = 0;
@@ -150,11 +149,7 @@
 		case IResourceDelta.CHANGED:
 			if(resource instanceof IFile) {
 				IFile f = (IFile)resource;
-				for (int i = 0; i < outs.length; i++) {
-					if(outs[i].isPrefixOf(resource.getFullPath())) {
-						return false;
-					}
-				}
+				if(!shouldVisitFile(f)) return false;
 				for (int i = 0; i < FILE_SCANNERS.length; i++) {
 					IFileScanner scanner = FILE_SCANNERS[i];
 					if(scanner.isRelevant(f)) {
@@ -177,26 +172,7 @@
 				}
 			}
 			if(resource instanceof IFolder) {
-				IPath path = resource.getFullPath();
-				for (int i = 0; i < outs.length; i++) {
-					if(outs[i].isPrefixOf(path)) {
-						return false;
-					}
-				}
-				for (int i = 0; i < srcs.length; i++) {
-					if(srcs[i].isPrefixOf(path) || path.isPrefixOf(srcs[i])) {
-						return true;
-					}
-				}
-				if(webinf != null) {
-					if(webinf.isPrefixOf(path) || path.isPrefixOf(webinf)) {
-						return true;
-					}
-				}
-				if(resource == resource.getProject()) {
-					return true;
-				}
-				return false;
+				return shouldVisitFolder(resource);
 			}
 			//return true to continue visiting children.
 			return true;
@@ -207,4 +183,36 @@
 		return true;
 	}
 
+	boolean shouldVisitFile(IResource resource) {
+		for (int i = 0; i < outs.length; i++) {
+			if(outs[i].isPrefixOf(resource.getFullPath())) {
+				return false;
+			}
+		}
+		return true;
+	}
+
+	boolean shouldVisitFolder(IResource resource) {
+		IPath path = resource.getFullPath();
+		for (int i = 0; i < outs.length; i++) {
+			if(outs[i].isPrefixOf(path)) {
+				return false;
+			}
+		}
+		for (int i = 0; i < srcs.length; i++) {
+			if(srcs[i].isPrefixOf(path) || path.isPrefixOf(srcs[i])) {
+				return true;
+			}
+		}
+		if(webinf != null) {
+			if(webinf.isPrefixOf(path) || path.isPrefixOf(webinf)) {
+				return true;
+			}
+		}
+		if(resource == resource.getProject()) {
+			return true;
+		}
+		return false;
+	}
+
 }



More information about the jbosstools-commits mailing list