{"record":{"id":"8312039ca5e15fb6","repo":"quarkusio/quarkus","slug":"global-variable-field-declared-on-field-declar-831203","errorCode":null,"errorMessage":"Global variable field declared on \" + field.declaringClass().name() + \" must not be private: \" + field","messagePattern":"Global variable field declared on \" \\+ field\\.declaringClass\\(\\)\\.name\\(\\) \\+ \" must not be private: \" \\+ field","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"independent-projects/qute/generator/src/main/java/io/quarkus/qute/generator/TemplateGlobalGenerator.java","lineNumber":187,"sourceCode":"                    + \" must not return void: \" + method);\n        }\n        if (!method.parameterTypes().isEmpty()) {\n            throw new IllegalStateException(\"Global variable method declared on \" + method.declaringClass().name()\n                    + \" must not accept any parameter: \" + method);\n        }\n        if (Modifier.isPrivate(method.flags())) {\n            throw new IllegalStateException(\"Global variable method declared on \" + method.declaringClass().name()\n                    + \" must not be private: \" + method);\n        }\n    }\n\n    public static void validate(FieldInfo field) {\n        if (!Modifier.isStatic(field.flags())) {\n            throw new IllegalStateException(\n                    \"Global variable field declared on \" + field.declaringClass().name() + \"  must be static: \" + field);\n        }\n        if (Modifier.isPrivate(field.flags())) {\n            throw new IllegalStateException(\"Global variable field declared on \" + field.declaringClass().name()\n                    + \" must not be private: \" + field);\n        }\n    }\n}\n","sourceCodeStart":169,"sourceCodeEnd":192,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/qute/generator/src/main/java/io/quarkus/qute/generator/TemplateGlobalGenerator.java#L169-L192","documentation":"IllegalStateException from TemplateGlobalGenerator.validate(FieldInfo): a field annotated @TemplateGlobal is private, so generated template code cannot read it. The build fails naming the declaring class and field.","triggerScenarios":"Thrown at independent-projects/qute/generator/src/main/java/io/quarkus/qute/generator/TemplateGlobalGenerator.java:187 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make the @TemplateGlobal field non-private (public/package)","Expose the value via a static getter method instead"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}