public static byte[] toByteArray(BCClass bc, byte[] returnBytes) throws IOException { if (bc.getMajorVersion() >= Java7_MajorVersion) { returnBytes = toJava7ByteArray(bc, returnBytes); } return returnBytes; }
public static byte[] toByteArray(BCClass bc, byte[] returnBytes) throws IOException { if (bc.getMajorVersion() >= Java7_MajorVersion) { returnBytes = toJava7ByteArray(bc, returnBytes); } return returnBytes; }
public static byte[] toByteArray(BCClass bc, byte[] returnBytes) throws IOException { if (bc.getMajorVersion() >= Java7_MajorVersion) { returnBytes = toJava7ByteArray(bc, returnBytes); } return returnBytes; }
public static byte[] toByteArray(BCClass bc, byte[] returnBytes) throws IOException { if (bc.getMajorVersion() >= Java7_MajorVersion) { returnBytes = toJava7ByteArray(bc, returnBytes); } return returnBytes; }
public static byte[] toByteArray(BCClass bc, byte[] returnBytes) throws IOException { if (bc.getMajorVersion() >= Java7_MajorVersion) { returnBytes = toJava7ByteArray(bc, returnBytes); } return returnBytes; }
public static void write(BCClass bc, File outFile) throws IOException { if (bc.getMajorVersion() < Java7_MajorVersion) { bc.write(outFile); } else { OutputStream out = new FileOutputStream(outFile); try { writeJava7(bc, out); } finally { out.flush(); out.close(); } } }
public static void write(BCClass bc, File outFile) throws IOException { if (bc.getMajorVersion() < Java7_MajorVersion) { bc.write(outFile); } else { OutputStream out = new FileOutputStream(outFile); try { writeJava7(bc, out); } finally { out.flush(); out.close(); } } }
public static void write(BCClass bc, File outFile) throws IOException { if (bc.getMajorVersion() < Java7_MajorVersion) { bc.write(outFile); } else { OutputStream out = new FileOutputStream(outFile); try { writeJava7(bc, out); } finally { out.flush(); out.close(); } } }
public static void write(BCClass bc, File outFile) throws IOException { if (bc.getMajorVersion() < Java7_MajorVersion) { bc.write(outFile); } else { OutputStream out = new FileOutputStream(outFile); try { writeJava7(bc, out); } finally { out.flush(); out.close(); } } }
public static void write(BCClass bc, File outFile) throws IOException { if (bc.getMajorVersion() < Java7_MajorVersion) { bc.write(outFile); } else { OutputStream out = new FileOutputStream(outFile); try { writeJava7(bc, out); } finally { out.flush(); out.close(); } } }
@SuppressWarnings("deprecation") public static void write(BCClass bc) throws IOException { if (bc.getMajorVersion() < Java7_MajorVersion) { bc.write(); } else { String name = bc.getName(); int dotIndex = name.lastIndexOf('.') + 1; name = name.substring(dotIndex); Class<?> type = bc.getType(); OutputStream out = new FileOutputStream( URLDecoder.decode(type.getResource(name + ".class").getFile())); try { writeJava7(bc, out); } finally { out.flush(); out.close(); } } }
@SuppressWarnings("deprecation") public static void write(BCClass bc) throws IOException { if (bc.getMajorVersion() < Java7_MajorVersion) { bc.write(); } else { String name = bc.getName(); int dotIndex = name.lastIndexOf('.') + 1; name = name.substring(dotIndex); Class<?> type = bc.getType(); OutputStream out = new FileOutputStream( URLDecoder.decode(type.getResource(name + ".class").getFile())); try { writeJava7(bc, out); } finally { out.flush(); out.close(); } } }
@SuppressWarnings("deprecation") public static void write(BCClass bc) throws IOException { if (bc.getMajorVersion() < Java7_MajorVersion) { bc.write(); } else { String name = bc.getName(); int dotIndex = name.lastIndexOf('.') + 1; name = name.substring(dotIndex); Class<?> type = bc.getType(); OutputStream out = new FileOutputStream( URLDecoder.decode(type.getResource(name + ".class").getFile())); try { writeJava7(bc, out); } finally { out.flush(); out.close(); } } }
@SuppressWarnings("deprecation") public static void write(BCClass bc) throws IOException { if (bc.getMajorVersion() < Java7_MajorVersion) { bc.write(); } else { String name = bc.getName(); int dotIndex = name.lastIndexOf('.') + 1; name = name.substring(dotIndex); Class<?> type = bc.getType(); OutputStream out = new FileOutputStream( URLDecoder.decode(type.getResource(name + ".class").getFile())); try { writeJava7(bc, out); } finally { out.flush(); out.close(); } } }
/** * When adding annotations, make sure the bytecode spec supports them. */ private void ensureBytecodeVersion() { BCClass bc = getBCClass(); if (bc.getMajorVersion() < Constants.MAJOR_VERSION_JAVA5) { bc.setMajorVersion(Constants.MAJOR_VERSION_JAVA5); bc.setMinorVersion(Constants.MINOR_VERSION_JAVA5); } }
/** * When adding annotations, make sure the bytecode spec supports them. */ private void ensureBytecodeVersion() { BCClass bc = getBCClass(); if (bc.getMajorVersion() < Constants.MAJOR_VERSION_JAVA5) { bc.setMajorVersion(Constants.MAJOR_VERSION_JAVA5); bc.setMinorVersion(Constants.MINOR_VERSION_JAVA5); } }
/** * When adding class entries, make sure the bytecode spec supports them. */ private void ensureBytecodeVersion() { BCClass bc = getCode().getMethod().getDeclarer(); if (bc.getMajorVersion() < Constants.MAJOR_VERSION_JAVA5) { bc.setMajorVersion(Constants.MAJOR_VERSION_JAVA5); bc.setMinorVersion(Constants.MINOR_VERSION_JAVA5); } } }
/** * When adding class entries, make sure the bytecode spec supports them. */ private void ensureBytecodeVersion() { BCClass bc = getCode().getMethod().getDeclarer(); if (bc.getMajorVersion() < Constants.MAJOR_VERSION_JAVA5) { bc.setMajorVersion(Constants.MAJOR_VERSION_JAVA5); bc.setMinorVersion(Constants.MINOR_VERSION_JAVA5); } } }
public void enterBCClass(BCClass obj) { openBlock("Class"); println("magic=" + obj.getMagic()); println("minor=" + obj.getMinorVersion()); println("major=" + obj.getMajorVersion()); println("access=" + obj.getAccessFlags()); println("name=" + obj.getIndex() + " <" + obj.getName() + ">"); println("super=" + obj.getSuperclassIndex() + " <" + obj.getSuperclassName() + ">"); int[] indexes = obj.getDeclaredInterfaceIndexes(); String[] names = obj.getDeclaredInterfaceNames(); for (int i = 0; i < indexes.length; i++) println("interface=" + indexes[i] + " <" + names[i] + ">"); }
public void enterBCClass(BCClass obj) { openBlock("Class"); println("magic=" + obj.getMagic()); println("minor=" + obj.getMinorVersion()); println("major=" + obj.getMajorVersion()); println("access=" + obj.getAccessFlags()); println("name=" + obj.getIndex() + " <" + obj.getName() + ">"); println("super=" + obj.getSuperclassIndex() + " <" + obj.getSuperclassName() + ">"); int[] indexes = obj.getDeclaredInterfaceIndexes(); String[] names = obj.getDeclaredInterfaceNames(); for (int i = 0; i < indexes.length; i++) println("interface=" + indexes[i] + " <" + names[i] + ">"); }