1 30 31 35 36 package jbet.cmd; 37 import jbet.*; 38 import java.io.*; 39 import java.util.*; 40 41 public class verifyall implements Command 42 { 43 public int helplevel() { return 1; } 44 public String shorthelp() { return "verify multiple classes"; } 45 public String longhelp() { 46 return 47 "jbet verify <classes>\n\tVerify the specified classes, as the JVM would."; } 48 49 public void run (Lexer lexer) throws Exception 50 { 51 Vector classes = new Vector(); 52 53 lexer.match(Token.END_OF_OPTS); 54 lexer.getClassNames(classes); 55 lexer.term(); 56 57 for (Iterator ic = classes.iterator(); ic.hasNext(); ) { 58 String cname = ic.next().toString(); 59 ClassInfo cr = Jbet.loader.getClass (cname); 60 61 boolean bad = false; 62 63 for (int i = 0; i < cr.numMethods(); i++) { 64 MethodInfo mi = cr.methodAt(i); 65 if (mi.code == null) continue; 66 67 try { 68 DataFlow df = new DataFlow (mi); 69 df.out = Jbet.debug; 70 df.run(); 71 Jbet.info.println ("verified " + mi.qualifiedName()); 72 } catch (Exception e) { 73 Jbet.output.println (e.toString()); 74 bad = true; 75 } 76 mi.removeDataFlow(); 77 } 78 79 if (bad) 80 Jbet.output.println (cr.name() + " : failed verify"); 81 } 82 } 83 84 } 85 | Popular Tags |