Community
Participate
Working Groups
Use case : I'm using Hibernate, the abstract @Entity class "Pet" cannot be casted to its child "Cat" due to Hibernate proxies : Pet felix = ....; if (felix instanceOf Cat) { // will always be false Cat cat = (Cat) felix; // will fail anyway } To avoid such error in code, I'd like to create an aspect to detect use of instanceOf with a class that is annotated with @Entity, and also to detect a cast to an @Entity annotated type. Such joinpoint cannot be expressed with aspectj pointcut syntax (AFAIK). Please improve the grammar and compiler to support this use case.