public static void debugBytecodes(BCClass bc) throws IOException { // Write the bytecodes to disk for debugging purposes. if ("true".equals(System.getProperty( ManagedClassSubclasser.class.getName() + ".dumpBytecodes"))) { File tmp = new File(System.getProperty("java.io.tmpdir")); File dir = new File(tmp, "openjpa"); dir = new File(dir, "pcsubclasses"); dir.mkdirs(); dir = Files.getPackageFile(dir, bc.getPackageName(), true); File f = new File(dir, bc.getClassName() + ".class"); // START - ALLOW PRINT STATEMENTS System.err.println("Writing to " + f); // STOP - ALLOW PRINT STATEMENTS AsmAdaptor.write(bc, f); } }
public static void debugBytecodes(BCClass bc) throws IOException { // Write the bytecodes to disk for debugging purposes. if ("true".equals(System.getProperty( ManagedClassSubclasser.class.getName() + ".dumpBytecodes"))) { File tmp = new File(System.getProperty("java.io.tmpdir")); File dir = new File(tmp, "openjpa"); dir = new File(dir, "pcsubclasses"); dir.mkdirs(); dir = Files.getPackageFile(dir, bc.getPackageName(), true); File f = new File(dir, bc.getClassName() + ".class"); // START - ALLOW PRINT STATEMENTS System.err.println("Writing to " + f); // STOP - ALLOW PRINT STATEMENTS AsmAdaptor.write(bc, f); } }
public static void debugBytecodes(BCClass bc) throws IOException { // Write the bytecodes to disk for debugging purposes. if ("true".equals(System.getProperty( ManagedClassSubclasser.class.getName() + ".dumpBytecodes"))) { File tmp = new File(System.getProperty("java.io.tmpdir")); File dir = new File(tmp, "openjpa"); dir = new File(dir, "pcsubclasses"); dir.mkdirs(); dir = Files.getPackageFile(dir, bc.getPackageName(), true); File f = new File(dir, bc.getClassName() + ".class"); // START - ALLOW PRINT STATEMENTS System.err.println("Writing to " + f); // STOP - ALLOW PRINT STATEMENTS AsmAdaptor.write(bc, f); } }
public static void debugBytecodes(BCClass bc) throws IOException { // Write the bytecodes to disk for debugging purposes. if ("true".equals(System.getProperty( ManagedClassSubclasser.class.getName() + ".dumpBytecodes"))) { File tmp = new File(System.getProperty("java.io.tmpdir")); File dir = new File(tmp, "openjpa"); dir = new File(dir, "pcsubclasses"); dir.mkdirs(); dir = Files.getPackageFile(dir, bc.getPackageName(), true); File f = new File(dir, bc.getClassName() + ".class"); // START - ALLOW PRINT STATEMENTS System.err.println("Writing to " + f); // STOP - ALLOW PRINT STATEMENTS AsmAdaptor.write(bc, f); } }
/** * Write the given class. */ private void record(BCClass bc) throws IOException { if (_writer != null) _writer.write(bc); else if (_dir == null) AsmAdaptor.write(bc); else { File dir = Files.getPackageFile(_dir, bc.getPackageName(), true); AsmAdaptor.write(bc, new File(dir, bc.getClassName() + ".class")); } }
/** * Write the given class. */ private void record(BCClass bc) throws IOException { if (_writer != null) _writer.write(bc); else if (_dir == null) AsmAdaptor.write(bc); else { File dir = Files.getPackageFile(_dir, bc.getPackageName(), true); AsmAdaptor.write(bc, new File(dir, bc.getClassName() + ".class")); } }
/** * Write the given class. */ private void record(BCClass bc) throws IOException { if (_writer != null) _writer.write(bc); else if (_dir == null) AsmAdaptor.write(bc); else { File dir = Files.getPackageFile(_dir, bc.getPackageName(), true); AsmAdaptor.write(bc, new File(dir, bc.getClassName() + ".class")); } }
/** * Write the given class. */ private void record(BCClass bc) throws IOException { if (_writer != null) _writer.write(bc); else if (_dir == null) AsmAdaptor.write(bc); else { File dir = Files.getPackageFile(_dir, bc.getPackageName(), true); AsmAdaptor.write(bc, new File(dir, bc.getClassName() + ".class")); } }
public static void main(String[] args) throws IOException { Project project = new Project(); InputStream in = WASManagedRuntime.class.getClassLoader() .getResourceAsStream(CLASS.replace('.', '/') + ".class"); BCClass bcClass = project.loadClass(in); String [] interfaces = bcClass.getInterfaceNames(); if(interfaces != null) { for(int i = 0; i < interfaces.length; i++) { if(interfaces[i].equals(INTERFACE)) { return; } } } bcClass.declareInterface(INTERFACE); AsmAdaptor.write(bcClass); }
public static void main(String[] args) throws IOException { Project project = new Project(); InputStream in = WASManagedRuntime.class.getClassLoader() .getResourceAsStream(CLASS.replace('.', '/') + ".class"); BCClass bcClass = project.loadClass(in); String [] interfaces = bcClass.getInterfaceNames(); if(interfaces != null) { for(int i = 0; i < interfaces.length; i++) { if(interfaces[i].equals(INTERFACE)) { return; } } } bcClass.declareInterface(INTERFACE); AsmAdaptor.write(bcClass); }
public static void main(String[] args) throws IOException { Project project = new Project(); InputStream in = WASManagedRuntime.class.getClassLoader() .getResourceAsStream(CLASS.replace('.', '/') + ".class"); BCClass bcClass = project.loadClass(in); String [] interfaces = bcClass.getInterfaceNames(); if(interfaces != null) { for(int i = 0; i < interfaces.length; i++) { if(interfaces[i].equals(INTERFACE)) { return; } } } bcClass.declareInterface(INTERFACE); AsmAdaptor.write(bcClass); }
public static void main(String[] args) throws IOException { Project project = new Project(); InputStream in = WASManagedRuntime.class.getClassLoader() .getResourceAsStream(CLASS.replace('.', '/') + ".class"); BCClass bcClass = project.loadClass(in); String [] interfaces = bcClass.getInterfaceNames(); if(interfaces != null) { for(int i = 0; i < interfaces.length; i++) { if(interfaces[i].equals(INTERFACE)) { return; } } } bcClass.declareInterface(INTERFACE); AsmAdaptor.write(bcClass); }
AsmAdaptor.write(bc, new File(dir, bc.getClassName() + ".class"));
AsmAdaptor.write(bc, new File(dir, bc.getClassName() + ".class"));
AsmAdaptor.write(bc, new File(dir, bc.getClassName() + ".class"));
AsmAdaptor.write(bc, new File(dir, bc.getClassName() + ".class"));