Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » SuppressWarnings unchecked Vs rawtypes and suppressRawWhenUnchecked(Problems on make suppressRawWhenUnchecked flag working for old code)
SuppressWarnings unchecked Vs rawtypes and suppressRawWhenUnchecked [message #1751128] Wed, 04 January 2017 17:14
Adriano Serio is currently offline Adriano SerioFriend
Messages: 8
Registered: May 2011
Location: Milan, IT
Junior Member
Hi all!
Recently I bought a new PC, so I wanted to start using a new Eclipse version (Neon).
Previously I had a very, very old version (Ganymede!).

The problem is the fact that on new versions (maybe from Helios) the @SuppressWarnings("unchecked") works no more for Raw Types warnings.
Actually I would like to prevent this kind of warnings, but doesn't depend on me. So I must suppress them.

I also would like to change all SuppressWarnings from "unchecked" into "rawtypes". But also this doesn't depend on me!
So my only option would be to restore backward compatibility with old code, which uses @SuppressWarnings("unchecked") for raw types.

From a deep search over Internet, there would be the property suppressRawWhenUnchecked=true to be set before Eclipse start. And which should should guarantee me backwards compatibility.

I tried various ways found over Internet to implement it, but none worked.
- I put -DsuppressRawWhenUnchecked=true into Windows desktop shortcut's path.
- I put -DsuppressRawWhenUnchecked=true into eclipse.ini
- I put org.eclipse.jdt.core.compiler.problem.suppressRawWhenUnchecked=true into org.eclipse.core.resources.prefs

None of those solutions worked.
So it's me setting that property the wrong way?
Or maybe, as I'm suspecting, it works no more into Neon version?

Do I have any hope to have backward compatibility with such old code I must work on and which uses @SuppressWarnings("unchecked") over Raw Types as for the (very) old Eclipse versions we used into our project up to now?

Thank you all!
Previous Topic:groovy script - create Hashmap as global variable
Next Topic: the worst
Goto Forum:

Current Time: Mon May 21 22:54:36 GMT 2018

Powered by FUDForum. Page generated in 0.01446 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top