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: False negative for methods returning Strings · Issue #2569 · pmd/pmd

[java] LiteralsFirstInComparisons: False negative for methods returning Strings #2569

New issue
Copy link
New issue
Copy link
Closed
#2651
Closed
[java] LiteralsFirstInComparisons: False negative for methods returning Strings#2569
#2651
Copy link
Labels
a:false-negativePMD doesn't flag a problematic piece of code
Milestone
6.26.0

Description

@linusjf
linusjf
opened on Jun 6, 2020
Issue body actions

Affects PMD Version:
6.24.0

Description:

Rule LiteralsFirstInComparisons does not flag the following :

package com.javacodegeeks.patterns.chainofresponsibility;

public class ImageFileHandler implements Handler {
    @Override
  public void process(File file) {
    if (file.getFileType().equals("image")) { // violation expected
      System.out.println("Process and saving image file... by ");
      return;
    }
  }

}

Running PMD through: [CLI | Ant ]

Activity

  1. linusjf
    added
    a:bugPMD crashes or fails to analyse a file.
    on Jun 6, 2020
  2. linusjf
    changed the title [-][Java] False negative for rule LiteralsFirstInComparisons for methods returning String objects. [/-] [+][Java] False negative: Rule LiteralsFirstInComparisons for methods returning String objects. [/+] on Jun 6, 2020
  3. adangel
    changed the title [-][Java] False negative: Rule LiteralsFirstInComparisons for methods returning String objects. [/-] [+][java] False negative: LiteralsFirstInComparisons for methods returning Strings[/+] on Jun 9, 2020
  4. adangel
    added
    a:false-negativePMD doesn't flag a problematic piece of code
    on Jun 9, 2020
  5. adangel
    removed
    a:bugPMD crashes or fails to analyse a file.
    on Jul 17, 2020
  6. adangel
    added this to the 6.26.0 milestone on Jul 23, 2020
  7. adangel
    changed the title [-][java] False negative: LiteralsFirstInComparisons for methods returning Strings[/-] [+][java] LiteralsFirstInComparisons: False negative for methods returning Strings[/+] on Jul 23, 2020
  8. adangel
    closed this as completedin 7b1ccf4on Jul 23, 2020
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.26.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.