{"record":{"id":"266a025fdc4d7fd4","repo":"quarkusio/quarkus","slug":"event-injection-point-can-never-be-raw-type-plea","errorCode":null,"errorMessage":"Event injection point can never be raw type - please specify the type parameter. Injection point: ","messagePattern":"Event injection point can never be raw type - please specify the type parameter\\. Injection point: ","errorType":"validation","errorClass":"DefinitionException","httpStatus":null,"severity":"error","filePath":"independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/InjectionPointInfo.java","lineNumber":158,"sourceCode":"\n    InjectionPointInfo(TypeAndQualifiers typeAndQualifiers, InjectionPointKind kind,\n            AnnotationTarget target, AnnotationTarget methodParameterTarget, boolean isTransientReference, boolean isDelegate) {\n        this.typeAndQualifiers = typeAndQualifiers;\n        this.resolvedBean = new AtomicReference<BeanInfo>(null);\n        this.targetBean = new AtomicReference<BeanInfo>(null);\n        this.kind = kind;\n        this.hasDefaultQualifier = typeAndQualifiers.qualifiers.size() == 1\n                && typeAndQualifiers.qualifiers.iterator().next().name().equals(DotNames.DEFAULT);\n        this.target = target;\n        this.methodParameterTarget = methodParameterTarget;\n        this.position = (methodParameterTarget == null || !Kind.METHOD_PARAMETER.equals(methodParameterTarget.kind())) ? -1\n                : methodParameterTarget.asMethodParameter().position();\n        this.isTransientReference = isTransientReference;\n        this.isDelegate = isDelegate;\n\n        // validation - Event injection point can never be a raw type\n        if (DotNames.EVENT.equals(typeAndQualifiers.type.name()) && typeAndQualifiers.type.kind() == Type.Kind.CLASS) {\n            throw new DefinitionException(\n                    \"Event injection point can never be raw type - please specify the type parameter. Injection point: \"\n                            + target);\n        }\n    }\n\n    void resolve(BeanInfo bean) {\n        resolvedBean.set(bean);\n    }\n\n    public BeanInfo getResolvedBean() {\n        return resolvedBean.get();\n    }\n\n    public Optional<BeanInfo> getTargetBean() {\n        return Optional.ofNullable(targetBean.get());\n    }\n\n    public void setTargetBean(BeanInfo bean) {","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/InjectionPointInfo.java#L140-L176","documentation":"An injected Event must be a parameterized type (e.g. Event<String>); a raw Event injection point cannot carry the event type, so ArC rejects it with a DefinitionException during InjectionPointInfo construction.","triggerScenarios":"Injecting raw Event, e.g. @Inject Event event; detected in the InjectionPointInfo constructor when the type is a plain CLASS named jakarta.enterprise.event.Event.","commonSituations":"Omitting generics for brevity; code migrated from pre-generics patterns; IDE quick-fixes that drop type arguments.","solutions":["Add the event type parameter: @Inject Event<MyPayload> event;","Use the raw-ignoring alternative Event<Object> if any payload is acceptable"],"exampleFix":"// before\n@Inject\nEvent event;\n// after\n@Inject\nEvent<MyEvent> event;","handlingStrategy":"validation","validationCode":"Field f = MyBean.class.getDeclaredField(\"event\");\nif (f.getType() == jakarta.enterprise.event.Event.class) {\n    throw new IllegalStateException(\"Raw Event injection: \" + f);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always parameterize Event<T> at injection points","Enable IDE raw-types warnings; treat raw generic usage as an error"],"tags":["cdi","arc","events","generics","raw-type"],"backgroundTag":"raw-generic-injection-point","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"}