diff options
| author | slewis | 2004-12-29 23:09:32 +0000 |
|---|---|---|
| committer | slewis | 2004-12-29 23:09:32 +0000 |
| commit | 988adbc7f32e6dff8756850b1c8d970345156758 (patch) | |
| tree | 2849b9378e486cc2f83e428018b2006b289a97a9 | |
| parent | 241fe673084f20c3a351f96272f81b545749b170 (diff) | |
| download | org.eclipse.ecf-988adbc7f32e6dff8756850b1c8d970345156758.tar.gz org.eclipse.ecf-988adbc7f32e6dff8756850b1c8d970345156758.tar.xz org.eclipse.ecf-988adbc7f32e6dff8756850b1c8d970345156758.zip | |
Added null value checking code for Namespace constructors
| -rw-r--r-- | framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/Namespace.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/Namespace.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/Namespace.java index 3cffe4d92..e72590c98 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/Namespace.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/Namespace.java @@ -40,12 +40,24 @@ public class Namespace implements Serializable { public Namespace(ClassLoader cl, String name, String instantiatorClass, String desc) { this.classLoader = cl; + if (name == null) + throw new RuntimeException(new InstantiationException( + "Namespace<init> name cannot be null")); this.name = name; + if (instantiatorClass == null) + throw new RuntimeException(new InstantiationException( + "Namespace<init> instantiatorClass cannot be null")); this.instantiatorClass = instantiatorClass; this.description = desc; this.hashCode = name.hashCode(); } public Namespace(String name, IDInstantiator inst, String desc) { + if (name == null) + throw new RuntimeException(new InstantiationException( + "Namespace<init> name cannot be null")); + if (inst == null) + throw new RuntimeException(new InstantiationException( + "Namespace<init> instantiator instance cannot be null")); this.instantiator = inst; this.instantiatorClass = this.instantiator.getClass().getName(); this.classLoader = this.instantiator.getClass().getClassLoader(); |
