4

I have a Spring Bean obtained from a factory, say,

private ObjectFactory<GoodStudent> studentFactory;

public void somemethod() {
    IStudent astudent = studentFactory.getObject();
    System.out.println(astudent instanceof GoodStudent); // prints false.
}

Does this happen because of Aspects? Because, I have a method in GoodStudent that is augmented using Aspects(around aspect), like,

public class GoodStudent implements IStudent { ...
    @UsesAspect
    public void logStudent() {....}

Is this a limitation in Spring or am I missing something?

Note : System.out.println(astudent instanceof IStudent); // prints true

zapl
  • 63,179
  • 10
  • 123
  • 154
Antho Christen
  • 1,369
  • 1
  • 10
  • 21

0 Answers0