{"record":{"id":"384c7aeadcf85df0","repo":"oracle/graal","slug":"s-has-params","errorCode":null,"errorMessage":"%s has params","messagePattern":"(.+?) has params","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/annotation/AnnotationValueType.java","lineNumber":83,"sourceCode":"        return existing != null ? existing : created;\n    }\n\n    private AnnotationValueType(ResolvedJavaType annotationClass) {\n        if (!annotationClass.isAnnotation()) {\n            throw new IllegalArgumentException(\"Not an annotation type\");\n        }\n\n        ResolvedJavaMethod[] methods = annotationClass.getDeclaredMethods();\n\n        memberTypes = new EconomicHashMap<>(methods.length + 1);\n        memberDefaults = new EconomicHashMap<>(0);\n\n        for (ResolvedJavaMethod method : methods) {\n            if (method.isPublic() &&\n                            method.isAbstract() &&\n                            !method.isSynthetic()) {\n                if (method.getSignature().getParameterCount(false) != 0) {\n                    throw new IllegalArgumentException(method + \" has params\");\n                }\n                String name = method.getName();\n                ResolvedJavaType memberType = method.getSignature().getReturnType(annotationClass).resolve(annotationClass);\n                memberTypes.put(name, memberType);\n\n                Object defaultValue = AnnotationValueSupport.getAnnotationDefaultValue(method);\n                if (defaultValue != null) {\n                    memberDefaults.put(name, defaultValue);\n                }\n            }\n        }\n    }\n\n    /**\n     * Determines if the type of {@code elementValue} matches {@code elementType}.\n     *\n     * @param elementValue a value of a type returned by {@link AnnotationValue#get}\n     * @param elementType an annotation element type (i.e. the return type of an annotation","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/annotation/AnnotationValueType.java#L65-L101","documentation":"JNIMethodResolver lazily resolves a static Java method on the entry-points class via JNI GetStaticMethodID. If the JNI call returns a null method ID (no pending exception mapping it to a Java exception), the wrapper throws InternalError naming the method: the class was found but the requested static method with that exact name/signature is not present. This usually means a version mismatch between the JNIutils native glue and the Java entry-points class.","triggerScenarios":"Calling GetStaticMethodID for a method whose signature string is wrong (e.g. missing semicolons or wrong argument order); renaming or removing the method in a newer org.graalvm.jniutils build while native code still references the old name; method exists but is non-static.","commonSituations":"Mixed-version GraalVM/Espresso jars on the classpath; hand-written signature strings for JNI method lookups; upgrading jniutils without rebuilding native counterparts.","solutions":["Verify the method exists, is static, and its descriptor string exactly matches (e.g. \"(ILjava/lang/String;)V\") using javap -s on the entry-points class.","Align versions: use matching org.graalvm.jniutils / Espresso / GraalVM artifacts from the same release so native and Java sides agree.","If you control the resolver, double-check methodName/methodSignature spelling, especially class-name slashes vs dots."],"exampleFix":"// before\nnew JNIMethodResolver(\"throwException\", \"(Ljava/lang/Throwable)V\") // wrong: missing trailing \";\" for object type? it is present; but e.g.\n\n// after\n// correct descriptor verified with `javap -s`:\nnew JNIMethodResolver(\"throwException\", \"(Ljava/lang/Throwable;)V\")","handlingStrategy":"try-catch","validationCode":"// Verify the static method and descriptor before resolving:\n// javap -s -p target/classes/org/graalvm/jniutils/JNIExceptionWrapperEntryPoints\n// then ensure methodName + methodSignature match one of the printed descriptors exactly.","typeGuard":null,"tryCatchPattern":"try {\n    resolver.resolve(env);\n} catch (InternalError e) {\n    if (e.getMessage().startsWith(\"No such method:\")) {\n        // version/signature mismatch: fail fast with diagnostics, list the class's static methods\n    } else {\n        throw e;\n    }\n}","preventionTips":["Pin all GraalVM artifacts (jniutils, espresso, substratevm) to one BOM/release version.","Generate JNI descriptors from javap -s output rather than hand-writing them.","Add a startup assertion that the expected entry-points methods resolve before native code depends on them."],"tags":["jni","method-resolution","version-mismatch","signature"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}