JDK-4325270 : JDI: Location.codeIndex() for native method does not return -1.
  • Type: Bug
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2000-03-27
  • Updated: 2000-03-29
  • Resolved: 2000-03-29
Related Reports
Duplicate :  
Relates :  
Description
 API documentation for Location.codeIndex states that it returns " the long 
 representing the position within the method, or -1 if the method is native."
 
 As the location will be null for abstract and native methods 
 Location.codeIndex() will not return -1 for a native method.
 
 Scenario:
 ---------
 Debugger - LocationTest.java
 Debugee - LocationDebugee.java
 
 As mentioned in Locatable API "abstract and native Methods will return null 
 when their location method is called." the native method "nativeMethod()"
 in LocationDebugee returns null when the location() method is called.
 Calling codeIndex() on this location null throws NullPointerException.
   
 ***Testing done in JDK1.3.0rc2-Y-Hotspot and Classic VM(WinNT and Solaris2.7)

 Steps to reproduce the bug
 ---------------------------
 The bug can be reproduced using the files in the location
 /net/sqesvr/export/disk5/toolsbugs/4325270
 Follow the instructions in README to reproduce the bug. 

Comments
EVALUATION Such a location should never exist (though it does now because of other errors). This text should be removed from the spec. robert.field@Eng 2000-03-27
27-03-2000