fmgasparino / google-gin

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

toProvider bindings don't work with nested classes #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
bind(Foo.Bar.class).toProvider(FooBarProvider.class); 

The following error message appears in the GWT complilation log: "The
nested type Foo$Bar cannot be referenced using its binary name" 

I'm using a version built from head on 24 September 2009. 

See discussion group topic at
http://groups.google.com/group/google-gin/browse_thread/thread/9f79bfe5cf7e1488

Original issue reported on code.google.com by dp.byand...@gmail.com on 25 Sep 2009 at 8:41

GoogleCodeExporter commented 9 years ago
I had some time before lunch and not much to do. The
ImplicitProviderBinding#writeCreatorMethods is working with binary names 
instead of
source names. Maybe http://pastie.org/631466 will be easier to read than a diff 
file.

If you use nested nested types like com.foo.Foo.Bar.Baz. 
ClassType#getBinaryClassName
should return com.foo.Foo$Bar$Baz but instead only the last '.' is changed to 
'$'.
replaceLast works in some cases but not all.

Original comment by alen_vre...@yahoo.com on 26 Sep 2009 at 11:40

GoogleCodeExporter commented 9 years ago
Patch submitted fro review: http://codereview.appspot.com/125052

Original comment by aragos on 27 Sep 2009 at 4:42

GoogleCodeExporter commented 9 years ago
Fix submitted in r115.

Original comment by aragos on 1 Oct 2009 at 3:49