/** * Ensures the specific preconditions of the said instruction. */ public void visitNEW(NEW o){ //visitCPInstruction(CPInstruction) has been called before. //visitLoadClass(LoadClass) has been called before. Type t = o.getType(cpg); if (! (t instanceof ReferenceType)){ throw new AssertionViolatedException("NEW.getType() returning a non-reference type?!"); } if (! (t instanceof ObjectType)){ constraintViolated(o, "Expecting a class type (ObjectType) to work on. Found: '"+t+"'."); } ObjectType obj = (ObjectType) t; //e.g.: Don't instantiate interfaces if (! obj.referencesClass()){ constraintViolated(o, "Expecting a class type (ObjectType) to work on. Found: '"+obj+"'."); } }
if ((this instanceof ObjectType) && (((ObjectType) this).referencesClass())) { if ((T instanceof ObjectType) && (((ObjectType) T).referencesClass())) { if (this.equals(T)) return true; if ((T instanceof ObjectType) && (((ObjectType) T).referencesClass())) { if (T.equals(Type.OBJECT)) return true; if ((T instanceof ObjectType) && (((ObjectType) T).referencesClass())) { if (T.equals(Type.OBJECT)) return true;