--- a/langtools/src/share/classes/com/sun/tools/javac/util/Context.java Thu Jan 08 16:34:58 2009 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Context.java Tue Jan 13 13:27:14 2009 +0000
@@ -116,7 +116,7 @@
* We maintain the invariant that this table contains only
* mappings of the form
* Key<T> -> T or Key<T> -> Factory<T> */
- private Map<Key,Object> ht = new HashMap<Key,Object>();
+ private Map<Key<?>,Object> ht = new HashMap<Key<?>,Object>();
/** Set the factory for the key in this context. */
public <T> void put(Key<T> key, Factory<T> fac) {
@@ -128,11 +128,11 @@
/** Set the value for the key in this context. */
public <T> void put(Key<T> key, T data) {
- if (data instanceof Factory)
+ if (data instanceof Factory<?>)
throw new AssertionError("T extends Context.Factory");
checkState(ht);
Object old = ht.put(key, data);
- if (old != null && !(old instanceof Factory) && old != data && data != null)
+ if (old != null && !(old instanceof Factory<?>) && old != data && data != null)
throw new AssertionError("duplicate context value");
}
@@ -140,10 +140,10 @@
public <T> T get(Key<T> key) {
checkState(ht);
Object o = ht.get(key);
- if (o instanceof Factory) {
- Factory fac = (Factory)o;
+ if (o instanceof Factory<?>) {
+ Factory<?> fac = (Factory<?>)o;
o = fac.make();
- if (o instanceof Factory)
+ if (o instanceof Factory<?>)
throw new AssertionError("T extends Context.Factory");
assert ht.get(key) == o;
}