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] RedundantFieldInitializer can not detect a special case for char initialize: char foo = '\0'; · Issue #2441 · pmd/pmd

[java] RedundantFieldInitializer can not detect a special case for char initialize: char foo = '\0'; #2441

New issue
Copy link
New issue
Copy link
Closed
#2677
Closed
[java] RedundantFieldInitializer can not detect a special case for char initialize: char foo = '\0';#2441
#2677
Copy link
Labels
a:false-negativePMD doesn't flag a problematic piece of code
Milestone
6.27.0

Description

@wuchiuwong
wuchiuwong
opened on Apr 25, 2020
Issue body actions

Affects PMD Version:
6.22.0

Rule:
RedundantFieldInitializer

Description:
RedundantFieldInitializer can not detect a special case for char initialize: char foo = '\0';
The reason for the undetectability is that '\0' can't convert to int directly, in value = (int) literal.getImage().charAt(1); in pmd-java-6.22.0-sources.jar!\net\sourceforge\pmd\lang\java\rule\performance\RedundantFieldInitializerRule.java_93
Code Sample demonstrating the issue:

char foo = '\0';

Expected outcome:
false-negative

Running PMD through:
CLI

Activity

  1. wuchiuwong
    added
    a:bugPMD crashes or fails to analyse a file.
    on Apr 25, 2020
  2. oowekyala
    added
    a:false-negativePMD doesn't flag a problematic piece of code
    and removed
    a:bugPMD crashes or fails to analyse a file.
    on Apr 25, 2020
  3. oowekyala
    closed this as completedin #2677on Jul 29, 2020
  4. adangel
    added this to the 6.27.0 milestone on Jul 30, 2020
  5. adangel
    changed the title [-][java]RedundantFieldInitializer can not detect a special case for char initialize: char foo = '\0';[/-] [+][java] RedundantFieldInitializer can not detect a special case for char initialize: char foo = '\0';[/+] on Jul 30, 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.27.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.