- Revision
- 3132
- Author
- rimovm
- Date
- 2006-12-19 17:58:00 -0600 (Tue, 19 Dec 2006)
Log Message
Protect against NPE.
Modified Paths
Diff
Modified: java/picocontainer/trunk/container/src/java/org/picocontainer/defaults/ConstantParameter.java (3131 => 3132)
--- java/picocontainer/trunk/container/src/java/org/picocontainer/defaults/ConstantParameter.java 2006-12-19 23:49:15 UTC (rev 3131)
+++ java/picocontainer/trunk/container/src/java/org/picocontainer/defaults/ConstantParameter.java 2006-12-19 23:58:00 UTC (rev 3132)
@@ -25,7 +25,7 @@
* A ConstantParameter should be used to pass in "constant" arguments to constructors. This
* includes {@link String}s,{@link Integer}s or any other object that is not registered in
* the container.
- *
+ *
* @author Jon Tirsén
* @author Aslak Hellesøy
* @author Jörg Schaible
@@ -53,24 +53,25 @@
return false;
}
}
-
+
/**
* {@inheritDoc}
- *
+ *
* @see org.picocontainer.Parameter#verify(org.picocontainer.PicoContainer,
* org.picocontainer.ComponentAdapter, java.lang.Class)
*/
public void verify(PicoContainer container, ComponentAdapter adapter, Class expectedType) throws PicoException {
if (!checkPrimitive(expectedType) && !expectedType.isInstance(value)) {
- throw new PicoIntrospectionException(expectedType.getClass().getName()
+ throw new PicoIntrospectionException(
+ ((expectedType != null) ? expectedType.getClass().getName() : "null")
+ " is not assignable from "
- + value.getClass().getName());
+ + ((value != null) ? value.getClass().getName() : "null"));
}
}
/**
* Visit the current {@link Parameter}.
- *
+ *
* @see org.picocontainer.Parameter#accept(org.picocontainer.PicoVisitor)
*/
public void accept(final PicoVisitor visitor) {
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
|