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 — [apex] MethodWithSameNameAsEnclosingClass: Violation range should only cover the method name · Issue #5906 · pmd/pmd

[apex] MethodWithSameNameAsEnclosingClass: Violation range should only cover the method name #5906

New issue
Copy link
New issue
Copy link
Closed
#7264
Closed
[apex] MethodWithSameNameAsEnclosingClass: Violation range should only cover the method name#5906
#7264
Copy link
Labels
a:bugPMD crashes or fails to analyse a file.
Milestone
7.30.0

Description

@stephen-carter-at-sf
stephen-carter-at-sf
opened on Jul 14, 2025
Issue body actions

Rule: MethodWithSameNameAsEnclosingClass

Description:

When running PMD against any apex file that contains a method name is the same as the parent class, then the MethodWithSameNameAsEnclosingClass violation is found correctly, but its line and column information contains all the lines of the method. This makes for a very noisy experience inside of tools that integrate with PMD (like the Salesforce Code Analyzer VS Code Extension). Instead, this rule should give a range that is just the name of the method only.

Activity

  1. stephen-carter-at-sf
    added
    a:bugPMD crashes or fails to analyse a file.
    on Jul 14, 2025
  2. adangel
    changed the title [-][apex] MethodWithSameNameAsEnclosingClass violation range should only be the method name and not all the lines of the method[/-] [+][apex] MethodWithSameNameAsEnclosingClass: Violation range should only cover the method signature[/+] on Nov 20, 2026
  3. adangel
    changed the title [-][apex] MethodWithSameNameAsEnclosingClass: Violation range should only cover the method signature[/-] [+][apex] MethodWithSameNameAsEnclosingClass: Violation range should only cover the method name[/+] on Nov 20, 2026
  4. adangel
    added this to the 7.30.0 milestone on Nov 21, 2026
  5. adangel
    closed this as completedin f0807ceon Nov 21, 2026
  6. adangel
    added a commit that references this issue on Nov 21, 2026

    [apex] Fix pmd#5906: MethodWithSameNameAsEnclosingClass violation ran…

    This issue will close once commit f0807ce is merged into the 'main' branch.
    f0807ce
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:bugPMD crashes or fails to analyse a file.

    Type

    No type

    Projects

    No projects

      Milestone

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