Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornitind2008-01-31 01:31:11 +0000
committernitind2008-01-31 01:31:11 +0000
commit1e8f6cf5afe50fbf446159f4eddcd75527aedf12 (patch)
tree557af5605b91fa14c7cbfbbc94a8f3fca8f8eada
parent2e24b7626aac950ef5366332c20b8c5263e54896 (diff)
downloadwebtools.sourceediting-1e8f6cf5afe50fbf446159f4eddcd75527aedf12.tar.gz
webtools.sourceediting-1e8f6cf5afe50fbf446159f4eddcd75527aedf12.tar.xz
webtools.sourceediting-1e8f6cf5afe50fbf446159f4eddcd75527aedf12.zip
[214533] NPE using New HTML Wizard when no project selected in explorer
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FacetModuleCoreSupport.java6
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FacetModuleCoreSupportDelegate.java12
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/FacetModuleCoreSupport.java6
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupport.java4
4 files changed, 28 insertions, 0 deletions
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FacetModuleCoreSupport.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FacetModuleCoreSupport.java
index 14b90a73d0..15154be9c1 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FacetModuleCoreSupport.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/util/FacetModuleCoreSupport.java
@@ -79,6 +79,9 @@ public final class FacetModuleCoreSupport {
* @return the IPath to the "root" of the web contents
*/
public static IPath getWebContentRootPath(IProject project) {
+ if (project == null)
+ return null;
+
IPath path = null;
try {
path = FacetModuleCoreSupportDelegate.getWebContentRootPath(project);
@@ -112,6 +115,9 @@ public final class FacetModuleCoreSupport {
* @throws CoreException
*/
public static boolean isDynamicWebProject(IProject project) {
+ if (project == null)
+ return false;
+
try {
return FacetModuleCoreSupportDelegate.isDynamicWebProject(project);
}
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 eb5a97cd62..2b7e2888b3 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
@@ -51,6 +51,9 @@ final class FacetModuleCoreSupportDelegate {
* @throws CoreException
*/
static float getDynamicWebProjectVersion(IProject project) {
+ if (project == null)
+ return 2.5f;
+
// In the absence of any facet information, assume the highest level
float version = 2.5f;
try {
@@ -78,6 +81,9 @@ final class FacetModuleCoreSupportDelegate {
* otherwise
*/
static IPath getRuntimePath(IPath path) {
+ if (path == null)
+ return null;
+
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(0));
if (!ModuleCoreNature.isFlexibleProject(project))
@@ -95,6 +101,9 @@ final class FacetModuleCoreSupportDelegate {
* @return the IPath to the "root" of the web contents
*/
static IPath getWebContentRootPath(IProject project) {
+ if (project == null)
+ return null;
+
if (!ModuleCoreNature.isFlexibleProject(project))
return null;
@@ -112,6 +121,9 @@ final class FacetModuleCoreSupportDelegate {
* @throws CoreException
*/
static boolean isDynamicWebProject(IProject project) {
+ if (project == null)
+ return false;
+
try {
if (ProjectFacetsManager.isProjectFacetDefined(JST_WEB_MODULE)) {
IFacetedProject faceted = ProjectFacetsManager.create(project);
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/FacetModuleCoreSupport.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/FacetModuleCoreSupport.java
index befee9d53a..636c6931aa 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/FacetModuleCoreSupport.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/FacetModuleCoreSupport.java
@@ -30,6 +30,9 @@ final class FacetModuleCoreSupport {
* @return the IPath to the "root" of the web contents
*/
public static IPath getWebContentRootPath(IProject project) {
+ if (project == null)
+ return null;
+
IPath path = null;
try {
path = FacetModuleCoreSupportDelegate.getWebContentRootPath(project);
@@ -47,6 +50,9 @@ final class FacetModuleCoreSupport {
* @throws org.eclipse.core.runtime.CoreException
*/
public static boolean isWebProject(IProject project) {
+ if (project == null)
+ return false;
+
try {
return FacetModuleCoreSupportDelegate.isWebProject(project);
}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupport.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupport.java
index 8d11c7bfe5..fa1ab95f8a 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupport.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupport.java
@@ -30,6 +30,8 @@ final class FacetModuleCoreSupport {
* @return the IPath to the "root" of the web contents
*/
public static IPath getWebContentRootPath(IProject project) {
+ if (project == null)
+ return null;
IPath path = null;
try {
path = FacetModuleCoreSupportDelegate.getWebContentRootPath(project);
@@ -47,6 +49,8 @@ final class FacetModuleCoreSupport {
* @throws org.eclipse.core.runtime.CoreException
*/
public static boolean isWebProject(IProject project) {
+ if (project == null)
+ return false;
try {
return FacetModuleCoreSupportDelegate.isWebProject(project);
}

Back to the top