java - javac -Xlint:overrides not working -


i'm trying java build fail when have class overrides superclass method without specifying @override annotation.

the build being done via ant, , i've added following elements <javac> task:

<compilerarg value="-werror"/> <compilerarg value="-xlint:unchecked,overrides"/> 

the unchecked option being followed, overrides option being ignored. tried separating 2 xlint options 2 separate <compilerarg> elements, no avail. misunderstanding option does?

one note: jdk6 on macosx (10.6). running osx-specific bug?

i believe misunderstanding xlint:overrides behaviour.

to knowledge, enabling check cause compiler emit warnings (or maybe errors) when encounters method annotated @override not override superclass method. not, however, check overridden methods annotated correctly.

edit: tested it. compiler emit error when specify @override on method not override superclass method, or without xlint option.

the documentation on oracle's website doesn't mention xlint:overrides option i'm guessing it's not implemented.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -