Author: scabanovich
Date: 2009-12-02 10:08:33 -0500 (Wed, 02 Dec 2009)
New Revision: 18995
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ProjectHome.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4943
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ProjectHome.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ProjectHome.java 2009-12-02
15:07:59 UTC (rev 18994)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ProjectHome.java 2009-12-02
15:08:33 UTC (rev 18995)
@@ -96,7 +96,8 @@
//Taken from J2EEUtils and modified
public static IPath getWebInfPath(IProject project) {
- IVirtualComponent component = ComponentCore.createComponent(project);
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ if(component == null || component.getRootFolder() == null) return null;
IVirtualFolder webInfDir = component.getRootFolder().getFolder(new
Path("/WEB-INF")); //$NON-NLS-1$
IPath modulePath = webInfDir.getWorkspaceRelativePath();
return (!webInfDir.exists()) ? null : modulePath;
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 2009-12-02
15:07:59 UTC (rev 18994)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2009-12-02
15:08:33 UTC (rev 18995)
@@ -848,26 +848,6 @@
return false;
}
- public static IResource[] getJavaSourceRoots(IProject project) {
- IJavaProject javaProject = getJavaProject(project);
- if(javaProject == null) return null;
- List<IResource> resources = new ArrayList<IResource>();
- try {
- IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
- for (int i = 0; i < es.length; i++) {
- if(es[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) {
- IResource findMember =
ModelPlugin.getWorkspace().getRoot().findMember(es[i].getPath());
- if(findMember != null && findMember.exists()) {
- resources.add(findMember);
- }
- }
- }
- } catch(CoreException ce) {
- ModelPlugin.getPluginLog().logError("Error while locating java source roots for
" + project, ce); //$NON-NLS-1$
- }
- return resources.toArray(new IResource[resources.size()]);
- }
-
public static IResource getJavaSourceRoot(IProject project) {
IJavaProject javaProject = getJavaProject(project);
if(javaProject == null) return null;