Skip to content

Inspector: remove redundant Java package prefixes #242

Closed
@vemv

Description

@vemv

When inspecting classes, often all fields/methods/... are prefixed with the fully-qualified class name.

Example:

Name: com.corp.Dog
Class: java.lang.Class

--- Interfaces:
  java.io.Serializable
  java.lang.Cloneable
  java.lang.Comparable
  org.apache.thrift.TBase

--- Constructors:
  public com.corp.Dog()
  public com.corp.Dog(com.corp.Dog)

--- Fields:
  public boolean com.corp.Dog.isTopStylist
  public static final java.util.Map com.corp.Dog.metaDataMap
  public java.lang.String com.corp.Dog.sub

--- Methods:
  public void com.corp.Dog.clear()
  public int com.corp.Dog.compareTo(java.lang.Object)
  public int com.corp.Dog.compareTo(com.corp.Dog)

This is particularly ugly in com.corp.Dog.isTopStylist - there isn't an actual thing named com.corp.Dog.isTopStylist - it's isTopStylist so removing the prefix would be both more readable and more correct.

There may be cases where there's a legit use case for rendering a prefix - I'm thinking interface implementation or method inheritance.

Even then, I believe the right thing would be to render the short name, and provide any extra info when going down that particular method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement to an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions