Rollforward: Revert workaround for b/38182645 as JsCompiler is fixed.
No new changes from the original CL.
@@ -23,8 +23,7 @@ class Enums {
@JsType(isNative = true, name = "Map", namespace = JsPackage.GLOBAL)
private static class NativeMap<K, V> {
- // TODO(b/38182645): replace Enum with V
- public native Enum get(K key);
+ public native V get(K key);
public native void set(K key, V value);
}
@@ -42,12 +41,11 @@ class Enums {
return map;
}
- // TODO(b/38182645): replace NativeMap<String, ?> with NativeMap<String, T>
- public static <T> T getValueFromNameAndMap(String name, NativeMap<String, ?> map) {
+ public static <V> V getValueFromNameAndMap(String name, NativeMap<String, V> map) {
if (name == null) {
throw new IllegalArgumentException();
}
- T enumValue = (T) map.get(name);
+ V enumValue = map.get(name);
if (enumValue == null) {
throw new IllegalArgumentException();
}
