RFR JDK-8198253: ThreadInfo.from(CompositeData) assigning fields incorrectly in JDK 9

Daniel Fuchs daniel.fuchs at oracle.com
Wed Feb 28 11:07:04 UTC 2018


Hi Mandy,

This looks very good.

In the API documentation of ThreadInfo::from, below the table
that lists the attributes of StackTraceElement, I wonder if the
following text should be added for completeness:

```A CompositeData representing a MonitorInfo of version N must contain 
a lockedStackTrace attribute that is either null if stackDepth  < 0, or 
is a CompositeData representing a StackTraceElement of version N.```

What do you think?

best regards,

-- danie

On 27/02/2018 20:31, mandy chung wrote:
> I made further edits to the javadoc and I am happy with this version 
> (move out the attributes for StackTraceElement as a separate table).
> 
> Specdiff:
> http://cr.openjdk.java.net/~mchung/jdk11/webrevs/8198253/specdiff/overview-summary.html
> 
> javadoc:
> http://cr.openjdk.java.net/~mchung/jdk11/webrevs/8198253/api/java/lang/management/
> 
> Webrev:
> http://cr.openjdk.java.net/~mchung/jdk11/webrevs/8198253/webrev.02/
> 
> Mandy
> 
> On 2/27/18 10:55 AM, mandy chung wrote:
>> Good point, Jeremy.  I notice some strange-ness when I wrote it but
>> wasn't able to pin point the error.  Daniel also suggests to clarify
>> MonitorInfo as well.
>>
>> Does this version look better?
>>   
>>
>>       * Returns a {@code ThreadInfo} object represented by the
>>       * given {@code CompositeData}.
>>       * <a id="attributes"></a>
>>       * A {@code CompositeData} representing a {@code ThreadInfo} of
>>       * version <em>N</em> must contain all of the attributes defined
>>       * in version ≤ <em>N</em> unless specified otherwise.
>>       * Same rule applies transitively to attributes whose type or
>>       * component type is {@code CompositeType}.
>>       * <p>
>>       * A {@code CompositeData} representing {@code ThreadInfo} of version
>>       * <em>N</em> contains {@code "stackTrace"} attribute representing
>>       * an array of {@code StackTraceElement} of version <em>N</em>.
>>       * The {@code "lockedMonitors"} attribute represents
>>       * an array of {@link MonitorInfo} of version <em>N</em>
>>       * which implies that its {@code "lockedStackFrame"} attribute also
>>       * represents {@code StackTraceElement} of the same version, <em>N</em>.
>>       * Otherwise, this method will throw {@code IllegalArgumentException}.
>>
>> Mandy
> 



More information about the serviceability-dev mailing list