@Override public void visitNEW(NEW obj) { // FIXME: type is technically "uninitialized" // However, we don't model that yet. pushValue(obj.getType(getCPG())); // We now have an exact type for this value. setTopOfStackIsExact(); }
@Override public ObjectType getLoadClassType( final ConstantPoolGen cpg ) { return (ObjectType) getType(cpg); }
public ObjectType getLoadClassType(ConstantPoolGen cpg) { return (ObjectType)getType(cpg); }
/** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitNEW(NEW o){ stack().push(new UninitializedObjectType((ObjectType) (o.getType(cpg)))); } /** Symbolically executes the corresponding Java Virtual Machine instruction. */
@Override public void visitNEW(NEW obj) { // FIXME: type is technically "uninitialized" // However, we don't model that yet. pushValue(obj.getType(getCPG())); // We now have an exact type for this value. setTopOfStackIsExact(); }
/** Symbolically executes the corresponding Java Virtual Machine instruction. */ @Override public void visitNEW(final NEW o) { stack().push(new UninitializedObjectType((ObjectType) (o.getType(cpg)))); } /** Symbolically executes the corresponding Java Virtual Machine instruction. */
/** * 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+"'."); } }
/** * Ensures the specific preconditions of the said instruction. */ @Override public void visitNEW(final NEW o) { //visitCPInstruction(CPInstruction) has been called before. //visitLoadClass(LoadClass) has been called before. final 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+"'."); } final ObjectType obj = (ObjectType) t; //e.g.: Don't instantiate interfaces try { if (! obj.referencesClassExact()) { constraintViolated(o, "Expecting a class type (ObjectType) to work on. Found: '"+obj+"'."); } } catch (final ClassNotFoundException e) { constraintViolated(o, "Expecting a class type (ObjectType) to work on. Found: '"+obj+"'." + " which threw " + e); } }