Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2005-01-12 22:43:17 +0000
committerslewis2005-01-12 22:43:17 +0000
commit49b60c60475f4cb6d941c6c98faa3e8f043e1083 (patch)
treec89a3d42d4d302ea6f3fbb3088d28a70b75e9ab0
parente8a696272eead5d899f5993bccea4f5af2c9bf22 (diff)
downloadorg.eclipse.ecf-49b60c60475f4cb6d941c6c98faa3e8f043e1083.tar.gz
org.eclipse.ecf-49b60c60475f4cb6d941c6c98faa3e8f043e1083.tar.xz
org.eclipse.ecf-49b60c60475f4cb6d941c6c98faa3e8f043e1083.zip
Small bug fixes to trace code and IDFactory null input handling
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/IDFactory.java2
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/Trace.java6
2 files changed, 6 insertions, 2 deletions
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/IDFactory.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/IDFactory.java
index ef3127b42..43cb45b01 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/IDFactory.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/IDFactory.java
@@ -266,6 +266,7 @@ public class IDFactory {
public static final ID makeStringID(String idstring)
throws IDInstantiationException {
+ if (idstring == null) throw new IDInstantiationException("String cannot be null");
Namespace n = new Namespace(StringID.class.getClassLoader(),
StringID.STRINGID_NAME, StringID.STRINGID_INSTANTIATOR_CLASS,
null);
@@ -273,6 +274,7 @@ public class IDFactory {
new Object[] { idstring });
}
public static final ID makeLongID(Long l) throws IDInstantiationException {
+ if (l == null) throw new IDInstantiationException("Long cannot be null");
Namespace n = new Namespace(LongID.class.getClassLoader(),
LongID.LONGID_NAME, LongID.LONGID_INSTANTIATOR_CLASS, null);
return makeID(n, new String[] { String.class.getName() },
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/Trace.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/Trace.java
index 88f0a36f5..cd5d3e7a0 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/Trace.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/Trace.java
@@ -89,7 +89,8 @@ public class Trace {
if (strings==null) return "";
StringBuffer sb = new StringBuffer();
for(int i=0; i < strings.length; i++) {
- sb.append(strings[i]);
+ if (strings[i]==null) sb.append("(null)");
+ else sb.append(strings[i]);
if (i != (strings.length-1)) sb.append(";");
}
return sb.toString();
@@ -98,7 +99,8 @@ public class Trace {
if (objs==null) return "";
StringBuffer sb = new StringBuffer();
for(int i=0; i < objs.length; i++) {
- sb.append(objs[i].toString());
+ if (objs[i]==null) sb.append("(null)");
+ else sb.append(objs[i].toString());
if (i != (objs.length-1)) sb.append(";");
}
return sb.toString();

Back to the top