Commons Lang
  1. Commons Lang
  2. LANG-751

Include the actual type in the Validate.isInstance and isAssignableFrom exception messages.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.1
    • Fix Version/s: 3.1
    • Component/s: lang.*
    • Labels:
      None
    • Environment:

      Description

      The message for the exception thrown by Validate.isInstance and isAssignableFrom do not mention the actual type, only the expected type.

      trunk: "The validated object is not an instance of %s"

      Proposal:

      • isAssignableFrom: "Cannot assign a java.lang.String to a java.util.List"
      • isInstance: "Expected type: java.util.List, actual: java.lang.String"

        Activity

        Gary Gregory created issue -
        Gary Gregory made changes -
        Field Original Value New Value
        Summary Include the actual type in the Validate.isInstance exception message. Include the actual type in the Validate.isInstance and isAssignableFrom exception messages.
        Gary Gregory made changes -
        Description The message for the exception thrown by Validate.isInstance does not mention the actual type, only the expected type.

        trunk: "The validated object is not an instance of %s"

        Proposal, a la JUnit: "Expected type: %s, actual: %"
        The message for the exception thrown by Validate.isInstance and isAssignableFrom do not mention the actual type, only the expected type.

        trunk: "The validated object is not an instance of %s"

        Proposal:

        - isAssignableFrom: "Cannot assign a java.lang.String to a java.util.List"
        - isInstance: "Expected type: java.util.List, actual: java.lang.String"
        Gary Gregory made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Gary Gregory
            Reporter:
            Gary Gregory
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development