Author: tfennelly
Date: 2009-12-01 18:00:49 -0500 (Tue, 01 Dec 2009)
New Revision: 18958
Modified:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/ProjectClassLoader.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5342
ProjectClassLoader not resolving internal project jar files
Modified:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/ProjectClassLoader.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/ProjectClassLoader.java 2009-12-01
21:42:18 UTC (rev 18957)
+++
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/ProjectClassLoader.java 2009-12-01
23:00:49 UTC (rev 18958)
@@ -8,10 +8,12 @@
import java.util.List;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
@@ -84,6 +86,16 @@
roots[i].getPath().makeAbsolute().toFile()
.toURL()).getFile());
}
+ if (!f.exists()) {
+ IJavaElement javaElement = roots[i].getPrimaryElement();
+ String jarName = javaElement.getElementName();
+ IResource jarResource = project.getProject().findMember(jarName);
+
+ if(jarResource != null) {
+ f = jarResource.getRawLocation().toFile();
+ }
+ }
+
list.add(f.toURL());
} else {
IPath path = roots[i].getJavaProject().getOutputLocation();
@@ -99,6 +111,7 @@
}
}
} catch (Exception e) {
+ e.printStackTrace();
}
}