QDox
  1. QDox
  2. QDOX-176

Add method to safely & easily get the package name for a JavaClass

    Details

    • Type: Wish Wish
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.2
    • Fix Version/s: 1.10
    • Component/s: Java API
    • Labels:
      None
    • Patch Submitted:
      Yes
    • Number of attachments :
      1

      Description

      The impl of JavaClass.getFullyQualifiedName() suggests that the return value of JavaClass.getPackage() can be null which makes getting the package name for a class a cumbersome operation. The attached patch adds a new method getPackageName() that handles potential null and safes the caller from those boring checks.

        Activity

        Hide
        Robert Scholte added a comment -

        Patch has been applied, added some javadoc and an extra test to check the handling of default packages. Thanks Benjamin.

        Show
        Robert Scholte added a comment - Patch has been applied, added some javadoc and an extra test to check the handling of default packages. Thanks Benjamin.
        Robert Scholte made changes -
        Field Original Value New Value
        Assignee Robert Scholte [ rfscholte ]
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Fix Version/s 1.10 [ 15020 ]

          People

          • Assignee:
            Robert Scholte
            Reporter:
            Benjamin Bentmann
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: