comparison graal/com.oracle.max.base/src/com/sun/max/util/Registry.java @ 4142:bc8527f3071c

Adjust code base to new level of warnings.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sun, 18 Dec 2011 05:24:06 +0100
parents e233f5660da4
children
comparison
equal deleted inserted replaced
4141:04d21be7a24f 4142:bc8527f3071c
43 protected final Map<String, String> stringMap; 43 protected final Map<String, String> stringMap;
44 44
45 public Registry(Class<C> classType, boolean loadClass) { 45 public Registry(Class<C> classType, boolean loadClass) {
46 this.loadClass = loadClass; 46 this.loadClass = loadClass;
47 this.classClass = classType; 47 this.classClass = classType;
48 this.classMap = new HashMap<String, Class<? extends C>>(); 48 this.classMap = new HashMap<>();
49 this.objectMap = new HashMap<String, C>(); 49 this.objectMap = new HashMap<>();
50 this.stringMap = new HashMap<String, String>(); 50 this.stringMap = new HashMap<>();
51 } 51 }
52 52
53 public void registerObject(String alias, C object) { 53 public void registerObject(String alias, C object) {
54 objectMap.put(alias, object); 54 objectMap.put(alias, object);
55 } 55 }
96 return genError(fatal, "not a subclass of " + classClass.getName(), alias, className); 96 return genError(fatal, "not a subclass of " + classClass.getName(), alias, className);
97 } 97 }
98 } 98 }
99 99
100 public Iterable<String> getAliases() { 100 public Iterable<String> getAliases() {
101 final LinkedList<String> lista = new LinkedList<String>(); 101 final LinkedList<String> lista = new LinkedList<>();
102 lista.addAll(objectMap.keySet()); 102 lista.addAll(objectMap.keySet());
103 lista.addAll(classMap.keySet()); 103 lista.addAll(classMap.keySet());
104 lista.addAll(stringMap.keySet()); 104 lista.addAll(stringMap.keySet());
105 return lista; 105 return lista;
106 } 106 }
115 } 115 }
116 throw ProgramError.unexpected(mstr); 116 throw ProgramError.unexpected(mstr);
117 } 117 }
118 118
119 public static <T> Registry<T> newRegistry(Class<T> cl) { 119 public static <T> Registry<T> newRegistry(Class<T> cl) {
120 return new Registry<T>(cl, true); 120 return new Registry<>(cl, true);
121 } 121 }
122 } 122 }