dubreuia / intellij-plugin-save-actions

Supports configurable, Eclipse like, save actions, including "organize imports", "reformat code" and "rearrange code".
MIT License
531 stars 101 forks source link

Annotation SuppressWarnings is removed although not unused #374

Open vb-chris opened 3 years ago

vb-chris commented 3 years ago

Describe the bug The following @SuppressWarnings annotations are removed by the plugin when the option Remove unused warning annotation is enabled:

interface Bag<T> { 
  @SuppressWarnings("unchecked")
  void add(T... elements); 
}

abstract class AbstractBag<T> {
  @SuppressWarnings("unchecked")
  abstract void add(T... elements);
}

The annotations are required to suppress a warning about possible heap pollution (see IDEA-270345 for details).

What triggered the plugin CTRL+SHIFT+S

Versions Save Actions 2.2.0

IntelliJ IDEA 2020.3 (Ultimate Edition) Build #IU-203.5981.155, built on November 30, 2020 Runtime version: 11.0.9+11-b1145.21 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 10 10.0

vb-chris commented 3 years ago

Possible duplicate of https://github.com/dubreuia/intellij-plugin-save-actions/issues/87