1

I've found this @Stateless annotation in some code like:

public Interface A

@Stateless
public abstract class B implements A

public class C extends B

public class D extends B

But Intellij is then saying B shouldn't be declared as abstract. Is Intellij right here and the Stateless is not actually propagated to the classes extending B and I'd have to declare them as Stateless or C, D are properly set as Stateless?

1 Answers1

3

You need to add Stateless in all subclasses too.

Take a look at this: Inheriting class annotations

Only the annotations annotated with @Inherited are propagated https://www.logicbig.com/tutorials/core-java-tutorial/annotations/inherited-meta-annotation.html

michid
  • 10,536
  • 3
  • 32
  • 59