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] UnnecessaryBoxing false positive when calling `List.remove(int)` · Issue #5948 · pmd/pmd

[java] UnnecessaryBoxing false positive when calling List.remove(int) #5948

New issue
Copy link
New issue
Copy link
Closed
#5971
Closed
[java] UnnecessaryBoxing false positive when calling List.remove(int)#5948
#5971
Copy link
Labels
a:false-positivePMD flags a piece of code that is not problematic
Milestone
7.17.0

Description

@UncleOwen
UncleOwen
opened on Jul 29, 2025
Issue body actions

Affects PMD Version: 7.16.0

Rule: https://pmd.github.io/pmd/pmd_rules_java_codestyle.html#unnecessaryboxing

Description: The following code triggers UnnecessaryBoxing. If I remove the call to .intValue(), the wrong overload of ArrayList.remove() is called.

Code Sample demonstrating the issue:

        List<String> l = new ArrayList<>();
        Integer i = 3;

        l.remove(i.intValue());

Expected outcome:

No violation

Running PMD through: IntelliJ-Plugin

Activity

  1. UncleOwen
    added
    a:false-positivePMD flags a piece of code that is not problematic
    on Jul 29, 2025
  2. adangel
    changed the title [-][java] False Positive in UnnecessaryBoxing[/-] [+][java] UnnecessaryBoxing false positive when calling `List.remove(int)`[/+] on Jul 31, 2025
  3. adangel
    added this to the 7.17.0 milestone on Aug 8, 2025
  4. adangel
    closed this as completedin #5971on Aug 8, 2025
  5. adangel
    added a commit that references this issue on Aug 8, 2025

    Fix #5948: [java] UnnecessaryBoxingRule: Check if unboxing is require…

    This issue will close once commit 64ef399 is merged into the 'main' branch.
    64ef399
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-positivePMD flags a piece of code that is not problematic

    Type

    No type

    Projects

    No projects

      Milestone

      • 7.17.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.