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)); }
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)); }
System.out.println("Pass 3a, method number "+i+" ['"+jc.getMethods()[i]+"']:\n"+vr); vr = v.doPass3b(i); System.out.println("Pass 3b, method number "+i+" ['"+jc.getMethods()[i]+"']:\n"+vr);
System.out.println("Pass 3a, method number " + i + " ['" + jc.getMethods()[i] + "']:\n" + vr); vr = v.doPass3b(i); System.out.println("Pass 3b, method number " + i + " ['" + jc.getMethods()[i] + "']:\n" + vr);
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; }
+ jc.getMethods()[i] + "']:\n" + vr); vr = v.doPass3b(i); if (vr != VerificationResult.VR_OK) { System.out.println(v.getClassName() + ", Pass 3b, method " + i + " ['"
/** 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(); } }
/** 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(); } }
return false; result = verifier.doPass3b(i); if (result.getStatus() != VerificationResult.VERIFIED_OK) { return false;