static { allTypes = new HashMap<RawType, TypeDef>(); allMethods = new HashMap<RawMethod, MethodDef>(); nativeTypes = new HashSet<NativeTypeDef>(); // We need to ensure that NativeInt, NativeBool etc. are loaded, so that their TYPE // objects will be created and eventually added to nativeTypes. We might as well just // add them manually, as it guarantees initialization and redundant add's won't hurt. NativeTypeDef[] nativeTypesArr = { NativeObject.TOP_TYPE, NativeBool.TYPE, NativeInt.TYPE, NativeDouble.TYPE, NativeChar.TYPE, NativeArray.TYPE, NativeConsole.TYPE }; for (NativeTypeDef nativeType : nativeTypesArr) { nativeTypes.add(nativeType); allTypes.put(nativeType.desc, nativeType); } }
public static void newType(TypeDef type) { // Register the new type. allTypes.put(type.desc, type); if (type instanceof NativeTypeDef) nativeTypes.add((NativeTypeDef) type); }