http://gwt-code-reviews.appspot.com/1388803/diff/4001/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileClassPathEntry.java
File
dev/core/src/com/google/gwt/dev/resource/impl/ZipFileClassPathEntry.java
(right):

http://gwt-code-reviews.appspot.com/1388803/diff/4001/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileClassPathEntry.java#newcode72
dev/core/src/com/google/gwt/dev/resource/impl/ZipFileClassPathEntry.java:72:
@SuppressWarnings("unchecked")
Yes, we could use default constructor.

However I would say that its presence is not good.
Why should we prefer to have default constructor exactly hard+soft?

So, in such sensitive area as memory management, I would prefer to use
explicit reference type specifications. Same is done in at least two
other places in GWT.

Aha! I've looked on ReferenceMap and found that there is also
IdentityReferenceMap, which should be used for "cachedSnapshots". I
would say that any "identity" map is "weak" by definition. In this case
using "weak" reference allows us improve life cycle of
ZipFileClassPathEntry by removing entries from "cachedSnapshots" on
module-by-module basis instead of possible dropping full
ZipFileClassPathEntry if it starts to consume too much memory. This is
important only for design time.

I would say that this is one more reason to use explicit reference
types, just for consistency with other ReferenceMap usage variants.

http://gwt-code-reviews.appspot.com/1388803/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to