summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCurtis Windatt2013-06-14 15:33:21 (EDT)
committerCurtis Windatt2013-06-14 15:33:21 (EDT)
commita2997341e208fd4906cb70eb866fbf24071ca79d (patch)
tree4e7d73e26ff800f867c4578c6768588a0e43a591
parentb19a80d4b4a77367c805d541d8c264b8e90b30f5 (diff)
downloadeclipse.pde.ui-a2997341e208fd4906cb70eb866fbf24071ca79d.zip
eclipse.pde.ui-a2997341e208fd4906cb70eb866fbf24071ca79d.tar.gz
eclipse.pde.ui-a2997341e208fd4906cb70eb866fbf24071ca79d.tar.bz2
Bug 408137 - If linked resource is not resolvable, launch fails with NPE
-rw-r--r--ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ClasspathHelper.java15
-rw-r--r--ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECoreMessages.java2
-rw-r--r--ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/pderesources.properties1
3 files changed, 16 insertions, 2 deletions
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ClasspathHelper.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ClasspathHelper.java
index a748ba4..a867ade 100644
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ClasspathHelper.java
+++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ClasspathHelper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2012 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@ import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.jdt.core.*;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.pde.core.IBundleClasspathResolver;
import org.eclipse.pde.core.build.IBuild;
import org.eclipse.pde.core.build.IBuildEntry;
@@ -191,7 +192,17 @@ public class ClasspathHelper {
// make the path either relative or absolute
if (file != null) {
boolean isLinked = file.isLinked(IResource.CHECK_ANCESTORS);
- output = (isLinked || absolutePaths) ? file.getLocation().makeAbsolute() : output.makeRelative();
+ if (isLinked || absolutePaths) {
+ IPath location = file.getLocation();
+ if (location != null) {
+ output = location.makeAbsolute();
+ } else {
+ PDECore.log(new Status(IStatus.ERROR, PDECore.PLUGIN_ID, NLS.bind(PDECoreMessages.ClasspathHelper_BadFileLocation, file.getFullPath())));
+ continue;
+ }
+ } else {
+ output = output.makeRelative();
+ }
} else
continue;
ArrayList<IPath> list = map.get(source);
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECoreMessages.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECoreMessages.java
index c87a303..428aa33 100644
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECoreMessages.java
+++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECoreMessages.java
@@ -272,6 +272,8 @@ public class PDECoreMessages extends NLS {
public static String BuildErrorReporter_SourceCompatibility;
+ public static String ClasspathHelper_BadFileLocation;
+
public static String ExportWizard_badDirectory;
public static String FeatureExportJob_taskName;
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/pderesources.properties b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/pderesources.properties
index 1609950..72b8120 100644
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/pderesources.properties
+++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/pderesources.properties
@@ -213,6 +213,7 @@ FeatureExportOperation_runningBuildScript=Running build script
FeatureExportOperation_runningPackagerScript=Running packager script
FeatureExportOperation_workspaceBuildErrorsFoundDuringExport=Export completed successfully, but build problems were detected in the following required projects: {0}
BaseExportTask_pdeExport=PDE Export
+ClasspathHelper_BadFileLocation=Could not determine absolute location of file: {0}
XMLErrorReporter_ExternalEntityResolution=External entity resolution is not supported by PDE.
XMLTextChangeListener_editNames_removeNode=Remove "{0}" node