Skip to content

Allow "found raw type" to upgrade to an error - Do not allow raw types #1799

@eraneverlaw

Description

@eraneverlaw

Description of the problem / feature request:

The Java compiler issues "found raw type" warnings when a generic type is used without providing actual generic type arguments. (i.e. opting out of generics)
It would be nice if Error Prone had its own warning for this, that more importantly, can be upgraded to an error, and so prevent new code from using raw types.

Feature requests: what underlying problem are you trying to solve with this feature?

It's been about 16 years since Java introduced generics. It was always recommended to avoid using raw types in new code. The only reason it allowed raw types was for backwards comparability with pre-generics written code.
Yet programmers still to this day write NEW code that uses raw types, either by mistake, or due to laziness, or ignorance of the importance of always using actual generic arguments. It would be nice to enforce this, mostly so the code is cleaner, more consistent, less confusing, does not generate warnings (that are ignored,) and of course, more type-safe.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

List stuff;

What version of Error Prone are you using?

2.3.4

Have you found anything relevant by searching the web?

No.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions