我可以通过以下使用查询来获取所有线程对象
SELECT OBJECTS dominators(s) FROM java.lang.Thread s
然后,如果我想对返回的结果对象进行进一步的分析,我认为OQL应该如下所示:
SELECT * from (SELECT OBJECTS dominators(s) FROM java.lang.Thread s)
但它转向了ClassCastException。
Problem reported:
ClassCastException occured. Remember: sub queries with the modifier INSTANCESOF or INCLUDING SUBCLASSES must return only class objects
java.lang.ClassCastException: org.eclipse.mat.parser.model.InstanceImpl cannot be cast to org.eclipse.mat.snapshot.model.IClass
at org.eclipse.mat.parser.internal.oql.OQLQueryImpl.doSubQuery(OQLQueryImpl.java:752)
at org.eclipse.mat.parser.internal.oql.OQLQueryImpl.internalExecute(OQLQueryImpl.java:642)
at org.eclipse.mat.parser.internal.oql.OQLQueryImpl.execute(OQLQueryImpl.java:627)
at org.eclipse.mat.inspections.OQLQuery.execute(OQLQuery.java:50)
at org.eclipse.mat.inspections.OQLQuery.execute(OQLQuery.java:1)
at org.eclipse.mat.query.registry.ArgumentSet.execute(ArgumentSet.java:129)
at org.eclipse.mat.ui.snapshot.panes.OQLPane$OQLJob.doRun(OQLPane.java:339)
at org.eclipse.mat.ui.editor.AbstractPaneJob.run(AbstractPaneJob.java:34)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
MATEclipse中的OQL支持嵌入式查询吗?如何获得我想要的结果?
使子查询工作起来有点棘手。尝试以下操作:
SELECT * from OBJECTS (SELECT OBJECTS dominators(s) FROM java.lang.Thread s)
我从下面的链接中得到了解决方案:https://www.eclipse.org/forums/index.php/t/608746/