Java com.sun.jdi.InterfaceType中缺少invokeMethod

Java com.sun.jdi.InterfaceType中缺少invokeMethod,java,java-8,Java,Java 8,在OracleJavadocsforJava8中,指定了一个名为invokeMethod的方法 但是,当我检查我的系统时,我在界面中没有看到任何此类方法: kshitiz:/usr/lib/jvm/jdk1.8.0/lib$ javap -classpath tools.jar com.sun.jdi.InterfaceType Compiled from "InterfaceType.java" public interface com.sun.jdi.InterfaceType extend

在OracleJavadocsforJava8中,指定了一个名为
invokeMethod
的方法

但是,当我检查我的系统时,我在界面中没有看到任何此类方法:

kshitiz:/usr/lib/jvm/jdk1.8.0/lib$ javap -classpath tools.jar com.sun.jdi.InterfaceType
Compiled from "InterfaceType.java"
public interface com.sun.jdi.InterfaceType extends com.sun.jdi.ReferenceType {
  public abstract java.util.List<com.sun.jdi.InterfaceType> superinterfaces();
  public abstract java.util.List<com.sun.jdi.InterfaceType> subinterfaces();
  public abstract java.util.List<com.sun.jdi.ClassType> implementors();
}

我遗漏了什么?

在测试了不同的版本之后,Oracle似乎在次要更新
u40
中添加了该方法。下面没有此方法的版本

在JDK
1.8.0\u 40上:

Compiled from "InterfaceType.java"
public interface com.sun.jdi.InterfaceType extends com.sun.jdi.ReferenceType {
  public abstract java.util.List<com.sun.jdi.InterfaceType> superinterfaces();
  public abstract java.util.List<com.sun.jdi.InterfaceType> subinterfaces();
  public abstract java.util.List<com.sun.jdi.ClassType> implementors();
  public com.sun.jdi.Value invokeMethod(com.sun.jdi.ThreadReference, com.sun.jdi.Method, java.util.List<? extends com.sun.jdi.Value>, int) throws com.sun.jdi.InvalidTypeException, com.sun.jdi.ClassNotLoadedException, com.sun.jdi.IncompatibleThreadStateException, com.sun.jdi.InvocationException;
}
从“InterfaceType.java”编译而来
公共接口com.sun.jdi.InterfaceType扩展了com.sun.jdi.ReferenceType{
公共抽象java.util.List SuperInterface();
公共抽象java.util.List子接口();
公共抽象java.util.List实现者();

public com.sun.jdi.Value invokeMethod(com.sun.jdi.ThreadReference、com.sun.jdi.Method、java.util.ListOutput of
java-version
?@Kshitiz
com.sun
包可以随时更改;它们被视为私有实现details@KshitizSharma,仅仅因为人们使用了一些东西,并不能神奇地将官方API稳定性保证扩展到这些部分oo.事实上,我确实观察到调试工具在java更新之间出现中断。@kshitizzarma请参阅例如@Louis Wasserman:不要将
sun.*
包与
com.sun.*
包混淆。后者包含一些特定于供应商的API,这些API只是特定于供应商的,而不是私有的。这里讨论的API就是一个例子,如下所示:问题中的链接已经显示,它是一个有文档记录的API。@Kshitiz Sharma:它是一个已添加的
默认
方法,因此它不太可能破坏任何东西,但它在Java 8中的缺失被认为是一个必须修复的错误。另请参阅
Compiled from "InterfaceType.java"
public interface com.sun.jdi.InterfaceType extends com.sun.jdi.ReferenceType {
  public abstract java.util.List<com.sun.jdi.InterfaceType> superinterfaces();
  public abstract java.util.List<com.sun.jdi.InterfaceType> subinterfaces();
  public abstract java.util.List<com.sun.jdi.ClassType> implementors();
  public com.sun.jdi.Value invokeMethod(com.sun.jdi.ThreadReference, com.sun.jdi.Method, java.util.List<? extends com.sun.jdi.Value>, int) throws com.sun.jdi.InvalidTypeException, com.sun.jdi.ClassNotLoadedException, com.sun.jdi.IncompatibleThreadStateException, com.sun.jdi.InvocationException;
}