Doug Lea reports a possible issue with javaac when trying some experimental changes on java.util.LinkedHashMap. No code example to demonstrate it yet. I tried doing a fresh jdk8 build with them swapped in, and saw a compiler error that seems to demonstrate its confusion about the various nested classes that were previously all confusingly called "Entry". Somehow changing the LinkedHashMap class name from Entry LinkedNode caused it to falsely claim an ambiguity in a client usage. If this isn't a known javac bug, it would be good to report it, but I can't. As a workaround, I modified the client code: diff -r 1f855dd74077 src/share/classes/java/io/ExpiringCache.java --- a/src/share/classes/java/io/ExpiringCache.java Fri Jun 14 07:26:49 2013 -0700 +++ b/src/share/classes/java/io/ExpiringCache.java Thu Jun 20 06:17:23 2013 -0400 @@ -64,8 +64,8 @@ @SuppressWarnings("serial") ExpiringCache(long millisUntilExpiration) { this.millisUntilExpiration = millisUntilExpiration; - map = new LinkedHashMap<String,Entry>() { - protected boolean removeEldestEntry(Map.Entry<String,Entry> eldest) { + map = new LinkedHashMap<String,ExpiringCache.Entry>() { + protected boolean removeEldestEntry(Map.Entry<String,ExpiringCache.Entry> eldest) { return size() > MAX_ENTRIES; } };
|