synchronized void pass3aJList_valueChanged( final ListSelectionEvent e ) { if (e.getValueIsAdjusting()) { return; } final Verifier v = VerifierFactory.getVerifier(current_class); final StringBuilder all3amsg = new StringBuilder(); boolean all3aok = true; boolean rejected = false; for (int i = 0; i < pass3aJList.getModel().getSize(); i++) { if (pass3aJList.isSelectedIndex(i)) { final VerificationResult vr = v.doPass3a(i); if (vr.getStatus() == VerificationResult.VERIFIED_REJECTED) { all3aok = false; rejected = true; } JavaClass jc = null; try { jc = Repository.lookupClass(v.getClassName()); all3amsg.append("Method '").append(jc.getMethods()[i]).append("': ") .append(vr.getMessage().replace('\n', ' ') ).append("\n\n"); } catch (final ClassNotFoundException ex) { // FIXME: handle the error ex.printStackTrace(); } } } pass3aTextPane.setText(all3amsg.toString()); pass3aTextPane.setBackground(all3aok ? Color.green : (rejected ? Color.red : Color.yellow)); }
return new VerificationResult(VerificationResult.VERIFIED_REJECTED, e.getMessage()); return new VerificationResult(VerificationResult.VERIFIED_REJECTED, e.getMessage()); return new VerificationResult(VerificationResult.VERIFIED_REJECTED, "Parsing via BCEL did not succeed. "+ e.getClass().getName()+" occured:\n"+Utility.getStackTrace(e)); return new VerificationResult(VerificationResult.VERIFIED_REJECTED, "Repository.lookup() failed. FILE NOT FOUND?");
/** 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(); } }
public VerificationResult do_verify() { try { if (myOwner.doPass2().equals(VerificationResult.VR_OK)) { return new VerificationResult(VerificationResult.VERIFIED_REJECTED, "Bad bytecode in the code array of the Code attribute of method '"+method+"'."); vr = new VerificationResult(VerificationResult.VERIFIED_REJECTED, cce.getMessage()); return vr; vr = new VerificationResult(VerificationResult.VERIFIED_REJECTED, scce.getMessage()); vr = new VerificationResult(VerificationResult.VERIFIED_REJECTED, "Class Cast Exception: " + cce.getMessage());
/** 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(); } }
if (vr1.equals(VerificationResult.VR_OK)){ vr = new VerificationResult(VerificationResult.VERIFIED_REJECTED, cce.getMessage());
synchronized void pass3bJList_valueChanged( final ListSelectionEvent e ) { if (e.getValueIsAdjusting()) { return; } final Verifier v = VerifierFactory.getVerifier(current_class); final StringBuilder all3bmsg = new StringBuilder(); boolean all3bok = true; boolean rejected = false; for (int i = 0; i < pass3bJList.getModel().getSize(); i++) { if (pass3bJList.isSelectedIndex(i)) { final VerificationResult vr = v.doPass3b(i); if (vr.getStatus() == VerificationResult.VERIFIED_REJECTED) { all3bok = false; rejected = true; } JavaClass jc = null; try { jc = Repository.lookupClass(v.getClassName()); all3bmsg.append("Method '").append(jc.getMethods()[i]).append("': ") .append(vr.getMessage().replace('\n', ' ')).append("\n\n"); } catch (final ClassNotFoundException ex) { // FIXME: handle the error ex.printStackTrace(); } } } pass3bTextPane.setText(all3bmsg.toString()); pass3bTextPane.setBackground(all3bok ? Color.green : (rejected ? Color.red : Color.yellow)); }
/** Machine-generated. */ public void pass2Button_ActionPerformed( final java.awt.event.ActionEvent actionEvent ) { pass1Button_ActionPerformed(actionEvent); final Verifier v = VerifierFactory.getVerifier(class_name); final VerificationResult vr = v.doPass2(); if (vr.getStatus() == VerificationResult.VERIFIED_OK) { getPass2Panel().setBackground(Color.green); getPass2Panel().repaint(); } if (vr.getStatus() == VerificationResult.VERIFIED_NOTYET) { getPass2Panel().setBackground(Color.yellow); getPass2Panel().repaint(); } if (vr.getStatus() == VerificationResult.VERIFIED_REJECTED) { getPass2Panel().setBackground(Color.red); getPass2Panel().repaint(); } }
try { final VerificationResult vr1 = myOwner.doPass1(); if (vr1.equals(VerificationResult.VR_OK)) { vr = new VerificationResult(VerificationResult.VERIFIED_REJECTED, cce.getMessage());
return new VerificationResult(VerificationResult.VERIFIED_REJECTED, e.getMessage()); return new VerificationResult(VerificationResult.VERIFIED_REJECTED, e.getMessage()); return new VerificationResult(VerificationResult.VERIFIED_REJECTED, "Parsing via BCEL did not succeed. "+e.getClass().getName()+" occured:\n"+Utility.getStackTrace(e)); return new VerificationResult(VerificationResult.VERIFIED_REJECTED, "Repository.lookup() failed. FILE NOT FOUND?");
synchronized void pass3aJList_valueChanged(ListSelectionEvent e) { if (e.getValueIsAdjusting()) return; Verifier v = VerifierFactory.getVerifier(current_class); String all3amsg = ""; boolean all3aok = true; boolean rejected = false; for (int i=0; i<pass3aJList.getModel().getSize(); i++){ if (pass3aJList.isSelectedIndex(i)){ VerificationResult vr = v.doPass3a(i); if (vr.getStatus() == VerificationResult.VERIFIED_REJECTED){ all3aok = false; rejected = true; } all3amsg += "Method '"+Repository.lookupClass(v.getClassName()).getMethods()[i]+"': "+vr.getMessage().replace('\n',' ')+"\n\n"; } } pass3aTextPane.setText(all3amsg); pass3aTextPane.setBackground(all3aok? Color.green : (rejected? Color.red : Color.yellow)); }
/** Machine-generated. */ public void pass2Button_ActionPerformed(java.awt.event.ActionEvent actionEvent) { pass1Button_ActionPerformed(actionEvent); Verifier v = VerifierFactory.getVerifier(class_name); VerificationResult vr = v.doPass2(); if (vr.getStatus() == VerificationResult.VERIFIED_OK){ getPass2Panel().setBackground(Color.green); getPass2Panel().repaint(); } if (vr.getStatus() == VerificationResult.VERIFIED_NOTYET){ getPass2Panel().setBackground(Color.yellow); getPass2Panel().repaint(); } if (vr.getStatus() == VerificationResult.VERIFIED_REJECTED){ getPass2Panel().setBackground(Color.red); getPass2Panel().repaint(); } }
if (myOwner.doPass2().equals(VerificationResult.VR_OK)){ return new VerificationResult(VerificationResult.VERIFIED_REJECTED, "Bad bytecode in the code array of the Code attribute of method '"+method+"'."); vr = new VerificationResult(VerificationResult.VERIFIED_REJECTED, cce.getMessage()); return vr; vr = new VerificationResult(VerificationResult.VERIFIED_REJECTED, scce.getMessage());
synchronized void pass3bJList_valueChanged(ListSelectionEvent e) { if (e.getValueIsAdjusting()) return; Verifier v = VerifierFactory.getVerifier(current_class); String all3bmsg = ""; boolean all3bok = true; boolean rejected = false; for (int i=0; i<pass3bJList.getModel().getSize(); i++){ if (pass3bJList.isSelectedIndex(i)){ VerificationResult vr = v.doPass3b(i); if (vr.getStatus() == VerificationResult.VERIFIED_REJECTED){ all3bok = false; rejected = true; } all3bmsg += "Method '"+Repository.lookupClass(v.getClassName()).getMethods()[i]+"': "+vr.getMessage().replace('\n',' ')+"\n\n"; } } pass3bTextPane.setText(all3bmsg); pass3bTextPane.setBackground(all3bok? Color.green : (rejected? Color.red : Color.yellow)); }
/** Machine-generated. */ public void pass4Button_ActionPerformed(java.awt.event.ActionEvent actionEvent) { pass2Button_ActionPerformed(actionEvent); Color color = Color.green; Verifier v = VerifierFactory.getVerifier(class_name); VerificationResult vr = v.doPass2(); if (vr.getStatus() == VerificationResult.VERIFIED_OK){ JavaClass jc = Repository.lookupClass(class_name); int nr = jc.getMethods().length; for (int i=0; i<nr; i++) { vr = v.doPass3b(i); if (vr.getStatus() != VerificationResult.VERIFIED_OK){ color = Color.red; break; } } } else{ color = Color.yellow; } getPass3Panel().setBackground(color); getPass3Panel().repaint(); } }
if (! myOwner.doPass3a(method_no).equals(VerificationResult.VR_OK)){ return VerificationResult.VR_NOTYET; return new VerificationResult(VerificationResult.VERIFIED_REJECTED, ce.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()); } }
/** Machine-generated. */ public void pass4Button_ActionPerformed( final java.awt.event.ActionEvent actionEvent ) { pass2Button_ActionPerformed(actionEvent); Color color = Color.green; final Verifier v = VerifierFactory.getVerifier(class_name); VerificationResult vr = v.doPass2(); if (vr.getStatus() == VerificationResult.VERIFIED_OK) { JavaClass jc = null; try { jc = Repository.lookupClass(class_name); final int nr = jc.getMethods().length; for (int i = 0; i < nr; i++) { vr = v.doPass3b(i); if (vr.getStatus() != VerificationResult.VERIFIED_OK) { color = Color.red; break; } } } catch (final ClassNotFoundException ex) { // FIXME: report the error ex.printStackTrace(); } } else { color = Color.yellow; } getPass3Panel().setBackground(color); getPass3Panel().repaint(); } }
if (! myOwner.doPass3a(method_no).equals(VerificationResult.VR_OK)) { return VerificationResult.VR_NOTYET; return new VerificationResult(VerificationResult.VERIFIED_REJECTED, ce.getMessage());
if (vr.getStatus() == VerificationResult.VERIFIED_REJECTED) { pass1TextPane.setText(vr.getMessage()); pass1TextPane.setBackground(Color.red); pass2TextPane.setText(""); } else { // Must be VERIFIED_OK, Pass 1 does not know VERIFIED_NOTYET pass1TextPane.setBackground(Color.green); pass1TextPane.setText(vr.getMessage()); vr = v.doPass2(); if (vr.getStatus() == VerificationResult.VERIFIED_REJECTED) { pass2TextPane.setText(vr.getMessage()); pass2TextPane.setBackground(Color.red); pass3aTextPane.setText(""); pass3bJList.setListData(new String[0]); } else { // must be Verified_OK, because Pass1 was OK (cannot be Verified_NOTYET). pass2TextPane.setText(vr.getMessage()); pass2TextPane.setBackground(Color.green); final JavaClass jc = Repository.lookupClass(current_class);