Author: max.andersen(a)jboss.com
Date: 2007-11-16 07:36:22 -0500 (Fri, 16 Nov 2007)
New Revision: 4939
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModelCore.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java
Log:
JBIDE-1325 better fix
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModelCore.java
===================================================================
---
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModelCore.java 2007-11-16
09:49:59 UTC (rev 4938)
+++
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModelCore.java 2007-11-16
12:36:22 UTC (rev 4939)
@@ -91,6 +91,8 @@
public static IPath[] findMatchingPaths(IPath root, String includes, String excludes) {
try {
+ if(root==null) return new IPath[0];
+
DirectoryScanner scanner =
DirectoryScannerFactory.createDirectoryScanner(root, includes, excludes, true);
String[] files = scanner.getIncludedFiles();
@@ -102,8 +104,6 @@
} catch( IllegalStateException ise ) {
ArchivesCoreLog.log(IStatus.WARNING, "Error creating directory scanner",
ise);
return new IPath[]{};
- } catch( NullPointerException npe ) {
- return new IPath[]{};
}
}
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java
===================================================================
---
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java 2007-11-16
09:49:59 UTC (rev 4938)
+++
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java 2007-11-16
12:36:22 UTC (rev 4939)
@@ -2,6 +2,7 @@
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
@@ -296,7 +297,16 @@
} else {
rootProjectLabel.setText(parentNode.getProjectPath().lastSegment());
rootDirIsWorkspaceRelative = true;
- rootDir =
ResourcesPlugin.getWorkspace().getRoot().getProject(parentNode.getProjectPath().lastSegment()).getLocation();
+
+ // Done since the parentNode.getProjectPath() project might be *outside* the
workspace. Shouldn't the parentNode have a getProject() instead ?
+ IContainer[] findContainersForLocation =
ResourcesPlugin.getWorkspace().getRoot().findContainersForLocation(parentNode.getProjectPath());
+ for (int i = 0; i < findContainersForLocation.length; i++) {
+ IContainer container = findContainersForLocation[i];
+ if(container.getType()==IResource.PROJECT) {
+ rootDir = container.getLocation();
+ continue;
+ }
+ }
}
}
Show replies by date