Skip to content

[java] UnusedReturnValue produces inconsistent violation messages #6967

Closed

Description

@UncleOwen

Affects PMD Version: 7.27.0-SNAPSHOT

Description: UnusedReturnValue produces inconsistent violation messages. When using the code below, it produces a message like

Result of 'java.util.Collection<capture#XXX of ? extends com.puppycrawl.tools.checkstyle.checks.whitespace.whitespacearound.Wildcard[]>.size()' is ignored.

where XXX is a different integer every time.

Code Sample demonstrating the issue:

class Wildcard
{
    public static void foo(Collection < ? extends Wildcard[] > collection) {
        collection.size();
    }
}

Running PMD through: pmd-regression-tester

Activity

  1. added
    a:bug
    on Aug 11, 2026
  2. added a commit that references this issue on Aug 14, 2026
    9c4e6fd
  3. added this to the 7.27.0 milestone on Aug 15, 2026
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:bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions