bineanzhou / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

Binding annotations warning breaks Scala #242

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

the following construct (original code is Scala)

---8<---
@Inject @Named( "QUARTZ_FACTORY_KEY" )
private final String QUARTZ_FACTORY_KEY;

public String QUARTZ_FACTORY_KEY() { return QUARTZ_FACTORY_KEY; }
---8<---

gives the following error with latest trunk (r615):

de.footprint.utils.scheduler.SchedulerProvider.QUARTZ_FACTORY_KEY() is
annotated with @com.google.inject.name.Named(value=QUARTZ_FACTORY_KEY), but
binding annotations should be applied to its parameters instead.

It seems that Guice now gets irritated when fields and methods of the same
name are available. It works with earlier Guice versions, though! Has there
changed something in the verifier?

Best regards, --- Jan.

Original issue reported on code.google.com by jkries...@googlemail.com on 3 Sep 2008 at 6:37

GoogleCodeExporter commented 9 years ago
Test case. Invoke via

java -cp "guice-snapshot.jar:scala-library.jar:." guice.injectorTest

Original comment by jkries...@googlemail.com on 11 Sep 2008 at 7:42

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by limpbizkit on 2 Nov 2008 at 9:20

GoogleCodeExporter commented 9 years ago

Original comment by limpbizkit on 2 Nov 2008 at 9:46

GoogleCodeExporter commented 9 years ago
Fixed by r707.

jkriesten, the test case was extremely handy in fixing this. Thanks!

Original comment by limpbizkit on 29 Nov 2008 at 10:02