Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8198732

ThreadInfo.from(CompositeData) does not throw IAE when the given CompositeData with missing attributes

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 11
    • Component/s: core-svc
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      low
    • Compatibility Risk Description:
      Hide
      The implementation will throw IAE if the given CompositeData is invalid while
      it might be accepted in the current release.

      ThreadInfo and StackTraceElement in JDK 9 added a couple new attributes.
      Typically CompositeData for ThreadInfo is generated by JMX API and is valid.
      An invalid CompositeData would be one with the new daemon and
      priority attributes but missing JDK 6 attributes. Such invalid CompositeData
      would only be generated manually for example for testing.

      So the compatibility risk is low.
      Show
      The implementation will throw IAE if the given CompositeData is invalid while it might be accepted in the current release. ThreadInfo and StackTraceElement in JDK 9 added a couple new attributes. Typically CompositeData for ThreadInfo is generated by JMX API and is valid. An invalid CompositeData would be one with the new daemon and priority attributes but missing JDK 6 attributes. Such invalid CompositeData would only be generated manually for example for testing. So the compatibility risk is low.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      ThreadInfo::from should throw IAE when the given CompositeData does not contain all the attributes specified for ThreadInfo of a specific version.

      Problem

      ThreadInfo::from accepts CompositeData representing ThreadInfo of the current and earlier release. This method intends to validate the given CompositeData and throw IAE if it does not represent a valid ThreadInfo. For example, lockedSynchronizers and lockedMonitors must be present if it represents JDK 6 or 9 ThreadInfo. The spec needs clarification. In addition while fixing this issue, stackTrace attribute represents StackTraceElement but the spec is missing classLoaderName attribute.

      Solution

      Update the spec of ThreadInfo::from method to specify the release of each attribute was defined. A valid CompositeData representing a ThreadInfo of version N must contain all the attributes defined <= N. Same rule applies transitively to
      attributes whose type or component type is CompositeType.

      Specification

      See attached specdiff.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mchung Mandy Chung
                Reporter:
                jmanson Jeremy Manson
                Reviewed By:
                Daniel Fuchs
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: