/** Machine-generated. */ public void pass1Button_ActionPerformed( final java.awt.event.ActionEvent actionEvent ) { final Verifier v = VerifierFactory.getVerifier(class_name); final VerificationResult vr = v.doPass1(); if (vr.getStatus() == VerificationResult.VERIFIED_OK) { getPass1Panel().setBackground(Color.green); getPass1Panel().repaint(); } if (vr.getStatus() == VerificationResult.VERIFIED_REJECTED) { getPass1Panel().setBackground(Color.red); getPass1Panel().repaint(); } }
/** Machine-generated. */ public void pass1Button_ActionPerformed(java.awt.event.ActionEvent actionEvent) { Verifier v = VerifierFactory.getVerifier(class_name); VerificationResult vr = v.doPass1(); if (vr.getStatus() == VerificationResult.VERIFIED_OK){ getPass1Panel().setBackground(Color.green); getPass1Panel().repaint(); } if (vr.getStatus() == VerificationResult.VERIFIED_REJECTED){ getPass1Panel().setBackground(Color.red); getPass1Panel().repaint(); } }
VerificationResult vr; vr = v.doPass1(); System.out.println("Pass 1:\n"+vr);
final Verifier v = VerifierFactory.getVerifier(args[k]); VerificationResult vr; vr = v.doPass1(); System.out.println("Pass 1:\n" + vr); vr = v.doPass2();
public void update(String classname){ System.gc(); // avoid swapping if possible. for (int i=0; i<indent; i++){ System.out.print(" "); } System.out.println(classname); indent += 1; Verifier v = VerifierFactory.getVerifier(classname); VerificationResult vr; vr = v.doPass1(); if (vr != VerificationResult.VR_OK) //System.exit(1); System.out.println("Pass 1:\n"+vr); vr = v.doPass2(); if (vr != VerificationResult.VR_OK) //System.exit(1); System.out.println("Pass 2:\n"+vr); if (vr == VerificationResult.VR_OK){ JavaClass jc = Repository.lookupClass(v.getClassName()); for (int i=0; i<jc.getMethods().length; i++){ vr = v.doPass3a(i); if (vr != VerificationResult.VR_OK) //System.exit(1); System.out.println(v.getClassName()+", Pass 3a, method "+i+" ['"+jc.getMethods()[i]+"']:\n"+vr); vr = v.doPass3b(i); if (vr != VerificationResult.VR_OK) //System.exit(1); System.out.println(v.getClassName()+", Pass 3b, method "+i+" ['"+jc.getMethods()[i]+"']:\n"+vr); } } indent -= 1; }
final Verifier v = VerifierFactory.getVerifier(classname); VerificationResult vr; vr = v.doPass1(); if (vr != VerificationResult.VR_OK) { System.out.println("Pass 1:\n" + vr);
/** * Assures the generic preconditions of a LoadClass instance. * The referenced class is loaded and pass2-verified. */ public void visitLoadClass(LoadClass o){ ObjectType t = o.getLoadClassType(cpg); if (t != null){// null means "no class is loaded" Verifier v = VerifierFactory.getVerifier(t.getClassName()); VerificationResult vr = v.doPass1(); if (vr.getStatus() != VerificationResult.VERIFIED_OK){ constraintViolated((Instruction) o, "Class '"+o.getLoadClassType(cpg).getClassName()+"' is referenced, but cannot be loaded: '"+vr+"'."); } } }
/** * Assures the generic preconditions of a LoadClass instance. * The referenced class is loaded and pass2-verified. */ @Override public void visitLoadClass(final LoadClass o) { final ObjectType t = o.getLoadClassType(cpg); if (t != null) {// null means "no class is loaded" final Verifier v = VerifierFactory.getVerifier(t.getClassName()); final VerificationResult vr = v.doPass1(); if (vr.getStatus() != VerificationResult.VERIFIED_OK) { constraintViolated((Instruction) o, "Class '"+o.getLoadClassType(cpg).getClassName()+"' is referenced, but cannot be loaded: '"+vr+"'."); } } }
vr = v.doPass1(); if (vr.getStatus() == VerificationResult.VERIFIED_REJECTED) { pass1TextPane.setText(vr.getMessage());
vr = v.doPass1(); if (vr.getStatus() == VerificationResult.VERIFIED_REJECTED){ pass1TextPane.setText(vr.getMessage());
public void testDefaultMethodValidation() { final String classname = Collection.class.getName(); final Verifier verifier = VerifierFactory.getVerifier(classname); VerificationResult result = verifier.doPass1(); assertEquals("Pass 1 verification of " + classname + " failed: " + result.getMessage(), VerificationResult.VERIFIED_OK, result.getStatus()); result = verifier.doPass2(); assertEquals("Pass 2 verification of " + classname + " failed: " + result.getMessage(), VerificationResult.VERIFIED_OK, result.getStatus()); } }
VerificationResult vr = v.doPass1();
final VerificationResult vr = v.doPass1();
VerificationResult vr1 = myOwner.doPass1(); if (vr1.equals(VerificationResult.VR_OK)){
VerificationResult vr = v.doPass1(); vr = v.doPass1(); if (vr != VerificationResult.VR_OK){ throw new ClassConstraintException("Exceptions attribute '"+tostring(obj)+"' references '"+cname+"' as an Exception but '"+e.getSuperclassName()+"' in the ancestor hierachy does not pass verification pass 1: "+vr);
public VerificationResult do_verify() { try { final VerificationResult vr1 = myOwner.doPass1(); if (vr1.equals(VerificationResult.VR_OK)) {
VerificationResult result = verifier.doPass1(); if (result.getStatus() != VerificationResult.VERIFIED_OK) { return false;
if (act instanceof ObjectType){ Verifier v = VerifierFactory.getVerifier( ((ObjectType) act).getClassName() ); VerificationResult vr = v.doPass1(); if (vr != VerificationResult.VR_OK) { throw new ClassConstraintException("Method '"+tostring(obj)+"' has a return type that does not pass verification pass 1: '"+vr+"'."); if (act instanceof ObjectType){ Verifier v = VerifierFactory.getVerifier( ((ObjectType) act).getClassName() ); VerificationResult vr = v.doPass1(); if (vr != VerificationResult.VR_OK) { throw new ClassConstraintException("Method '"+tostring(obj)+"' has an argument type that does not pass verification pass 1: '"+vr+"'.");
VerificationResult vr = v.doPass1(); vr = v.doPass1(); if (vr != VerificationResult.VR_OK){ throw new ClassConstraintException("Code attribute '"+tostring(obj)+"' (method '"+m+"') has an exception_table entry '"+tostring(exc_table[i])+"' that references '"+cname+"' as an Exception but '"+e.getSuperclassName()+"' in the ancestor hierachy does not pass verification pass 1: "+vr);