简体   繁体   中英

Suppress warnings for missing @Override annotation in Eclipse

I have warnings for the missing @Override annotation enabled by default in Eclipse, but for a couple of classes I'd rather have it disabled.

Is there a way to do this? Intuitively one would expect something like @SuppressWarnings("override") but that is of course not supported.

In eclipse -> windows -> preferences , select java -> compiler -> Errors/warnings

type override in the search bar then for "missing @overriden annotation" set level to ignore.

在此处输入图片说明

You should annotate all methods with @Override

or when you don´t want to annotate with this annotation, than you should edit compiler settings in

eclipse to not show a warning when you don´t annotate with @Override.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM