Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling warnings in my Java Eclipse Project for just a couple of files. Is it possible?

I am using a code generator that generates code that raises thousands of warnings just as

ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized    Parser.java

I'd like to know how to turn off specific kinds of warnings in specific files. I'd like to still have these kinds of warnings on other files of mine.

Is it possible to accomplish this?

Thanks

like image 880
devoured elysium Avatar asked Dec 27 '22 16:12

devoured elysium


2 Answers

At least in Eclipse Kepler, it is possible to switch off warnings per directory. In the package explorer, right click on the directory, then choose

Properties -> Java Compiler -> Ignore optional compile problems

I assume that this switches off other warnings as well - but for generated code, these have to be fixed by changing the generator anyway.

like image 150
Rudi Avatar answered Dec 30 '22 07:12

Rudi


You can as well create working sets for the two sets 1>generated files and 2> code written by you. Then you can select to view warnings pertaining to the working set which ever you like . ScreenShot

On the top right corner of eclipse problem tab you can see one down arrow click on that, and select configure contents one more window shall open up where in you can configure to view warnings of desired working set. alternatively you could select show >show warnings & errors on selection. Now when you select the working set respective warnings will only be shown

like image 43
Ravisha Avatar answered Dec 30 '22 05:12

Ravisha