/** * Find or create the canonical MemberReference instance for the given tuple. * * @param mn the name of the member */ public static synchronized FieldReference findOrCreate(TypeReference tref, Atom mn, TypeReference fieldType) { if (tref == null) { throw new IllegalArgumentException("null tref"); } Key key = new Key(tref, mn, fieldType); FieldReference val = dictionary.get(key); if (val != null) { return val; } val = new FieldReference(key, fieldType); dictionary.put(key, val); return val; }
/** * Find or create the canonical MemberReference instance for the given tuple. * * @param mn the name of the member */ public static synchronized FieldReference findOrCreate(TypeReference tref, Atom mn, TypeReference fieldType) { if (tref == null) { throw new IllegalArgumentException("null tref"); } Key key = new Key(tref, mn, fieldType); FieldReference val = dictionary.get(key); if (val != null) { return val; } val = new FieldReference(key, fieldType); dictionary.put(key, val); return val; }
private FieldReference(Key key, TypeReference fieldType) { super(key.type, key.name, key.hashCode()); this.fieldType = fieldType; if (DEBUG) { if (getName().toString().indexOf('.') > -1) throw new UnimplementedError(); if (fieldType.toString().indexOf('.') > -1) Assertions.UNREACHABLE("Field name: " + fieldType.toString()); if (getName().toString().length() == 0) throw new UnimplementedError(); if (fieldType.toString().length() == 0) throw new UnimplementedError(); } }
private FieldReference(Key key, TypeReference fieldType) { super(key.type, key.name, key.hashCode()); this.fieldType = fieldType; if (DEBUG) { if (getName().toString().indexOf('.') > -1) throw new UnimplementedError(); if (fieldType.toString().indexOf('.') > -1) Assertions.UNREACHABLE("Field name: " + fieldType.toString()); if (getName().toString().length() == 0) throw new UnimplementedError(); if (fieldType.toString().length() == 0) throw new UnimplementedError(); } }