Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable warning in Eclipse - 'Class is a raw type. References to generic type Class<T> should be parameterized'

Tags:

java

eclipse

When I compile thrid-party library a number of 'should be parameterized' warnings are generated. I know how to fix them but I do not want to so I tried to disable all warning/error in Eclipse. However, the warnings are still generated after every warning/error are disable. Please help.

like image 343
neo Avatar asked Jan 06 '14 12:01

neo


2 Answers

You can add @SuppressWarnings("rawtypes") to a method, statement or method argument to suppress this warning.

As an example a common one in Eclipse plugins is:

@Override
public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter)
like image 147
greg-449 Avatar answered Sep 17 '22 23:09

greg-449


You Can change the settings in eclipse:

  1. Go to project properties -> Java Compiler -> Errors/Warnings
  2. Enable the - Enable project specific settings
  3. Change warning to ignore.
like image 25
Bosko Mijin Avatar answered Sep 18 '22 23:09

Bosko Mijin