[jbosstools-dev] Warnings in Eclipse

Dmitry Geraskov dgeraskov at exadel.com
Thu May 21 06:24:47 EDT 2009


I want to remove some raw class warnings. For example such code

List list = 
doc.getRootElement().element("session-factory").elements("mapping");  
//$NON-NLS-1$ //$NON-NLS-2$
                Iterator iterator = list.iterator();
                while ( iterator.hasNext() ) {
                    Node element = (Node) iterator.next();
                    element.getParent().remove(element);
                }

will be changed to

List<Node> list = 
doc.getRootElement().element("session-factory").elements("mapping");  
//$NON-NLS-1$ //$NON-NLS-2$
                for (Node element : list) {
                    element.getParent().remove(element);
                }

But in second variant  I get type safety warning as *elements* method 
returns not parametrized generic type.

I want to remove such types warnings(not for all project, but for some 
places).


Max Rydahl Andersen пишет:
> Second hit in google 
> (http://www.google.com/search?hl=da&client=opera&rls=en&hs=drk&q=suppresswarnings&btnG=S%C3%B8g&lr=) 
>
>
> http://www.breakitdownblog.com/supported-values-for-suppresswarnings/ 
> dicsuss this and points to 
> http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.jdt.doc.isv/guide/jdt_api_compile.htm 
>
>
> But what warnings are you trying to remove ? SuppresWarnings is to be 
> avoided unless really called for ;)
>
> /max
>
> Dmitry Geraskov wrote:
>> Hi, folks,
>>
>> anybody know how to explore warning name in eclipse which can be used 
>> @SuppressWarnings annotation?
>>
>> Thanks 

-- 
Best regards,

 Dmitry Geraskov              
 dgeraskov at exadel.com
 Senior Developer
 Exadel Inc




More information about the jbosstools-dev mailing list