Hi,
I think I've tracked down why jarjar isn't shrinking the collections library
by much,
it's related to the static methods that simplify the creation of generic
collections.
For example, from the injector implementation:
multimap = Multimaps.newArrayListMultimap();
Unfortunately, Multimaps (and similar classes like Maps, Sets, etc.) have a
lot
of static methods that touch classes throughout the collection - so once
you've
pulled in Multimaps you end up pulling in almost the complete library.
In fact, even a simple class like:
public class main {
com.google.common.collect.Multimaps m;
}
will end up as a 431k jarfile when jarjar'd with Google Collections!
Not sure how this could be resolved - technically you do need these classes
as
they're referenced from the same classfile (although not all the static
methods
will be called).
The only solution would be to change back to creating generic collections
using
"new XYZ<...>" instead of the static approach "Foo.newXYZ()" as then jarjar
can
safely remove the unused classes, but this would affect readability...
Any thoughts?
--
Cheers, Stuart
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---