1 package com.sun.org.apache.bcel.internal.verifier; 2 3 56 57 67 public abstract class NativeVerifier{ 68 69 72 private NativeVerifier(){ 73 } 74 75 78 public static void _main(String [] args){ 79 if (args.length != 1){ 80 System.out.println("Verifier front-end: need exactly one argument."); 81 System.exit(1); 82 } 83 84 int dotclasspos = args[0].lastIndexOf(".class"); 85 if (dotclasspos != -1) args[0] = args[0].substring(0,dotclasspos); 86 args[0] = args[0].replace('/','.'); 87 89 90 try{ 91 Class.forName(args[0]); 92 } 93 catch(ExceptionInInitializerError eiie){ System.out.println("NativeVerifier: ExceptionInInitializerError encountered on '"+args[0]+"'."); 95 System.out.println(eiie); 96 System.exit(1); 97 } 98 catch(LinkageError le){ 99 System.out.println("NativeVerifier: LinkageError encountered on '"+args[0]+"'."); 100 System.out.println(le); 101 System.exit(1); 102 } 103 catch(ClassNotFoundException cnfe){ 104 System.out.println("NativeVerifier: FILE NOT FOUND: '"+args[0]+"'."); 105 System.exit(1); 106 } 107 catch(Throwable t){ 108 System.out.println("NativeVerifier: Unspecified verification error on'"+args[0]+"'."); 109 System.exit(1); 110 } 111 112 System.out.println("NativeVerifier: Class file '"+args[0]+"' seems to be okay."); 113 System.exit(0); 114 115 } 116 } 117 | Popular Tags |