<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,<div><br></div><div>seems with the change for </div><div><br></div><div>8198253: ThreadInfo.from(CompositeData) incorrectly accepts CompositeData with missing JDK 6 attributes</div><div><br></div><div>ThreadInfoCompositeData.compositeType()  was broken. It just returns</div><div><br></div><div><div>    public static CompositeType compositeType() {</div><div>        return ThreadInfoCompositeTypes.compositeTypes.get(0);</div><div>    }</div><div><br></div><div>while ThreadInfoCompositeTypes.compositeTypes consists of             </div><div><br></div><div>            types.put(CURRENT, ctype);</div><div>            types.put(5, initV5CompositeType(ctype));</div><div>            types.put(6, initV6CompositeType(ctype));</div><div><br></div><div>so that compositeType just returns null, which further down the stack leads to</div><div><br></div><div><pre class="gmail-code-java" style="margin-top:0px;margin-bottom:0px;padding:0px;max-height:30em;overflow:auto;white-space:pre-wrap;word-wrap:normal;color:rgb(51,51,51);font-size:12px"><span class="gmail-code-object" style="color:rgb(0,0,145)"></span><span class="gmail-code-object" style="color:rgb(0,0,145)"></span><span class="gmail-code-keyword" style="color:rgb(145,0,145)"></span></pre><pre class="gmail-code-java" style="margin-top:0px;margin-bottom:0px;padding:0px;max-height:30em;overflow:auto;white-space:pre-wrap;word-wrap:normal;color:rgb(51,51,51);font-size:12px"><span class="gmail-code-object" style="color:rgb(0,0,145)"></span><span class="gmail-code-object" style="color:rgb(0,0,145)"></span><span class="gmail-code-keyword" style="color:rgb(145,0,145)"></span></pre></div><div><pre class="gmail-code-java" style="margin-top:0px;margin-bottom:0px;padding:0px;max-height:30em;overflow:auto;white-space:pre-wrap;word-wrap:normal;color:rgb(51,51,51);font-size:12px"><span class="gmail-code-object" style="color:rgb(0,0,145)"></span><span class="gmail-code-object" style="color:rgb(0,0,145)"></span><span class="gmail-code-keyword" style="color:rgb(145,0,145)"></span></pre><pre class="gmail-code-java" style="margin-top:0px;margin-bottom:0px;padding:0px;max-height:30em;overflow:auto;white-space:pre-wrap;word-wrap:normal;color:rgb(51,51,51);font-size:12px"><span class="gmail-code-object" style="color:rgb(0,0,145)"></span><span class="gmail-code-object" style="color:rgb(0,0,145)"></span><span class="gmail-code-keyword" style="color:rgb(145,0,145)"></span></pre><div>java.lang.reflect.InvocationTargetException</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">     </span>at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">    </span>at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">    </span>at java.base/java.lang.reflect.Method.invoke(Method.java:566)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>at org.netbeans.modules.sampler.SamplesOutputStream.toCompositeData(SamplesOutputStream.java:178)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>at org.netbeans.modules.sampler.SamplesOutputStream.access$400(SamplesOutputStream.java:44)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">    </span>at org.netbeans.modules.sampler.SamplesOutputStream$Sample.writeToStream(SamplesOutputStream.java:285)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>at org.netbeans.modules.sampler.SamplesOutputStream$Sample.access$300(SamplesOutputStream.java:253)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">    </span>at org.netbeans.modules.sampler.SamplesOutputStream.close(SamplesOutputStream.java:202)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.netbeans.modules.sampler.Sampler.stopSampling(Sampler.java:231)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>at org.netbeans.modules.sampler.Sampler.stop(Sampler.java:207)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>at org.netbeans.core.ui.sampler.SelfSamplerAction$1.doInBackground(SelfSamplerAction.java:90)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>at java.desktop/javax.swing.SwingWorker$1.call(SwingWorker.java:304)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">   </span>at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>at java.desktop/javax.swing.SwingWorker.run(SwingWorker.java:343)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">   </span>at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">   </span>at java.base/java.lang.Thread.run(Thread.java:835)xx</div><div>Caused by: java.lang.IllegalArgumentException: Argument compositeType cannot be null.</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">       </span>at java.management/javax.management.openmbean.CompositeDataSupport.<init>(CompositeDataSupport.java:206)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>at java.management/javax.management.openmbean.CompositeDataSupport.<init>(CompositeDataSupport.java:118)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>at java.management/sun.management.ThreadInfoCompositeData.getCompositeData(ThreadInfoCompositeData.java:130)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">   </span>at java.management/sun.management.ThreadInfoCompositeData.toCompositeData(ThreadInfoCompositeData.java:72)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">     </span>... 18 more</div></div><div><br></div><div>See also latest comments on <a href="https://issues.apache.org/jira/browse/NETBEANS-1359?focusedCommentId=16658301&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16658301">NETBEANS-1359</a>.</div><div><br></div><div>Thanks for investigating.</div><div><br></div><div>-Sven</div></div></div></div></div></div></div></div></div></div></div></div></div></div>