No, there is no pre-defined Java annotation that is the inverse of @Override
.
Having said that, most IDE's should be able to identify if a method is overriding another. For instance Eclipse has this feature. If you look at your class in Outline view, you'll see a small triangle where overrides occur. For example:
I have to believe that NetBeans and IntelliJ Idea must have similar functionality.
As an aside, this problem that you're trying to address, that of avoiding inadvertently overriding a parent method, is a serious and pernicious one, one that has an especially elevated risk when extending classes that have many methods or a large inheritance hierarchy (think Swing components as an example -- I once had a majorly frustrating GUI bug due to my tripping over accidentally overriding JPanel's getX()
and getY()
methods). This is another reason to in general prefer composition over inheritance if composition makes sense in the situation.