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] Add new node for anonymous class declaration · Issue #905 · pmd/pmd

[java] Add new node for anonymous class declaration #905

New issue
Copy link
New issue
Copy link
Closed
#2912
Closed
[java] Add new node for anonymous class declaration#905
#2912
Copy link
Labels
in:astAbout the AST structure or API, the parsing step
Milestone
7.0.0

Description

@oowekyala
oowekyala
opened on Feb 10, 2018
Issue body actions

Proper metrics support for anonymous classes would need anonymous class declaration to be an ASTAnyTypeDeclaration. For now though, anonymous class declarations are just AllocationExpression or ASTEnumConstant with a body, which means that if those nodes extended ASTAnyTypeDeclaration, most of the time they wouldn't be an actual type declaration.

The cleanest solution I see to preserve the type safe API of the metrics framework would be to add a child node of these nodes that's there only if they declare an anonymous class (an ASTAnonymousClassDeclaration), which contains the ASTClassOrInterfaceBody. This requires a change to the AST, and would certainly break some rules, so we can't do that before 7.0.0.

Other ideas?

Reacted by Juan Martín Sotuyo Dodero

Activity

  1. oowekyala
    added this to the 7.0.0 milestone on Feb 10, 2018
  2. jsotuyod commented on Mar 19, 2018

    @jsotuyod
    jsotuyod
    on Mar 19, 2018
    Member
    More actions

    I totally support this.

    It would also be a good chance to deprecate isAnonymousInnerClass from ASTClassOrInterfaceBody and from ASTClassOrInterfaceBodyDeclaration (neither of which should probably expose isEnumChild either).

    The find boundary would also have to be moved from ASTClassOrInterfaceBodyDeclaration to this new node type.

  3. jsotuyod
    added
    has:pr
    in:astAbout the AST structure or API, the parsing step
    on Apr 12, 2019
  4. oowekyala commented on Apr 25, 2020

    @oowekyala
    oowekyala
    on Apr 25, 2020
    MemberAuthor
    More actions

    This is implemented since #1759, now we need the following deprecations on master:

    • ASTClassOrInterfaceBody::isAnonymousInnerClass
    • ASTClassOrInterfaceBody::isEnumChild

    No deprecations planned for ASTClassOrInterfaceBodyDeclaration or ASTAllocationExpression since those nodes don't exist anymore in pmd 7

  5. oowekyala
    added a commit that references this issue on Nov 10, 2020

    Deprecations for pmd#905

    56a5ee5
  6. oowekyala
    closed this as completedin #2912on Nov 11, 2020
  7. rmohan20
    added a commit that references this issue on Dec 15, 2020

    Pulling latest changes from pmd/pmd: 12/15/2020 (#1)

    62c9b8f
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

    in:astAbout the AST structure or API, the parsing step

    Type

    No type

    Projects

    No projects

      Milestone

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