1 17 package org.apache.bcel.verifier; 18 19 29 public abstract class NativeVerifier { 30 31 34 private NativeVerifier() { 35 } 36 37 38 41 public static void main( String [] args ) { 42 if (args.length != 1) { 43 System.out.println("Verifier front-end: need exactly one argument."); 44 System.exit(1); 45 } 46 int dotclasspos = args[0].lastIndexOf(".class"); 47 if (dotclasspos != -1) { 48 args[0] = args[0].substring(0, dotclasspos); 49 } 50 args[0] = args[0].replace('/', '.'); 51 try { 53 Class.forName(args[0]); 54 } catch (ExceptionInInitializerError eiie) { System.out.println("NativeVerifier: ExceptionInInitializerError encountered on '" 56 + args[0] + "'."); 57 System.out.println(eiie); 58 System.exit(1); 59 } catch (LinkageError le) { 60 System.out.println("NativeVerifier: LinkageError encountered on '" + args[0] + "'."); 61 System.out.println(le); 62 System.exit(1); 63 } catch (ClassNotFoundException cnfe) { 64 System.out.println("NativeVerifier: FILE NOT FOUND: '" + args[0] + "'."); 65 System.exit(1); 66 } catch (Throwable t) { 67 System.out.println("NativeVerifier: Unspecified verification error on'" + args[0] 68 + "'."); 69 System.exit(1); 70 } 71 System.out.println("NativeVerifier: Class file '" + args[0] + "' seems to be okay."); 72 System.exit(0); 73 } 74 } 75 | Popular Tags |