Compile report

29 views
Skip to first unread message

Thomas Lefort

unread,
Oct 19, 2012, 7:29:48 AM10/19/12
to google-we...@googlegroups.com
In my compile report I get a lot of
packageX.ClassZ$1
packageX.ClassZ$2
packageX.ClassZ$3
etc...

for some classes I can have up to 30 x the "$number" ending. If I add
up it can make quite a large size of code for one class.

I (google) checked but the only thing I found on these is code
splitting, which I don't (yet) do.

Can anybody explain what they are for?

Thanks,

Thomas

Jens

unread,
Oct 19, 2012, 7:46:21 AM10/19/12
to google-we...@googlegroups.com
These are Java's anonymous classes. Activities/Presenters typically have quite a few of them because of Callback implementations.

class MyActivity {
  doStuff() {
     service.call(new AsyncCallback() {
         //implement
     });
  }
}

will result in Activity$1 because of anonymous AsyncCallback implementation.

-- J.

Thomas Lefort

unread,
Oct 19, 2012, 7:53:35 AM10/19/12
to google-we...@googlegroups.com
Makes perfect sense! Thanks for the quick reply.
Reply all
Reply to author
Forward
0 new messages