GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [java] LiteralsFirstInComparisons should consider constant fields · Issue #575 · pmd/pmd

[java] LiteralsFirstInComparisons should consider constant fields #575

New issue
Copy link
New issue
Copy link
Closed
#2983
Closed
[java] LiteralsFirstInComparisons should consider constant fields#575
#2983
Copy link
Labels
a:false-negativePMD doesn't flag a problematic piece of code
Milestone
6.31.0

Description

@JJengility
JJengility
opened on Aug 22, 2017
Issue body actions

Rule: PositionLiteralsFirstInComparisons (deprecated), PositionLiteralsFirstInCaseInsensitiveComparisons (deprecated) and LiteralsFirstInComparisons

Description: (Position)LiteralsFirstInComparisons do not appear to be properly checking this rule completely, perhaps due to use of constants or some other factor

Code Sample demonstrating the issue:

private static final String ABOVE_CORE = "Above-Core";
if (abc.getOm() == 1 && abc.getCore().equals(ABOVE_CORE)) {

Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]

Activity

  1. jsotuyod
    added
    a:false-negativePMD doesn't flag a problematic piece of code
    on Aug 22, 2017
  2. jsotuyod commented on Aug 22, 2017

    @jsotuyod
    jsotuyod
    on Aug 22, 2017
    Member
    More actions

    @JJengility very interesting! Thanks for the report!

  3. oowekyala
    changed the title [-][java] PositionLiteralsFirstInComparisons not checking correctly[/-] [+][java] PositionLiteralsFirstInComparisons should consider constant fields[/+] on Nov 10, 2020
  4. adangel
    changed the title [-][java] PositionLiteralsFirstInComparisons should consider constant fields[/-] [+][java] LiteralsFirstInComparisons should consider constant fields[/+] on Jan 7, 2021
  5. adangel
    added this to the 6.31.0 milestone on Jan 7, 2021
  6. adangel
    closed this as completedin f8e4912on Jan 7, 2021
  7. adangel
    closed this as completedin #2983on Jan 7, 2021
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

    a:false-negativePMD doesn't flag a problematic piece of code

    Type

    No type

    Projects

    No projects

      Milestone

      • 6.31.0

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.