{"record":{"id":"262059311821d2e5","repo":"oracle/graal","slug":"couldn-t-find-method-bridged-by-s-n-s","errorCode":null,"errorMessage":"Couldn't find method bridged by %s:%n%s","messagePattern":"Couldn't find method bridged by (.+?):%n(.+?)","errorType":"exception","errorClass":"InternalError","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/bytecode/BridgeMethodUtils.java","lineNumber":101,"sourceCode":"                        bridged = method;\n                    } else if (method.getName().equals(\"<init>\") && method.getDeclaringClass().getName().equals(\"Ljava/lang/AbstractMethodError;\")) {\n                        calledAbstractMethodErrorConstructor = true;\n                    }\n                    break;\n                }\n                case ATHROW: {\n                    if (calledAbstractMethodErrorConstructor) {\n                        // This is a miranda method\n                        return null;\n                    }\n                }\n            }\n            stream.next();\n            opcode = stream.currentBC();\n        }\n        if (bridged == null) {\n            String dis = new BytecodeDisassembler().disassemble(bridge);\n            throw new InternalError(String.format(\"Couldn't find method bridged by %s:%n%s\", bridge.format(\"%R %H.%n(%P)\"), dis));\n        }\n        return bridged;\n    }\n\n    @SuppressWarnings(\"all\")\n    private static boolean assertionsEnabled() {\n        boolean enabled = false;\n        assert enabled = true;\n        return enabled;\n    }\n\n    /**\n     * A helper that handles the absence of annotations on bridge methods where the bridged method\n     * has annotations.\n     */\n    public static AnnotationValue getAnnotation(Class<? extends Annotation> annotationClass, ResolvedJavaMethod method) {\n        AnnotationValue a = AnnotationValueSupport.getAnnotationValue(method, annotationClass);\n        if (a == null && method.isBridge()) {","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/bytecode/BridgeMethodUtils.java#L83-L119","documentation":"BridgeMethodUtils.getBridgeTarget scans a bridge method's bytecode for the INVOKESPECIAL/invokevirtual call to the method it forwards to; if no such call is found it throws this InternalError with a full disassembly of the bridge. It means the method was marked as a bridge (ACC_BRIDGE) by the class file producer, but its bytecode does not follow the javac bridge-method idiom Graal's scanner understands.","triggerScenarios":"Calling BridgeMethodUtils.getBridgeTarget(ResolvedJavaMethod) on a method with the ACC_BRIDGE flag whose body does not contain the expected call to the bridged method — e.g. miranda-method shapes that were already handled, bridges generated by non-javac compilers, or class files produced by newer/obfuscated toolchains whose bridge bodies were rewritten (dead-code elimination, stack-map rewriting, or security-manager-era accessor bodies).","commonSituations":"Running Graal on classes produced by Kotlin, Scala, Groovy, Android/D8-processed bytecode, coverage or instrumentation agents that strip or rewrite bridge bodies, or on class file versions whose compiler emits a new bridge idiom. Also seen after JVM/JDK upgrades that change how javac generates bridges for covariant returns or generic overrides.","solutions":["Report a Graal issue including the exception and the disassembly text embedded in the message — it shows exactly the malformed bridge bytecode.","Identify the offending class from the '%H.%n(%P)' method descriptor in the message and check which tool generated it (Kotlin/Scala/instrumentation agent); upgrade or re-emit that library so bridges follow the standard idiom.","As a workaround, exclude the enclosing method or class from Graal compilation (-XX:CompileCommand=exclude) since reflection/bridge resolution paths may still work on the interpreter/C1.","If an instrumentation/coverage agent is attached, try disabling it to confirm it rewrote the bridge body."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"ResolvedJavaMethod bridged = null;\ntry {\n    bridged = BridgeMethodUtils.getBridgeTarget(bridge);\n} catch (InternalError e) {\n    // log the embedded disassembly and skip bridge optimization for this method\n    LOG.warn(\"Unresolvable bridge: {}\", e.getMessage(), e);\n}","preventionTips":["When processing third-party bytecode defensively, wrap bridge-target resolution and degrade to plain reflection on failure.","Pin known-good versions of bytecode-transforming agents (coverage, obfuscators) in your build.","Include Kotlin/Scala-generated classes in compiler test corpora to catch bridge-idiom drift early."],"tags":["bytecode","bridge-methods","class-file","internal-error","compiler-frontend"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}