Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsuen2007-03-10 11:04:51 -0500
committerrsuen2007-03-10 11:04:51 -0500
commit8da2e52d8ca1617b2c4fdff8b09df9e3045e2d27 (patch)
tree8f95f2183fb6e0fa2e979d44c5a949c7bc0be503 /framework/bundles/org.eclipse.ecf.identity/src
parentdb21de2e92e9eed18ae4e775c21eabbf7b88afc5 (diff)
downloadorg.eclipse.ecf-8da2e52d8ca1617b2c4fdff8b09df9e3045e2d27.tar.gz
org.eclipse.ecf-8da2e52d8ca1617b2c4fdff8b09df9e3045e2d27.tar.xz
org.eclipse.ecf-8da2e52d8ca1617b2c4fdff8b09df9e3045e2d27.zip
Use NLS messages properly.
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.identity/src')
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IDFactory.java16
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IIDFactory.java4
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/Base64.java5
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Messages.java6
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/messages.properties8
5 files changed, 17 insertions, 22 deletions
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IDFactory.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IDFactory.java
index 32ef13465..be2ab189e 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IDFactory.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IDFactory.java
@@ -19,11 +19,12 @@ import org.eclipse.ecf.core.util.Trace;
import org.eclipse.ecf.internal.core.identity.Activator;
import org.eclipse.ecf.internal.core.identity.IdentityDebugOptions;
import org.eclipse.ecf.internal.core.identity.Messages;
+import org.eclipse.osgi.util.NLS;
/**
* A factory class for creating ID instances. This is the factory for plugins to
- * manufacture ID instances.
- *
+ * manufacture ID instances.
+ *
*/
public class IDFactory implements IIDFactory {
public static final String SECURITY_PROPERTY = IDFactory.class.getName()
@@ -232,7 +233,8 @@ public class IDFactory implements IIDFactory {
// throw...we don't create any instances that we don't know about!
Namespace ns = getNamespace0(n);
if (ns == null)
- logAndThrow(Messages.IDFactory_0 + n.getName() + Messages.IDFactory_1, null);
+ logAndThrow(NLS.bind(Messages.IDFactory_Namespace_Not_Found, n
+ .getName()), null);
// We're OK, go ahead and setup array of classes for call to
// instantiator
// Ask instantiator to actually create instance
@@ -249,12 +251,12 @@ public class IDFactory implements IIDFactory {
* @see org.eclipse.ecf.core.identity.IIDFactory#createID(java.lang.String,
* java.lang.Object[])
*/
- public ID createID(String namespacename, Object[] args)
+ public ID createID(String namespaceName, Object[] args)
throws IDCreateException {
- Namespace n = getNamespaceByName(namespacename);
+ Namespace n = getNamespaceByName(namespaceName);
if (n == null)
- throw new IDCreateException(Messages.IDFactory_2 + namespacename
- + Messages.IDFactory_3);
+ throw new IDCreateException(NLS.bind(
+ Messages.IDFactory_Namespace_Not_Found, namespaceName));
return createID(n, args);
}
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IIDFactory.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IIDFactory.java
index 1d444aa17..f00186a64 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IIDFactory.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IIDFactory.java
@@ -117,7 +117,7 @@ public interface IIDFactory {
* constructor parameters, return a new instance of an ID belonging to the
* given Namespace
*
- * @param namespacename
+ * @param namespaceName
* the name of the Namespace to which the ID will belong
* @param args
* an Object [] of the parameters for the ID instance constructor
@@ -126,7 +126,7 @@ public interface IIDFactory {
* loaded, if something goes wrong during instance
* construction
*/
- public ID createID(String namespacename, Object[] args)
+ public ID createID(String namespaceName, Object[] args)
throws IDCreateException;
/**
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/Base64.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/Base64.java
index 3169716ca..0f7d49533 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/Base64.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/Base64.java
@@ -9,6 +9,7 @@
package org.eclipse.ecf.core.util;
import org.eclipse.ecf.internal.core.identity.Messages;
+import org.eclipse.osgi.util.NLS;
/**
*
@@ -120,7 +121,7 @@ public final class Base64 {
// modify to use '-' instead of '='
if (c == '-')
return 0;
- throw new NumberFormatException(Messages.Base64_Invalid_Value + c
- + Messages.Base64_In_Base64);
+ throw new NumberFormatException(NLS.bind(Messages.Base64_Invalid_Value,
+ String.valueOf(c)));
}
} \ No newline at end of file
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Messages.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Messages.java
index bc443cab1..7a771e45b 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Messages.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Messages.java
@@ -18,17 +18,13 @@ import org.eclipse.osgi.util.NLS;
*/
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.ecf.internal.core.identity.messages"; //$NON-NLS-1$
- public static String Base64_In_Base64;
public static String Base64_Input_Data_Not_Null;
public static String Base64_Invalid_Value;
public static String GUID_GUID_Creation_Failure;
public static String GUID_GUID_Namespace_Description_Default;
public static String GUID_IBM_SECURE_RANDOM;
public static String GUID_SHA1;
- public static String IDFactory_0;
- public static String IDFactory_1;
- public static String IDFactory_2;
- public static String IDFactory_3;
+ public static String IDFactory_Namespace_Not_Found;
public static String IDFactory_Namespace_Not_Null;
public static String IDFactory_StringID_Not_Null;
public static String LongID_LongID_Namespace_Description;
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/messages.properties b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/messages.properties
index 74780446e..74c09a5c1 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/messages.properties
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/messages.properties
@@ -8,11 +8,7 @@ Trace_Date_Time_Format=[MM/dd/yy;HH:mm:ss:SSS]
StringID_StringID_Namespace_Description=StringID Namespace
StringID_StringID_Name_Not_Null=StringID name cannot be null
Base64_Input_Data_Not_Null=Input data cannot be null
-Base64_Invalid_Value=Invalid value '
-Base64_In_Base64=' in base64 string
+Base64_Invalid_Value=Invalid value "{0}" in base64 string
GUID_GUID_Creation_Failure=GUID creation failure:
LongID_LongID_Namespace_Description=LongID Namespace
-IDFactory_0=Namespace '
-IDFactory_1=' not found
-IDFactory_2=Namespace named
-IDFactory_3=\ not found
+IDFactory_Namespace_Not_Found = Namespace "{0}" not found

Back to the top