| 1 30 31 35 36 package jbet.cmd; 37 import jbet.*; 38 import java.io.*; 39 import java.util.*; 40 41 public class regen implements Command 42 { 43 public int helplevel() { return 5; } 44 public String shorthelp() { return "test command"; } 45 public String longhelp() { 46 return 47 "jbet regen <class>\t\tTest jbet on <class>\n"; } 48 49 public void run (Lexer lexer) throws Exception { 50 lexer.match(Token.END_OF_OPTS); 51 ClassInfo [] cin = lexer.getClasses(); 52 lexer.term(); 53 54 for (int i = 0; i < cin.length; i++) 55 doregen(cin[i]); 56 } 57 58 void doregen (ClassInfo cr) throws Exception { 59 Jbet.info.print( cr.name() + ", "); 60 61 InputStream is = cr.getPathElement().get( cr.name() + ".class" ); 62 ExactCopyStream ecs = new ExactCopyStream(is); 63 DataOutputStream dataOut = new DataOutputStream(ecs); 64 cr.resolveConstants(); 65 try { 66 cr.writeFile(dataOut); 67 Jbet.info.print("Success"); 68 } finally { 69 Jbet.info.println(); 70 } 71 } 72 } 73 | Popular Tags |