woproject/projects/wolips/plugins/org.objectstyle.wolips/java/org/objectstyle/wolips/core/resources/internal/types/file ProjectPatternsets.java,1.1,1.2

[email protected] Wed, 5 Apr 2006 00:09:10 -0700 (PDT)
Newsgroups gmane.comp.web.webobjects.woproject.cvs
Message-ID <[email protected]>
Update of /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips/java/org/objectstyle/wolips/core/resources/internal/types/file
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24447/wolips/plugins/org.objectstyle.wolips/java/org/objectstyle/wolips/core/resources/internal/types/file

Modified Files:
	ProjectPatternsets.java 
Log Message:
fixed http://objectstyle.org/jira/browse/WOL-224
Wrong exclude match on single resource files.





Index: ProjectPatternsets.java
===================================================================
RCS file: /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips/java/org/objectstyle/wolips/core/resources/internal/types/file/ProjectPatternsets.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ProjectPatternsets.java	25 Mar 2006 11:30:50 -0000	1.1
+++ ProjectPatternsets.java	5 Apr 2006 07:08:05 -0000	1.2
@@ -57,6 +57,7 @@
 
 import java.io.File;
 import java.util.ArrayList;
+import java.util.Arrays;
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IFolder;
@@ -317,27 +318,21 @@
 
 	private String[] toProjectRelativePaths(IResource resource) {
 		String[] returnValue = null;
-		if (resource.getParent().getType() != IResource.ROOT
-		/* && resource.getParent().getType() != IResource.PROJECT */) {
-			returnValue = new String[2];
+		if (resource.getParent().getType() != IResource.ROOT) {
+
 			String string = null;
 			if (resource.getType() != IResource.FOLDER) {
-				IPath path = resource.getParent().getProjectRelativePath();
-				/*
-				 * String string = resource.getProject().getName() + "/" +
-				 * path.toString() + "/";
-				 */
-				string = path.toString() + "/";
+				returnValue = new String[1];
 			} else {
+				returnValue = new String[2];
 				string = "/" + resource.getName() + "/";
+				returnValue[0] = string;
 			}
-			returnValue[0] = string;
+
 		} else {
 			returnValue = new String[1];
 		}
 		IPath path = resource.getProjectRelativePath();
-		//String string = resource.getProject().getName() + "/" +
-		// path.toString();
 		String string = path.toString();
 		if (returnValue.length == 2) {
 			returnValue[1] = string;
@@ -347,10 +342,10 @@
 		return returnValue;
 	}
 
-	/**
-	 * @param resource
-	 * @return true if the resource matches the classes pattern
-	 */
+	  /**
+		 * @param resource
+		 * @return true if the resource matches the classes pattern
+		 */
 	public boolean matchesClassesPattern(IResource resource) {
 		String[] strings = this.toProjectRelativePaths(resource);
 		if (this.getClassesExcludeMatcher().match(strings))



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642