【问题标题】:How to know if an `com.sun.jdi.ObjectReference` is an Enum?如何知道 com.sun.jdi.ObjectReference 是否是枚举?
【发布时间】:2020-12-08 02:08:08
【问题描述】:

如何确定com.sun.jdi.ObjectReference 实例是否为枚举?我可以使用ObjectReference.type() 获取实例的类型,它会返回ClassType(如果它是一个类)。

【问题讨论】:

  • 根据 javadoc,ClassType 上有一个 isEnum() 方法。我自己从来没有试过。有用吗?
  • @k5_,天哪,我太累了,我什至没有看到它。我测试了它,它可以工作。

标签: java debugging jvmti jdi


【解决方案1】:

com.sun.jdi.ClassType 上使用isEnum() 方法

【讨论】:

    猜你喜欢
    • 2015-02-15
    • 1970-01-01
    • 1970-01-01
    • 2012-04-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-12
    相关资源
    最近更新 更多