I think you mean "the javadoc *is** *correct"?  Because the jsr javadoc
says, "Injectable methods: ... may return a result ... ".  The only thing
that seems to be wrong is https://code.google.com/p/google-guice/wiki/JSR330
 .

... and Guice seems to test that it works correctly in
Jsr330Test<https://code.google.com/p/google-guice/source/browse/core/test/com/googlecode/guice/Jsr330Test.java>
:

  public void testInjectingMethodsWithNonVoidReturnTypes() {
    Guice.createInjector(new AbstractModule() {
      protected void configure() {
        bind(P.class);
      }
    });
  } ... so it appears we've all just been misled by that wiki page, but
everything is working as expected.

 sam


On Tue, Jun 25, 2013 at 12:27 PM, Christian Gruber <[email protected]>wrote:

> On a side thread off-list, Jesse pointed us to an acceptance test in the
> JSR spec
>
> ```
>   public void testNonVoidMethodInjected() {
>     assertTrue(car.**methodWithNonVoidReturnInjecte**d);
>   }
> ```
>
> So it seems the spec does allow return values.  the JSR-330 javadoc is
> incorrect.  If Guice itself doesn't allow return values, then it is more
> strict than it should be, and we should correct it.  We'll be applying a
> patch to the javadoc of the JSR-330 to correct it on that end.
>
> Christian.
>
>
> On 24 Jun 2013, at 17:56, Sam Berlin wrote:
>
>  This is actually the opposite here. Guice is stricter than the jsr330
>> javadoc says it should be. It's either a bug in the javadoc, maybe a
>> (reverse) bug in the compatibility tests, or just an oversight in Guice
>> (that was maybe coded against an earlier revision?).
>>
>> sam
>> On Jun 24, 2013 8:05 PM, "Jesse Wilson" <[email protected]> wrote:
>>
>>  JSR-330 is stricter than Guice. If you use the javax.inject.Inject
>>> annotation, you need to follow their rules.
>>>
>>>
>>> On Mon, Jun 24, 2013 at 7:30 PM, Steven Goldfeder <[email protected]
>>> >wrote:
>>>
>>>  Hey all,
>>>>
>>>> In the javax.inject.Inject javadoc<http://docs.oracle.**
>>>> com/javaee/6/api/javax/inject/**Inject.html<http://docs.oracle.com/javaee/6/api/javax/inject/Inject.html>
>>>> >,
>>>>
>>>> it says that injectable methods "may return a result". But the Guice
>>>> documentation 
>>>> <https://code.google.com/p/**google-guice/wiki/JSR330<https://code.google.com/p/google-guice/wiki/JSR330>>
>>>> indicates
>>>>
>>>> that JSR-330 method injection does not allow void methods. My
>>>> assumption is
>>>> that the javax documentation is correct, but I just wanted to double
>>>> check.
>>>>
>>>> Thanks!
>>>>
>>>> Steven
>>>>
>>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "google-guice" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to 
>>> google-guice+unsubscribe@**googlegroups.com<google-guice%[email protected]>
>>> .
>>> To post to this group, send email to [email protected].
>>> Visit this group at 
>>> http://groups.google.com/**group/google-guice<http://groups.google.com/group/google-guice>
>>> .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "google-guice" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to 
>> google-guice+unsubscribe@**googlegroups.com<google-guice%[email protected]>
>> .
>> To post to this group, send email to [email protected].
>> Visit this group at 
>> http://groups.google.com/**group/google-guice<http://groups.google.com/group/google-guice>
>> .
>> For more options, visit 
>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>> .
>>
>
>
> Christian Gruber :: Google, Inc. :: Java Core Libraries :: Dependency
> Injection
> email: [email protected] :::: mobile: +1 (646) 807-9839
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-guice" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to 
> google-guice+unsubscribe@**googlegroups.com<google-guice%[email protected]>
> .
> To post to this group, send email to [email protected].
> Visit this group at 
> http://groups.google.com/**group/google-guice<http://groups.google.com/group/google-guice>
> .
> For more options, visit 
> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
> .
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to