This post was brought to you by this PMD rule.

Transcription

Why do we have this stupid code analyzer rule enabled anyway? Nobody writes code like this…

After telling them the lore why it’s there:

You have seen such things before?

11 Times, as a matter of fact

  • mmddmm@lemm.ee
    link
    fedilink
    arrow-up
    10
    ·
    5 months ago

    The GP is saying that String is a class already, you shouldn’t have to call String.class.

    Personally, I’m away from it for long enough that I don’t remember either.

      • DreamButt@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        5 months ago

        Is it simpler tho? You have to explain to someone that the Type is also an Object with the field .class on it. I feel like just saying it’s a Type and you can reference Types directly is simpler. Idk maybe I’ve been currupted by type theory too much lol