New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow injected member to declare that null is acceptable #112
Comments
From robbie.vanbrabant on July 16, 2007 07:45:06 Another suggestion: bind(SomeObject.class) That way we can choose the annotation, or even leave it out. |
From limpbizkit on August 21, 2007 17:16:52 What about just reusing |
From limpbizkit on August 25, 2007 01:29:58 Implemented! Consequences:
My implementation adds a new method, InternalContext#sanitize() that all InternalFactories should call on I'm going to try this out with the large Guice-using codebase that I have access to, to try and find other Status: Started |
From limpbizkit on August 26, 2007 00:13:05 Uh oh, it looks like org.jetbrains.annotations.Nullable doesn't have runtime retention. This means that the code |
From limpbizkit on August 27, 2007 10:56:56 I've posted to the JSR 305 lists describing how Guice benefits from runtime retention |
From crazyboblee on August 27, 2007 11:19:32 Yeah, |
From limpbizkit on May 30, 2008 00:05:14 Posted to Jetbrains' forum: http://intellij.net/forums/thread.jspa?threadID=275503 Labels: -1.1 Milestone-Release2.0 |
From limpbizkit on June 04, 2008 23:43:54 If anyone's interested, we've got JetBrains' blessing to patch the For now, Guice will recognize any annotation whose simplename is "Nullable". Status: Fixed |
From kevinb9n on June 06, 2007 11:37:41
We must allow for injection of null. User demand is loud and clear, and if
you don't like it, you don't have to use it.
It would be great to just expand the meaning of
@
Inject(optional=true), butthat leaves you no way for some method/constructor parameters to be
nullable while others aren't.
Probably we should introduce a new annotation like
@
CanBeNull, and everyplace of injection that is willing to accept a null must use this
annotation. We could also require that any Provider that might return null
must also use this annotation on its get() method, but I'm not sure whether
we could reasonably enforce that types provided by can-be-null providers
can only be injected into can-be-null injection points. That may be trying
to be too smart, and it may not always make sense.
Original issue: http://code.google.com/p/google-guice/issues/detail?id=112
The text was updated successfully, but these errors were encountered: