java.lang.VerifyError: Bad <init> method call from inside of a branch Exception Details: Location: MockedClass.<init>()V @32: invokespecial Reason: Error exists in the bytecode Bytecode: 0000000: 2a4c 120f b800 1503 bd00 0d12 16b8 001a 0000010: b800 204e 2db2 0024 a500 0e2a 01c0 0026 0000020: b700 29a7 0009 2bb7 002b 0157 b1 Stackmap Table: full_frame(@38,{UninitializedThis,UninitializedThis,Top,Object[#13]},{}) full_frame(@44,{Object[#2],Object[#2],Top,Object[#13]},{})

JBoss Issue Tracker | Florian Burka | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    burka/powermock-javassist-bug ยท GitHub

    github.com | 2 years ago
    java.lang.VerifyError: Bad <init> method call from inside of a branch Exception Details: Location: MockedClass.<init>()V @32: invokespecial Reason: Error exists in the bytecode Bytecode: 0000000: 2a4c 120f b800 1503 bd00 0d12 16b8 001a 0000010: b800 204e 2db2 0024 a500 0e2a 01c0 0026 0000020: b700 29a7 0009 2bb7 002b 0157 b1 Stackmap Table: full_frame(@38,{UninitializedThis,UninitializedThis,Top,Object[#13]},{}) full_frame(@44,{Object[#2],Object[#2],Top,Object[#13]},{})
  2. 0

    Powermock / Javassist creates illegal constructors for JDK 1.7.0u65 and 1.8.0u11 with -target 7

    GitHub | 2 years ago | GoogleCodeExporter
    java.lang.VerifyError: Bad <init> method call from inside of a branch Exception Details: Location: MockedClass.<init>()V @32: invokespecial Reason: Error exists in the bytecode Bytecode: 0000000: 2a4c 120f b800 1503 bd00 0d12 16b8 001a 0000010: b800 204e 2db2 0024 a500 0e2a 01c0 0026 0000020: b700 29a7 0009 2bb7 002b 0157 b1 Stackmap Table: full_frame(@38,{UninitializedThis,UninitializedThis,Top,Object[#13]},{}) full_frame(@44,{Object[#2],Object[#2],Top,Object[#13]},{})
  3. 0

    Javassist creates illegal constructors for JDK 1.7.0u65 and 1.8.0u11 with -target 7, I have a test that reproduces it at https://github.com/burka/powermock-javassist-bug . Somewhere in MainMockTransformer.transform(clazz), I think inside the PowerMockExpressionEditor, the responsible action must have taken place. If you remove -target 7 it works for both JDK 1.7.0u65 and 1.8.0u11. {code} Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.003 sec <<< FAILURE! - in ConstructorTest testConstructorManipulationFailure(ConstructorTest) Time elapsed: 0.002 sec <<< ERROR! java.lang.VerifyError: Bad <init> method call from inside of a branch Exception Details: Location: MockedClass.<init>()V @32: invokespecial Reason: Error exists in the bytecode Bytecode: 0000000: 2a4c 120f b800 1503 bd00 0d12 16b8 001a 0000010: b800 204e 2db2 0024 a500 0e2a 01c0 0026 0000020: b700 29a7 0009 2bb7 002b 0157 b1 Stackmap Table: full_frame(@38,{UninitializedThis,UninitializedThis,Top,Object[#13]},{}) full_frame(@44,{Object[#2],Object[#2],Top,Object[#13]},{}) at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2658) at java.lang.Class.getDeclaredConstructors(Class.java:2007) at ConstructorTest.testConstructorManipulationFailure(ConstructorTest.java:13) {code} I created a powermock ticket at https://code.google.com/p/powermock/issues/detail?id=505

    JBoss Issue Tracker | 3 years ago | Florian Burka
    java.lang.VerifyError: Bad <init> method call from inside of a branch Exception Details: Location: MockedClass.<init>()V @32: invokespecial Reason: Error exists in the bytecode Bytecode: 0000000: 2a4c 120f b800 1503 bd00 0d12 16b8 001a 0000010: b800 204e 2db2 0024 a500 0e2a 01c0 0026 0000020: b700 29a7 0009 2bb7 002b 0157 b1 Stackmap Table: full_frame(@38,{UninitializedThis,UninitializedThis,Top,Object[#13]},{}) full_frame(@44,{Object[#2],Object[#2],Top,Object[#13]},{})
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Javassist creates illegal constructors for JDK 1.7.0u65 and 1.8.0u11 with -target 7, I have a test that reproduces it at https://github.com/burka/powermock-javassist-bug . Somewhere in MainMockTransformer.transform(clazz), I think inside the PowerMockExpressionEditor, the responsible action must have taken place. If you remove -target 7 it works for both JDK 1.7.0u65 and 1.8.0u11. {code} Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.003 sec <<< FAILURE! - in ConstructorTest testConstructorManipulationFailure(ConstructorTest) Time elapsed: 0.002 sec <<< ERROR! java.lang.VerifyError: Bad <init> method call from inside of a branch Exception Details: Location: MockedClass.<init>()V @32: invokespecial Reason: Error exists in the bytecode Bytecode: 0000000: 2a4c 120f b800 1503 bd00 0d12 16b8 001a 0000010: b800 204e 2db2 0024 a500 0e2a 01c0 0026 0000020: b700 29a7 0009 2bb7 002b 0157 b1 Stackmap Table: full_frame(@38,{UninitializedThis,UninitializedThis,Top,Object[#13]},{}) full_frame(@44,{Object[#2],Object[#2],Top,Object[#13]},{}) at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2658) at java.lang.Class.getDeclaredConstructors(Class.java:2007) at ConstructorTest.testConstructorManipulationFailure(ConstructorTest.java:13) {code} I created a powermock ticket at https://code.google.com/p/powermock/issues/detail?id=505

    JBoss Issue Tracker | 3 years ago | Florian Burka
    java.lang.VerifyError: Bad <init> method call from inside of a branch Exception Details: Location: MockedClass.<init>()V @32: invokespecial Reason: Error exists in the bytecode Bytecode: 0000000: 2a4c 120f b800 1503 bd00 0d12 16b8 001a 0000010: b800 204e 2db2 0024 a500 0e2a 01c0 0026 0000020: b700 29a7 0009 2bb7 002b 0157 b1 Stackmap Table: full_frame(@38,{UninitializedThis,UninitializedThis,Top,Object[#13]},{}) full_frame(@44,{Object[#2],Object[#2],Top,Object[#13]},{})
  6. 0

    Powermock / Javassist creates illegal constructors for JDK 1.7.0u65 and 1.8.0u11 with -target 7

    GitHub | 2 years ago | johanhaleby
    java.lang.VerifyError: Bad \<init> method call from inside of a branch Exception Details: Location: MockedClass.<init>()V @32: invokespecial Reason: Error exists in the bytecode Bytecode: 0000000: 2a4c 120f b800 1503 bd00 0d12 16b8 001a 0000010: b800 204e 2db2 0024 a500 0e2a 01c0 0026 0000020: b700 29a7 0009 2bb7 002b 0157 b1 Stackmap Table: full_frame(@38,{UninitializedThis,UninitializedThis,Top,Object[#13]},{}) full_frame(@44,{Object[#2],Object[#2],Top,Object[#13]},{})

    5 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.VerifyError

      Bad <init> method call from inside of a branch Exception Details: Location: MockedClass.<init>()V @32: invokespecial Reason: Error exists in the bytecode Bytecode: 0000000: 2a4c 120f b800 1503 bd00 0d12 16b8 001a 0000010: b800 204e 2db2 0024 a500 0e2a 01c0 0026 0000020: b700 29a7 0009 2bb7 002b 0157 b1 Stackmap Table: full_frame(@38,{UninitializedThis,UninitializedThis,Top,Object[#13]},{}) full_frame(@44,{Object[#2],Object[#2],Top,Object[#13]},{})

      at java.lang.Class.getDeclaredConstructors0()
    2. Java RT
      Class.getDeclaredConstructors
      1. java.lang.Class.getDeclaredConstructors0(Native Method)
      2. java.lang.Class.privateGetDeclaredConstructors(Class.java:2658)
      3. java.lang.Class.getDeclaredConstructors(Class.java:2007)
      3 frames
    3. Unknown
      ConstructorTest.testConstructorManipulationFailure
      1. ConstructorTest.testConstructorManipulationFailure(ConstructorTest.java:13)
      1 frame