NPE when editing a JSP file in maven project with war overlays
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FacetModuleCoreSupportDelegate.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FacetModuleCoreSupportDelegate.java
index cf88d12..e58f012 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FacetModuleCoreSupportDelegate.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FacetModuleCoreSupportDelegate.java
@@ -189,13 +189,17 @@
if (rootFolder == null)
continue;
IPath referencedPathRoot = rootFolder.getWorkspaceRelativePath();
- /*
- * See Servlet 3.0, section 4.6 ; this is the only referenced
- * module/component type we support
- */
- IPath resolved = referencedPathRoot.append(FacetModuleCoreSupport.META_INF_RESOURCES).append(runtimeReference);
- if (resolved != null && component.getProject().findMember(resolved.removeFirstSegments(1)) != null)
- return resolved;
+ /* http://bugs.eclipse.org/410161 */
+ if (referencedPathRoot != null) {
+ /*
+ * See Servlet 3.0, section 4.6 ; this is the only
+ * referenced module/component type we support
+ */
+ IPath resolved = referencedPathRoot.append(FacetModuleCoreSupport.META_INF_RESOURCES).append(runtimeReference);
+ if (resolved != null && component.getProject().findMember(resolved.removeFirstSegments(1)) != null) {
+ return resolved;
+ }
+ }
}
}
return null;
@@ -304,13 +308,17 @@
if (rootFolder == null)
continue;
IPath referencedPathRoot = rootFolder.getWorkspaceRelativePath();
- /*
- * See Servlet 3.0, section 4.6 ; this is the only
- * referenced module/component type we support
- */
- IPath resources = referencedPathRoot.append(FacetModuleCoreSupport.META_INF_RESOURCES);
- if (resources != null && component.getProject().findMember(resources.removeFirstSegments(1)) != null)
- paths.add(resources);
+ /* http://bugs.eclipse.org/410161 */
+ if (referencedPathRoot != null) {
+ /*
+ * See Servlet 3.0, section 4.6 ; this is the only
+ * referenced module/component type we support
+ */
+ IPath resources = referencedPathRoot.append(FacetModuleCoreSupport.META_INF_RESOURCES);
+ if (resources != null && component.getProject().findMember(resources.removeFirstSegments(1)) != null) {
+ paths.add(resources);
+ }
+ }
}
}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/FacetModuleCoreSupportDelegate.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/FacetModuleCoreSupportDelegate.java
index 9a5b2cf..3df1ad5 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/FacetModuleCoreSupportDelegate.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/FacetModuleCoreSupportDelegate.java
@@ -126,13 +126,17 @@
if (rootFolder == null)
continue;
IPath referencedPathRoot = rootFolder.getWorkspaceRelativePath();
- /*
- * See Servlet 3.0, section 4.6 ; this is the only
- * referenced module/component type we support
- */
- IPath resources = referencedPathRoot.append(FacetModuleCoreSupport.META_INF_RESOURCES);
- if (resources != null && component.getProject().findMember(resources.removeFirstSegments(1)) != null)
- paths.add(resources);
+ /* http://bugs.eclipse.org/410161 */
+ if (referencedPathRoot != null) {
+ /*
+ * See Servlet 3.0, section 4.6 ; this is the only
+ * referenced module/component type we support
+ */
+ IPath resources = referencedPathRoot.append(FacetModuleCoreSupport.META_INF_RESOURCES);
+ if (resources != null && component.getProject().findMember(resources.removeFirstSegments(1)) != null) {
+ paths.add(resources);
+ }
+ }
}
}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupportDelegate.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupportDelegate.java
index 3e67b8a..77bb9cf 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupportDelegate.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupportDelegate.java
@@ -126,13 +126,17 @@
if (rootFolder == null)
continue;
IPath referencedPathRoot = rootFolder.getWorkspaceRelativePath();
- /*
- * See Servlet 3.0, section 4.6 ; this is the only
- * referenced module/component type we support
- */
- IPath resources = referencedPathRoot.append(FacetModuleCoreSupport.META_INF_RESOURCES);
- if (resources != null && component.getProject().findMember(resources.removeFirstSegments(1)) != null)
- paths.add(resources);
+ /* http://bugs.eclipse.org/410161 */
+ if (referencedPathRoot != null) {
+ /*
+ * See Servlet 3.0, section 4.6 ; this is the only
+ * referenced module/component type we support
+ */
+ IPath resources = referencedPathRoot.append(FacetModuleCoreSupport.META_INF_RESOURCES);
+ if (resources != null && component.getProject().findMember(resources.removeFirstSegments(1)) != null) {
+ paths.add(resources);
+ }
+ }
}
}