Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2010-11-02 17:34:13 -0400
committerPascal Rapicault2010-11-02 17:34:13 -0400
commit37935ed0934f3a9b32fe8bcdf5ba15b7e256927f (patch)
treedbd649d357d6c8e50db41bf275e10da9b54e1fe7
parente5ca396e0f233476c3eaf3058c6b45c40e1ec908 (diff)
downloadrt.equinox.p2-37935ed0934f3a9b32fe8bcdf5ba15b7e256927f.tar.gz
rt.equinox.p2-37935ed0934f3a9b32fe8bcdf5ba15b7e256927f.tar.xz
rt.equinox.p2-37935ed0934f3a9b32fe8bcdf5ba15b7e256927f.zip
Bug 316886 - [publisher] NullPointerException in ProductPublisherApplication (p2.publisher) when product file path denotes missing or invalid xml document
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/Messages.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/messages.properties3
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ProductPublisherApplication.java5
3 files changed, 6 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/Messages.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/Messages.java
index 52637b19c..1f74107d7 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/Messages.java
+++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/Messages.java
@@ -17,6 +17,7 @@ public class Messages extends NLS {
public static String exception_stateAddition;
public static String exception_errorReadingManifest;
public static String exception_errorLoadingManifest;
+ public static String exception_errorLoadingProductFile;
public static String exception_noPluginConverter;
public static String exception_noArtifactRepo;
public static String exception_noMetadataRepo;
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/messages.properties b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/messages.properties
index fb2d606b2..80a800881 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/messages.properties
+++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/messages.properties
@@ -25,4 +25,5 @@ message_generatingMetadata = Generating metadata for {0}.
message_generationCompleted = Generation completed with success [{0} seconds].
message_noSimpleconfigurator = Could not find simpleconfigurator bundle.
exception_artifactRepoNoAppendDestroysInput = Not appending to artifact repository ({0}) may destroy input files.
-error_rootIU_generation = Could not generate root IU {0}, {1}, {2}.. \ No newline at end of file
+error_rootIU_generation = Could not generate root IU {0}, {1}, {2}..
+exception_errorLoadingProductFile = An error has occurred while loading product file {0}. Exception details: {1}. \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ProductPublisherApplication.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ProductPublisherApplication.java
index dc365e78b..eba846360 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ProductPublisherApplication.java
+++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ProductPublisherApplication.java
@@ -13,11 +13,13 @@ package org.eclipse.equinox.p2.publisher.eclipse;
import java.io.File;
import java.net.URISyntaxException;
import java.util.ArrayList;
+import org.eclipse.equinox.internal.p2.publisher.Messages;
import org.eclipse.equinox.internal.p2.publisher.eclipse.IProductDescriptor;
import org.eclipse.equinox.internal.p2.publisher.eclipse.ProductFile;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.publisher.*;
import org.eclipse.equinox.p2.publisher.actions.VersionAdvice;
+import org.eclipse.osgi.util.NLS;
public class ProductPublisherApplication extends AbstractPublisherApplication {
@@ -40,8 +42,7 @@ public class ProductPublisherApplication extends AbstractPublisherApplication {
try {
productDescriptor = new ProductFile(product);
} catch (Exception e) {
- if (product == null)
- throw new IllegalArgumentException("unable to load product file"); //$NON-NLS-1$
+ throw new IllegalArgumentException(NLS.bind(Messages.exception_errorLoadingProductFile, product, e.toString()));
}
File executablesFeature = executables == null ? null : new File(executables);
return new ProductAction(source, productDescriptor, flavor, executablesFeature);

Back to the top