{"record":{"id":"74406f22f29c536d","repo":"quarkusio/quarkus","slug":"method-s-annotated-with-funq-declared-in-the","errorCode":null,"errorMessage":"Method '%s' annotated with '@Funq' declared in the class '%s' is not public.","messagePattern":"Method '(.+?)' annotated with '@Funq' declared in the class '(.+?)' is not public\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/funqy/funqy-server-common/deployment/src/main/java/io/quarkus/funqy/deployment/FunctionScannerBuildStep.java","lineNumber":68,"sourceCode":"            BuildProducer<BytecodeTransformerBuildItem> transformers,\n            BuildProducer<AnnotationsTransformerBuildItem> annotationsTransformer,\n            BuildProducer<UnremovableBeanBuildItem> unremovableBeans,\n            BuildProducer<ReflectiveClassBuildItem> reflectiveClass,\n            BuildProducer<ReflectiveHierarchyBuildItem> reflectiveHierarchy,\n            BuildProducer<FunctionBuildItem> functions) {\n        IndexView index = beanArchiveIndexBuildItem.getIndex();\n        Collection<AnnotationInstance> funqs = index.getAnnotations(FUNQ);\n        Set<ClassInfo> classes = new HashSet<>();\n        Set<String> classNames = new HashSet<>();\n        for (AnnotationInstance funqMethod : funqs) {\n            MethodInfo method = funqMethod.target().asMethod();\n            String className = method.declaringClass().name().toString();\n            classNames.add(className);\n            classes.add(method.declaringClass());\n            String methodName = method.name();\n\n            if (!Modifier.isPublic(method.flags())) {\n                throw new RuntimeException(\n                        String.format(\"Method '%s' annotated with '@Funq' declared in the class '%s' is not public.\",\n                                methodName, className));\n            }\n\n            String functionName = null;\n            if (funqMethod.value() != null) {\n                functionName = funqMethod.value().asString();\n            }\n            if (functionName != null && functionName.isEmpty())\n                functionName = null;\n            functions.produce(new FunctionBuildItem(className, methodName, method.descriptor(), functionName));\n\n            String source = FunctionScannerBuildStep.class.getSimpleName() + \" > \" + method.declaringClass() + \"[\" + method\n                    + \"]\";\n\n            Type returnType = method.returnType();\n            if (returnType.kind() != Type.Kind.VOID) {\n                reflectiveHierarchy.produce(ReflectiveHierarchyBuildItem","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/funqy/funqy-server-common/deployment/src/main/java/io/quarkus/funqy/deployment/FunctionScannerBuildStep.java#L50-L86","documentation":"During deployment, FunctionScanner scans classes for methods annotated with @Funq. A @Funq method must be public so the framework can generate invokers; non-public methods are rejected with a build-time RuntimeException naming the method and its class.","triggerScenarios":"Annotating a package-private, protected, or private method with @Funq, e.g. @Funq void handle(String s) in a bean class.","commonSituations":"Refactoring a public handler to a smaller visibility; writing helper-style functions without the public modifier; Kotlin/internal conventions mapping to default visibility.","solutions":["Add the public modifier to the @Funq method","If the method is meant to be internal, remove @Funq and call it from a public @Funq method","Rebuild; this is a deployment-time check so the fix is confirmed at compile of the extension"],"exampleFix":"// before\n@Funq\nString upper(String s) { return s.toUpperCase(); }\n// after\n@Funq\npublic String upper(String s) { return s.toUpperCase(); }","handlingStrategy":"validation","validationCode":"// Build-time style check before annotating\nif (!java.lang.reflect.Modifier.isPublic(MethodHandles.lookup()\n        .reflectClass(MyBean.class).getDeclaredMethods()[0].flags))\n    throw new IllegalStateException(\"@Funq methods must be public\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always declare @Funq methods public","Pair the annotation with a checklist item: public method, registered name, supported signature","Add unit tests that reflect over @Funq methods and assert public visibility","Avoid refactoring visibility of annotated methods without rerunning the build"],"tags":["quarkus","funqy","visibility","build-time"],"backgroundTag":"method-not-public","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}