Author: rob.stryker(a)jboss.com
Date: 2007-11-20 20:01:12 -0500 (Tue, 20 Nov 2007)
New Revision: 4996
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspacePreferenceManager.java
Log:
JBIDE-1339 - Found the offending code. w00t
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspacePreferenceManager.java
===================================================================
---
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspacePreferenceManager.java 2007-11-21
00:54:55 UTC (rev 4995)
+++
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspacePreferenceManager.java 2007-11-21
01:01:12 UTC (rev 4996)
@@ -21,6 +21,7 @@
*/
package org.jboss.ide.eclipse.archives.core.model.other.internal;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -49,11 +50,15 @@
private static IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
private static IResource getResource(IPath path) {
- if( path != null && workspaceRoot.getLocation().isPrefixOf(path) ) {
- String relative =
path.toOSString().substring(workspaceRoot.getLocation().toOSString().length()+1);
- return workspaceRoot.getProject(relative);
+ if( path != null ) {
+ IProject[] projects = workspaceRoot.getProjects();
+ if( projects != null ) {
+ for( int i = 0; i < projects.length; i++ ) {
+ if( projects[i].getLocation().equals(path))
+ return projects[i];
+ }
+ }
}
-
return null;
}
Show replies by date