JDK-4464724 : /nsk/jdi tests throw NullPointerException- jdi.Connector.BooleanArgument.isValid
  • Type: Bug
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 1.4.0
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS:
    linux,solaris,solaris_8,solaris_9,windows_nt linux,solaris,solaris_8,solaris_9,windows_nt
  • CPU: x86,sparc
  • Submitted: 2001-06-01
  • Updated: 2001-06-20
  • Resolved: 2001-06-12
Related Reports
Duplicate :  
Description
Test	:	nsk/jdi/Argument/isValid/isvalid002
		nsk/jdi/Argument/setValue/setvalue001
		nsk/jdi/BooleanArgument/isValid/isvalid002
Testbase:	/net/sqesvr.eng/export/vsn/VM/testbase/testbase_nsk
Mode	:	-Xmixed, -Xcomp, -Xint
Platform:	Solsparc 5.8, 5.9, solx86, linux RH6.2, windows

JDK Tested:	weekly b63b, WeekAhead 20010530125025.jcoomes.baseline-debug

Steps to reproduce
             1) cd /net/sqesvr.eng/export/vsn/GammaBase/Bugs/{Buid}
             2) ksh doit

Output:
java version "1.4.0-beta_refresh"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta_refresh-b63b)
Java HotSpot(TM) Client VM (build 1.4.0-beta_refresh-b63b, mixed mode)
ERROR
Method tested: jdi.Connector.BooleanArgument.isValid
check: isValid(null)
error: NullPointerException 

TEST FAILED

With WeekAhead Build:
java version "1.4.0-beta_refresh"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta_refresh-b66)
Java HotSpot(TM) Client VM (build 20010530125025.jcoomes.baseline-debug, mixed mode)
ERROR
Method tested: jdi.Connector.Argument.setValue()
check: setValue(null); 
result: NullPointerException

TEST FAILED

All the 3 tests seem to fail with ladybird aswell.
Output:
java version "1.3.1-rc2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-rc2-b23)
Java HotSpot(TM) Client VM (build 1.3.1-rc2-b23, mixed mode)
ERROR
Method tested: jdi.Connector.Argument.setValue()
check: setValue(null); 
result: NullPointerException

TEST FAILED

Comments
EVALUATION Name: elR10090 Date: 06/01/2001 Let's see the freshest (Merlin-b65) specification for the JDI methods being tested: com.sun.jdi.connect.Connector.Argument: public void setValue(String value) Sets the value of the argument. The value should be checked with isValid(String) before setting it; invalid values will throw an exception when the connection is established - for example LaunchingConnector.launch(Map). public boolean isValid(String value) Performs basic sanity check of argument. Returns: true if the value is valid to be used in setValue(String) com.sun.jdi.connect.Connector.BooleanArgument: public boolean isValud(String value) Performs basic sanity check of argument. Specified by: isValid in interface Connector.Argument Returns: true if value is a string representation of a boolean value. See Also: stringValueOf(boolean) Please note, that null String is a particular case of String argument; and one may wonder if null String argument is allowed or prohibited for these methods. Basic common sense says nothing about it; there are many examples when null argument is acceptable for some methods, and is in-acceptable for others. So, one should follow the direct wordings of the specification. As one can see, there is no direct wording that null String value is invalid argument for these methods. Thus, one must treat null String like just valid argument. The tests correctly check if the valid null argument is accepted by these JDI methods. But the methods implementation incorrectly throws NullPointerException. This is the evidence of a bug in JDI implementation, not just in tests. So, I am re-assigning this bug to java/java/debugger sub-category. Certainly, I know about Robert's intention to change the specs to stipulate different processing of null arguments. When (and if) the specs will be actually changed, we would consider updating the tests. ====================================================================== Begin - robert.field@Eng 2001-06-11 Marked as dup of above mentioned spec change. End - robert.field@Eng 2001-06-11
11-06-2001