Comment #24 on issue 436 by mcculls: Provide access to Guice's own internal TypeConverters
http://code.google.com/p/google-guice/issues/detail?id=436

You'll see the NPE issue whenever you report a custom error message that includes a null parameter.

For example:

   String value = null;
   //...
   binder.addError("Some error, value=%s", value);

Won't actually add the error message to the final output, but instead you'll see an NPE stack trace below it:

Caused by: java.lang.NullPointerException
        at 
com.google.inject.internal.Errors$Converter.appliesTo(Errors.java:612)
        at com.google.inject.internal.Errors.convert(Errors.java:646)
        at com.google.inject.internal.Errors.format(Errors.java:503)
at com.google.inject.spi.Elements$RecordingBinder.addError(Elements.java:241)
        at com.google.inject.AbstractModule.addError(AbstractModule.java:125)

which then hides the original message.

It should be possible to use null values in error messages hence the null check.

[ this is also related to Issue 432: http://code.google.com/p/google-guice/issues/detail?id=432 ]

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice-dev?hl=en.

Reply via email to