Author: scabanovich
Date: 2012-01-27 16:15:14 -0500 (Fri, 27 Jan 2012)
New Revision: 38254
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
Log:
JBIDE-10739
https://issues.jboss.org/browse/JBIDE-10739
Method EclipseResourceUtil.getFirstWebContentResource() should just take first existing
element of array returned by getWebRootFolders; even if that fails, it should not try
another logic.
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 2012-01-27
21:08:52 UTC (rev 38253)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2012-01-27
21:15:14 UTC (rev 38254)
@@ -455,16 +455,12 @@
IVirtualComponent vc = ComponentCore.createComponent(project);
if (vc == null || vc.getRootFolder() == null)
return null;
- IPath path = WebUtils.getFirstWebContentPath(project);
- if(path != null) {
- IFolder f = ResourcesPlugin.getWorkspace().getRoot().getFolder(path);
- if(f.exists()) {
- return f;
+ IContainer[] cs = WebUtils.getWebRootFolders(project, true);
+ for (IContainer c: cs) {
+ if(c.exists()) {
+ return c;
}
}
- if (ModuleCoreNature.isFlexibleProject(project)) {
- return vc.getRootFolder().getUnderlyingResource();
- }
return null;
}