Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • asm asm
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 2
    • Issues 2
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • asmasm
  • asmasm
  • Issues
  • #317972
Closed
Open
Issue created Apr 03, 2022 by toadstreet@toadstreet

ClassVisitor inner class and outer class documentation confusing

Expected Behavior

The documentation on ClassVisitor.visitInnerClass should mention it is a few inner class relations observed by this class. For instance, classes that use invokedynamic instructions compiled by javac usually have the MethodHandles.Lookup described as a nested class (static inner class) of MethodHandles upon inspection by javap.

It should also mention that the member classes and the enclosing class of this class, if any, must be described in this attribute per JVMS 18 - 4.7.6.

The documentation for ClassVisitor.visitOuterClass should state it is only called for anonymous or local classes, which are defined in method bodies or initializers. In addition, if the class is defined in an initializer, then the name and descriptor will be null. It is not called for instance inner or nested classes, i.e. classes that are direct members of other classes. Refer to JVMS 18 - 4.7.7.

Current Behavior

The documentation for ClassVisitor.visitInnerClass fails to ask users to supply all the member classes and the enclosing class relations of this class.

The documentation for ClassVisitor.visitOuterClass fails to mention that it should only be called for anonymous or local classes (i.e. classes defined in method bodies or initializers in source code), and null method name and descriptors mean the class is defined in an initializer as opposed to a regular method.

Notes

In addition, the documentations for the tree API, such as ClassNode, should be updated simultaneously.

Assignee
Assign to
Time tracking