<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Probable fix use Runtime.version().feature() instead of 0:</div><div dir="ltr"><br><div><div>    public static CompositeType compositeType() {</div><div>        return ThreadInfoCompositeTypes.compositeTypes.get(Runtime.version().feature());</div><div>    }</div></div><div><br><div>Sven</div><div><br></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Sun, Oct 21, 2018 at 10:50 AM Sven Reimers <<a href="mailto:sven.reimers@gmail.com">sven.reimers@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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="m_7205033560727153568gmail-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="m_7205033560727153568gmail-code-object" style="color:rgb(0,0,145)"></span><span class="m_7205033560727153568gmail-code-object" style="color:rgb(0,0,145)"></span><span class="m_7205033560727153568gmail-code-keyword" style="color:rgb(145,0,145)"></span></pre><pre class="m_7205033560727153568gmail-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="m_7205033560727153568gmail-code-object" style="color:rgb(0,0,145)"></span><span class="m_7205033560727153568gmail-code-object" style="color:rgb(0,0,145)"></span><span class="m_7205033560727153568gmail-code-keyword" style="color:rgb(145,0,145)"></span></pre></div><div><pre class="m_7205033560727153568gmail-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="m_7205033560727153568gmail-code-object" style="color:rgb(0,0,145)"></span><span class="m_7205033560727153568gmail-code-object" style="color:rgb(0,0,145)"></span><span class="m_7205033560727153568gmail-code-keyword" style="color:rgb(145,0,145)"></span></pre><pre class="m_7205033560727153568gmail-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="m_7205033560727153568gmail-code-object" style="color:rgb(0,0,145)"></span><span class="m_7205033560727153568gmail-code-object" style="color:rgb(0,0,145)"></span><span class="m_7205033560727153568gmail-code-keyword" style="color:rgb(145,0,145)"></span></pre><div>java.lang.reflect.InvocationTargetException</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap">    </span>at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>at java.base/java.lang.reflect.Method.invoke(Method.java:566)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>at org.netbeans.modules.sampler.SamplesOutputStream.toCompositeData(SamplesOutputStream.java:178)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap">    </span>at org.netbeans.modules.sampler.SamplesOutputStream.access$400(SamplesOutputStream.java:44)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>at org.netbeans.modules.sampler.SamplesOutputStream$Sample.writeToStream(SamplesOutputStream.java:285)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap">       </span>at org.netbeans.modules.sampler.SamplesOutputStream$Sample.access$300(SamplesOutputStream.java:253)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>at org.netbeans.modules.sampler.SamplesOutputStream.close(SamplesOutputStream.java:202)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap">      </span>at org.netbeans.modules.sampler.Sampler.stopSampling(Sampler.java:231)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap">       </span>at org.netbeans.modules.sampler.Sampler.stop(Sampler.java:207)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap">       </span>at org.netbeans.core.ui.sampler.SelfSamplerAction$1.doInBackground(SelfSamplerAction.java:90)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>at java.desktop/javax.swing.SwingWorker$1.call(SwingWorker.java:304)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>at java.desktop/javax.swing.SwingWorker.run(SwingWorker.java:343)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap">    </span>at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap"> </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="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap">     </span>at java.management/javax.management.openmbean.CompositeDataSupport.<init>(CompositeDataSupport.java:206)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap">       </span>at java.management/javax.management.openmbean.CompositeDataSupport.<init>(CompositeDataSupport.java:118)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap">       </span>at java.management/sun.management.ThreadInfoCompositeData.getCompositeData(ThreadInfoCompositeData.java:130)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at java.management/sun.management.ThreadInfoCompositeData.toCompositeData(ThreadInfoCompositeData.java:72)</div><div><span class="m_7205033560727153568gmail-Apple-tab-span" style="white-space:pre-wrap">   </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" target="_blank">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>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div>Sven Reimers<br><br>* Senior Expert Software Architect</div><div>* Java Champion<br>* NetBeans Dream Team Member: <a href="http://dreamteam.netbeans.org" target="_blank">http://dreamteam.netbeans.org</a><br>* Community Leader  NetBeans: <a href="http://community.java.net/netbeans" target="_blank">http://community.java.net/netbeans</a><br>                              Desktop Java: <a href="http://community.java.net/javadesktop" target="_blank">http://community.java.net/javadesktop</a><br></div>* JUG Leader JUG Bodensee: <a href="http://www.jug-bodensee.de" target="_blank">http://www.jug-bodensee.de</a><br><div>* Duke's Choice Award Winner 2009<br><br>* XING: <a href="https://www.xing.com/profile/Sven_Reimers8" target="_blank">https://www.xing.com/profile/Sven_Reimers8</a><br>* LinkedIn: <a href="http://www.linkedin.com/in/svenreimers" target="_blank">http://www.linkedin.com/in/svenreimers</a><br></div></div></div></div></div></div>