I am trying to give a default implementation to Methods declared by java.lang#Object. Here is an MCVE for the problem I encounter. In the interface IAspect I declare an equals Method. In the implementation of this class I define it as always false. So in theory the main method of the example should output false but it outputs true. When decompiling the class said method is not there. I know that the project setup works since for the other Method in the interface AspectJ correctly generates the needed code. Is it even possible to do this with Annotations? I usually wrote my AspectJ code with the AspectJ-Syntax. Which worked as intended with no flaws. But I am not sure if I am able to extract the AspectJ code in a seperate library like in my MCVE if I use the AspectJ-Syntax.
So my actual questions:
- Is it possible to give default implementations to non abstract Methods that are inherited from other Classes and not an interface that defines the Aspects?
- Is it possible to use AspectJ-Syntax in a library and add this library as AspecJ-Dependency so that my code still uses the externally defined aspects?
Depending on the answers I will decide how to further progress.