Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2011-01-19 21:19:04 +0000
committerPascal Rapicault2011-01-19 21:19:04 +0000
commita21e9016630cd6d7ac5d0fd38a35b3e520686280 (patch)
treea5d09f91a2727b9ee3e57bc52d4864b0863f157b /bundles/org.eclipse.equinox.p2.metadata/src
parent92f7910c6fcf53a9e8ef8a9f67180b1bfae26797 (diff)
downloadrt.equinox.p2-a21e9016630cd6d7ac5d0fd38a35b3e520686280.tar.gz
rt.equinox.p2-a21e9016630cd6d7ac5d0fd38a35b3e520686280.tar.xz
rt.equinox.p2-a21e9016630cd6d7ac5d0fd38a35b3e520686280.zip
Bug 321992 - Assertion checks in Provided Capability constructor do not show which property is null
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.metadata/src')
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/Messages.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ProvidedCapability.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/messages.properties5
3 files changed, 15 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/Messages.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/Messages.java
index eebdf5f49..8b14a6fa0 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/Messages.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/Messages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 Cloudsmith Inc. and others.
+ * Copyright (c) 2009-2011 Cloudsmith Inc. 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Cloudsmith Inc. - initial API and implementation
+ * SAP - ongoing development
*******************************************************************************/
package org.eclipse.equinox.internal.p2.metadata;
@@ -141,6 +142,10 @@ public class Messages extends NLS {
public static String no_expression_parser;
+ public static String provided_capability_name_not_defined;
+
+ public static String provided_capability_namespace_not_defined;
+
private static final String BUNDLE_NAME = "org.eclipse.equinox.internal.p2.metadata.messages"; //$NON-NLS-1$
static {
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ProvidedCapability.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ProvidedCapability.java
index eec34bfe2..8a324a203 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ProvidedCapability.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ProvidedCapability.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * Copyright (c) 2007, 2011 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
@@ -8,6 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
* EclipseSource - ongoing development
+ * SAP - ongoing development
*******************************************************************************/
package org.eclipse.equinox.internal.p2.metadata;
@@ -15,6 +16,7 @@ import org.eclipse.core.runtime.Assert;
import org.eclipse.equinox.p2.metadata.IProvidedCapability;
import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.metadata.expression.IMemberProvider;
+import org.eclipse.osgi.util.NLS;
/**
* Describes a capability as exposed or required by an installable unit
@@ -29,8 +31,8 @@ public class ProvidedCapability implements IProvidedCapability, IMemberProvider
private final Version version;
public ProvidedCapability(String namespace, String name, Version version) {
- Assert.isNotNull(namespace);
- Assert.isNotNull(name);
+ Assert.isNotNull(namespace, NLS.bind(Messages.provided_capability_namespace_not_defined, null));
+ Assert.isNotNull(name, NLS.bind(Messages.provided_capability_name_not_defined, namespace));
this.namespace = namespace;
this.name = name;
this.version = version == null ? Version.emptyVersion : version;
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/messages.properties b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/messages.properties
index 58b8904b0..aa3b72b2e 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/messages.properties
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/messages.properties
@@ -1,5 +1,5 @@
###############################################################################
- # Copyright (c) 2009 Cloudsmith Inc. and others.
+ # Copyright (c) 2009-2011 Cloudsmith Inc. 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
@@ -7,6 +7,7 @@
#
# Contributors:
# Cloudsmith Inc. - initial API and implementation
+ # SAP - ongoing development
###############################################################################
_0_is_not_a_valid_qualifier_in_osgi_1=The {0} value is invalid in OSGi version: "{1}"
array_can_not_be_empty=Array format can not be empty
@@ -58,6 +59,8 @@ performing_subquery=Performing subquery
premature_end_of_format=Premature end of format
premature_end_of_format_expected_0=Premature end of format, "{0}" expected
premature_EOS_0=Premature end of string in "{0}"
+provided_capability_name_not_defined=the name of provided capability "{0}" is not defined
+provided_capability_namespace_not_defined=the namespace of the provided capabilty is not defined
range_defined_more_then_once=Range defined more then once
range_max_cannot_be_less_then_range_min=The range maximum must not be less then its minimum
range_max_cannot_be_zero=The range maximum cannot be zero

Back to the top