---
title: 'Eclipse 3.5 zu Eclipse 3.6 –> @SuppressWarnings("unchecked") und @SuppressWarnings("rawtypes")'
url: 'https://tutego.de/blog/javainsel/2010/12/eclipse-3-5-zu-eclipse-3-6-suppresswarningsunchecked-und-suppresswarningsrawtypes'
markdown: 'https://tutego.de/blog/javainsel/2010/12/eclipse-3-5-zu-eclipse-3-6-suppresswarningsunchecked-und-suppresswarningsrawtypes.md'
date: '2010-12-12'
description: 'Von Punkt 3: @SuppressWarnings("unchecked") does not ignore raw types warnings anymore What is affected: Usage of @SuppressWarnings("unchecked"). Description: Up to Eclipse 3.5, @SuppressWarnings("unchecked") was used to suppress the unchecked and raw types warnings. This was not consistent with o…'
taxonomy:
  category:
    - Entwicklungsumgebung
    - '@SuppressWarnings'
    - Eclipse
---

# Eclipse 3.5 zu Eclipse 3.6 –> @SuppressWarnings("unchecked") und @SuppressWarnings("rawtypes")

![Illustration einer tropischen Insel mit Palmen und einem hohen Berg](https://tutego.de/blog/javainsel/user/themes/tutego/images/insel-cover.jpg)# Java Blog für Programmierer

[Java Blog für Programmierer](https://tutego.de/blog/javainsel/)

## Eclipse 3.5 zu Eclipse 3.6 –> @SuppressWarnings("unchecked") und @SuppressWarnings("rawtypes")

12.12.2010 · [Christian Ullenboom](https://tutego.de/blog/javainsel/author/admin/)

Von Punkt 3:

#### `@SuppressWarnings("unchecked")` does not ignore raw types warnings anymore

**What is affected:** Usage of `@SuppressWarnings("unchecked")`.

**Description:** Up to Eclipse 3.5, `@SuppressWarnings("unchecked")` was used to suppress the unchecked and raw types warnings. This was not consistent with other compilers (e.g. javac). A new warning token `"rawtypes"` has been added to cover the case of raw type warnings exclusively. So in order to get rid of all warnings, in Eclipse 3.6, it might be required to add `"rawtypes"` in the warning token list.

If it is not possible to update the code, a system property (`-DsuppressRawWhenUnchecked=true`) can be added to the `-vmargs` list on startup. This preserves the old behavior. The projects need to be manually cleaned and rebuilt after toggling the property.

**Action required:** When new warnings that were previously ignored are now reported, add `"rawtypes"` to the list of warning tokens.

Before:

```java
@SuppressWarnings("unchecked")
    void bar(List list) {
        List ls2 = list;
    }
@SuppressWarnings("unchecked")
private List l;
```

After:

```java
@SuppressWarnings({"unchecked", "rawtypes"})
    void bar(List list) {
        List ls2 = list;
    }
@SuppressWarnings("rawtypes")
private List l;
```

Kategorien: [Entwicklungsumgebung](https://tutego.de/blog/javainsel/category/entwicklungsumgebung/), [@SuppressWarnings](https://tutego.de/blog/javainsel/category/suppresswarnings/), [Eclipse](https://tutego.de/blog/javainsel/category/eclipse/)

[← Alle Beiträge](https://tutego.de/blog/javainsel/)

---

## Navigation

- Previous: [Thema der Woche: Java Puzzlers](https://tutego.de/blog/javainsel/2010/12/thema-der-woche-java-puzzlers.md)
- Next: [In Java 7 neuer java.exe-Schalter zur Ausgabe von Einstellungen](https://tutego.de/blog/javainsel/2010/12/in-java-7-neuer-java-exe-schalter-zur-ausgabe-von-einstellungen.md)
