RFR 8040167: JDWP spec for ClassType#InvokeMethod contradicts JLS

Jaroslav Bachorik jaroslav.bachorik at oracle.com
Tue Apr 15 08:21:56 UTC 2014


Please, review this simple doc change.

Issue : https://bugs.openjdk.java.net/browse/JDK-8040167
Webrev: http://cr.openjdk.java.net/~jbachorik/8040167/webrev.00/

Currently, the generated JDWP documentation falsely states that the 
InvokeMethod command
"Invokes a static method. The method must be member of the class type or 
one of its superclasses,
*superinterfaces*, or implemented interfaces."

Up till JDK8 this was almost non-problem since interfaces could not 
specify static methods. For JDK8 this brings in ambiguity and 
contradicts JLS.

The JDI docs 
(http://docs.oracle.com/javase/8/docs/jdk/api/jpda/jdi/com/sun/jdi/ClassType.html#invokeMethod-com.sun.jdi.ThreadReference-com.sun.jdi.Method-java.util.List-int-) 
state correctly that the InvokeMethod can be uses only on static methods 
from the class or its superclasses (no mention of interface) - following 
the JLS 
(http://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.4.8) 
rules.

The fix is to change the line to read
"Invokes a static method. The method must be member of the class type or 
one of its superclasses." instead.

Thanks,

-JB-


More information about the serviceability-dev mailing list