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] ArrayIsStoredDirectly should report the assignment rather than formal parameter · Issue #3929 · pmd/pmd

[java] ArrayIsStoredDirectly should report the assignment rather than formal parameter #3929

New issue
Copy link
New issue
Copy link
Closed
#3930
Closed
[java] ArrayIsStoredDirectly should report the assignment rather than formal parameter#3929
#3930
Copy link
Labels
an:enhancementAn improvement on existing features / rules
Milestone
6.45.0

Description

@adangel
adangel
opened on Apr 21, 2022
Issue body actions

Is your feature request related to a problem? Please describe.
The rule ArrayIsStoredDirectly reports the formal parameter of the method / constructor which is an array and which is stored directly.

It would be more useful, if the rule reported where the array is stored.

Example:

public class ExampleAISD { 

    public String[] strs;

    public void func(String[] strs, boolean flag) { // line 5
        if (flag) {
            this.strs = strs; // line 7
        }
    }
}

Instead of line 5, line 7 should be reported.

Describe the solution you'd like

Report the assignment node instead.

Describe alternatives you've considered
None.

Additional context
See #3879 for original request

Activity

  1. adangel
    added
    an:enhancementAn improvement on existing features / rules
    on Apr 21, 2022
  2. adangel
    added this to the 6.45.0 milestone on Apr 21, 2022
  3. adangel
    added a commit that references this issue on Apr 21, 2022

    [java] ArrayIsStoredDirectly - report assignment rather than formal p…

    This issue will close once commit f27c645 is merged into the 'main' branch.
    f27c645
  4. adangel
    closed this as completedin #3930on Apr 28, 2022
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

    an:enhancementAn improvement on existing features / rules

    Type

    No type

    Projects

    No projects

      Milestone

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