@Test public void testGetMajorVersion() throws Exception { Assertions.assertThat(AsmUtils.getMajorVersion(Opcodes.V1_1)).isEqualTo(45); Assertions.assertThat(AsmUtils.getMajorVersion(Opcodes.V1_2)).isEqualTo(46); Assertions.assertThat(AsmUtils.getMajorVersion(Opcodes.V1_3)).isEqualTo(47); Assertions.assertThat(AsmUtils.getMajorVersion(Opcodes.V1_4)).isEqualTo(48); Assertions.assertThat(AsmUtils.getMajorVersion(Opcodes.V1_5)).isEqualTo(49); Assertions.assertThat(AsmUtils.getMajorVersion(Opcodes.V1_6)).isEqualTo(50); Assertions.assertThat(AsmUtils.getMajorVersion(Opcodes.V1_7)).isEqualTo(51); Assertions.assertThat(AsmUtils.getMajorVersion(Opcodes.V1_8)).isEqualTo(52); Assertions.assertThat(AsmUtils.getMajorVersion(Opcodes.V9)).isEqualTo(53); Assertions.assertThat(AsmUtils.getMajorVersion(Opcodes.V10)).isEqualTo(54); Assertions.assertThat(AsmUtils.getMajorVersion(Opcodes.V11)).isEqualTo(55); Assertions.assertThat(AsmUtils.getMajorVersion(Opcodes.V12)).isEqualTo(56); Assertions.assertThat(AsmUtils.getMajorVersion(Opcodes.V13)).isEqualTo(57); Assertions.assertThat(AsmUtils.getMajorVersion(Opcodes.V14)).isEqualTo(58); Assertions.assertThat(AsmUtils.getMajorVersion(Opcodes.V15)).isEqualTo(59); Assertions.assertThat(AsmUtils.getMajorVersion(Opcodes.V16)).isEqualTo(60); Assertions.assertThat(AsmUtils.getMajorVersion(Opcodes.V16 | Opcodes.V_PREVIEW)).isEqualTo(60); }
public static int getMajorVersion(int version) { return 0x0000FFFF & version; }
AsmUtils { public static int getMajorVersion(int version) { return 0x0000FFFF & version; } }
AsmUtils { public static int getMajorVersion(int version) { return 0x0000FFFF & version; }  }
AsmUtils { public static int getMajorVersion(int version) { return 0x0000FFFF & version; }  static ClassNode loadClass(Class<?> clazz); static ClassNode toClassNode(byte[] classBytes); static ClassReader toClassNode(byte[] classBytes, ClassNode classNode); static byte[] toBytes(ClassNode classNode, ClassLoader classLoader, ClassReader classReader); static byte[] toBytes(ClassNode classNode); static byte[] renameClass(byte[] classBytes, final String newClassName); static void replaceMethod(ClassNode classNode, MethodNode methodNode); static String toASMCode(byte[] bytecode); static String toASMCode(byte[] bytecode, boolean debug); static String toASMCode(ClassNode classNode); static String toASMCode(MethodNode methodNode); static MethodNode newMethodNode(MethodNode source); static MethodNode removeJSRInstructions(MethodNode subjectMethod); static ClassNode removeJSRInstructions(ClassNode classNode); static MethodNode removeLineNumbers(MethodNode methodNode); static MethodNode findFirstMethod(Collection<MethodNode> methodNodes, String name); static List<MethodNode> findMethods(Collection<MethodNode> methodNodes, String name); static MethodNode findMethod(Collection<MethodNode> methodNodes, MethodNode target); static MethodNode findMethod(Collection<MethodNode> methodNodes, String name, String desc); static AbstractInsnNode findInitConstructorInstruction(MethodNode methodNode); static List<MethodInsnNode> findMethodInsnNodeWithPrefix(MethodNode methodNode, String prefix); static List<MethodInsnNode> findMethodInsnNode(MethodNode methodNode, String owner, String name); static List<MethodInsnNode> findMethodInsnNode(MethodNode methodNode, String owner, String name,
                    String desc); static boolean containsMethodInsnNode(MethodNode methodNode, String owner, String name); static boolean isStatic(MethodNode methodNode); static boolean isStatic(MethodInsnNode methodInsnNode); static boolean isConstructor(MethodNode methodNode); String[] getParameterNames(MethodNode methodNode); static MethodNode copy(MethodNode source); static ClassNode copy(ClassNode source); static String methodDeclaration(MethodInsnNode methodInsnNode); static String methodDeclaration(Type owner, MethodNode methodNode); static FieldNode findField(List<FieldNode> fields, String name); static void addField(ClassNode classNode, FieldNode fieldNode); static void addMethod(ClassNode classNode, MethodNode methodNode); static String uniqueNameForMethod(String className, String methodName, String desc); static int getMajorVersion(int version); static int setMajorVersion(int version, int majorVersion); }
AsmUtils { public static int getMajorVersion(int version) { return 0x0000FFFF & version; }  static ClassNode loadClass(Class<?> clazz); static ClassNode toClassNode(byte[] classBytes); static ClassReader toClassNode(byte[] classBytes, ClassNode classNode); static byte[] toBytes(ClassNode classNode, ClassLoader classLoader, ClassReader classReader); static byte[] toBytes(ClassNode classNode); static byte[] renameClass(byte[] classBytes, final String newClassName); static void replaceMethod(ClassNode classNode, MethodNode methodNode); static String toASMCode(byte[] bytecode); static String toASMCode(byte[] bytecode, boolean debug); static String toASMCode(ClassNode classNode); static String toASMCode(MethodNode methodNode); static MethodNode newMethodNode(MethodNode source); static MethodNode removeJSRInstructions(MethodNode subjectMethod); static ClassNode removeJSRInstructions(ClassNode classNode); static MethodNode removeLineNumbers(MethodNode methodNode); static MethodNode findFirstMethod(Collection<MethodNode> methodNodes, String name); static List<MethodNode> findMethods(Collection<MethodNode> methodNodes, String name); static MethodNode findMethod(Collection<MethodNode> methodNodes, MethodNode target); static MethodNode findMethod(Collection<MethodNode> methodNodes, String name, String desc); static AbstractInsnNode findInitConstructorInstruction(MethodNode methodNode); static List<MethodInsnNode> findMethodInsnNodeWithPrefix(MethodNode methodNode, String prefix); static List<MethodInsnNode> findMethodInsnNode(MethodNode methodNode, String owner, String name); static List<MethodInsnNode> findMethodInsnNode(MethodNode methodNode, String owner, String name,
                    String desc); static boolean containsMethodInsnNode(MethodNode methodNode, String owner, String name); static boolean isStatic(MethodNode methodNode); static boolean isStatic(MethodInsnNode methodInsnNode); static boolean isConstructor(MethodNode methodNode); String[] getParameterNames(MethodNode methodNode); static MethodNode copy(MethodNode source); static ClassNode copy(ClassNode source); static String methodDeclaration(MethodInsnNode methodInsnNode); static String methodDeclaration(Type owner, MethodNode methodNode); static FieldNode findField(List<FieldNode> fields, String name); static void addField(ClassNode classNode, FieldNode fieldNode); static void addMethod(ClassNode classNode, MethodNode methodNode); static String uniqueNameForMethod(String className, String methodName, String desc); static int getMajorVersion(int version); static int setMajorVersion(int version, int majorVersion);  }