Author: scabanovich
Date: 2007-08-28 08:47:25 -0400 (Tue, 28 Aug 2007)
New Revision: 3375
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
Log:
JBIDE-820 Null pointer prevented for ejb project
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2007-08-28
11:46:59 UTC (rev 3374)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2007-08-28
12:47:25 UTC (rev 3375)
@@ -462,14 +462,14 @@
if(!project.hasNature(JavaCore.NATURE_ID)) return null;
ArrayList<String> l = new ArrayList<String>();
IJavaProject javaProject = JavaCore.create(project);
- try {
- IPath p = javaProject.getOutputLocation();
- IResource r = project.getWorkspace().getRoot().findMember(p);
+
+ IPath p = javaProject.getOutputLocation();
+ IResource r = p == null ? null : project.getWorkspace().getRoot().findMember(p);
+ if(r != null && r.getLocation() != null && r.exists()) {
String s = r.getLocation().toString();
l.add(new java.io.File(s).getCanonicalPath());
- } catch (JavaModelException e) {
- throw new Exception("Cannot find output for project " + project,e);
}
+
IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
for (int i = 0; i < es.length; i++) {
try {
Show replies by date