Skip to content

Java hint Raw Types does not provide action to suppress the warning #9444

Closed

Description

@nmatt

Apache NetBeans version

Apache NetBeans 30

What happened

The Java hint for Raw Types (Options > Editor > Hints > Java > Standard Javac Warnings > Raw Types) does not provide an action to add @SuppressWarnings("rawtypes") like NetBeans does for other standard javac warnings.

Language / Project Type / NetBeans Component

Java, Hints

How to reproduce

Example (appears similarly in java.util.Collections):

    @SuppressWarnings("unchecked")
    public static void swap(List<?> list, int i, int j) {
        List raw = list;
        raw.set(i, raw.set(j, raw.get(i)));
    }

NetBeans shows the warning hint "found raw type: List" on the declaration of raw, but does not propovide an action to add @SuppressWarnings("rawtypes").

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows

JDK

JDK 21

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

No response

Are you willing to submit a pull request?

No

Activity

  1. added
    kind:bug
    needs:triage
    on Jun 16, 2026
  2. added
    Java
    on Jun 17, 2026
  3. mbien commented on Jun 17, 2026

    @mbien
    Member

    hmm. adding

            map.put("compiler.warn.raw.class.use", "rawtypes");  // NOI18N

    to

    would work. I am not certain if this is the correct way of fixing this though. cc @lahodaj

  4. removed
    needs:triage
    on Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Javahintskind:bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions