| Other |
|---|
| 1.4.0 betaFixed |
|
Duplicate :
|
|
|
Duplicate :
|
|
|
Duplicate :
|
|
|
Relates :
|
|
|
Relates :
|
The JDI spec is inconsistent with regards to location() of native methods. In some places
it claims they cannot be created (should return null). In others, it is claimed they can.
Can:
StackFrame.location()
If the frame represents a native method invocation, the returned
location indicates the class and method, but the code index will not be valid.
Location.codeIndex()
Returns the long representing the position within the method, or -1 if the
method is native.
Unspecified, but implies by virtue of being Locatable that they can:
MethodEntryEvent
MethodExitEvent
AccessWatchpointEvent
ModificationWatchpointEvent
all of which are events which can occur in native code
Cannot:
Locatable.location()
Returns the Location of this mirror, or null if there is no executable code
associated with it. For example, abstract and native Methods will return
null when their location method is called.
It would severely break the interface if StackFrame.location() or the events could not return
Location. So it is Locatable.location() that must be changed (note: it will still return
null for abstract methods).
Additionally then. all users of Location objects must behave correctly when encountering
Location objects for native methods. Specifically,
EventRequestManager.createBreakpointRequest(Location location)
which is the only consumer of Location objects must have its spec changed so that it throws
NativeMethodException (which is a RuntimeException) if passed a Location for a native
method. And the related methods within Location must have their specs clarified.
robert.field@Eng 2000-03-28
|