-
Bug
-
Resolution: Fixed
-
P3
-
5.0
-
beta2
-
generic
-
generic
-
Verified
Name: ipR10196 Date: 02/19/2004
-----------------------------------------------------
Test : nsk/sajdi/Method/arguments/arguments001
VM : ClientVM, ServerVM
Mode : all
Platform : generic
OS : generic
JDK : 1.5.0-beta2-b38 and earlier
------------------------------------------------------
This SA-JDI test checks if Method.arguments() returns expected
list of LocalVariable objects with correct attributes.
Method.arguments() throws AbsentInformationException for methods
with no arguments. For other methods arguments list is successfully
returned. Method.argumentTypes() and Method.argumentTypeNames() work
fine in all cases. With legacy JDI connectors this test always passes.
AbsentInformationException is thrown only for static methods
and constructors which have no arguments and no local variables.
For static methods with no arguments but with local variables
this exception is not thrown and empty list of arguments is returned.
For instance methods this exception is not thrown even if method
has no arguments and no local variables (probably because of existence
of invisible argument 'this'). Empty arguments list is successfully
returned in this case.
Here is output errors for the following three declared methods:
arguments001aTestedClass() {} // constructor
static void methodStaticObviousEmpty() {}
static final char methodStaticFinalEmpty() { return 'x'; }
------------------------------------------------------------------
method #1
name: <init>
signature: ()V
isSynthetic: false
isAbstract: false
isNative: false
isStaticInit: false
... found expected method #0
com.sun.jdi.AbsentInformationException
at sun.jvm.hotspot.jdi.ConcreteMethodImpl.getVariables(ConcreteMethodImpl.java:394)
at sun.jvm.hotspot.jdi.ConcreteMethodImpl.arguments(ConcreteMethodImpl.java:357)
at nsk.sajdi.Method.arguments.arguments001.runIt(arguments001.java:223)
at nsk.sajdi.Method.arguments.arguments001.run(arguments001.java:26)
at nsk.sajdi.Method.arguments.arguments001.main(arguments001.java:21)
# ERROR: Method.arguments() throws AbsentInformationException:
# ERROR: method nom: 1
# ERROR: method name: <init>
# ERROR: signature: ()V
# ERROR: exception: com.sun.jdi.AbsentInformationException
type names: 0
arg types: 0
method #4
name: methodStaticObviousEmpty
signature: ()V
isSynthetic: false
isAbstract: false
isNative: false
isStaticInit: false
... found expected method #2
com.sun.jdi.AbsentInformationException
at sun.jvm.hotspot.jdi.ConcreteMethodImpl.getVariables(ConcreteMethodImpl.java:394)
at sun.jvm.hotspot.jdi.ConcreteMethodImpl.arguments(ConcreteMethodImpl.java:357)
at nsk.sajdi.Method.arguments.arguments001.runIt(arguments001.java:223)
at nsk.sajdi.Method.arguments.arguments001.run(arguments001.java:26)
at nsk.sajdi.Method.arguments.arguments001.main(arguments001.java:21)
# ERROR: Method.arguments() throws AbsentInformationException:
# ERROR: method nom: 4
# ERROR: method name: methodStaticObviousEmpty
# ERROR: signature: ()V
# ERROR: exception: com.sun.jdi.AbsentInformationException
type names: 0
arg types: 0
method #8
name: methodStaticFinalEmpty
signature: ()C
isSynthetic: false
isAbstract: false
isNative: false
isStaticInit: false
... found expected method #6
com.sun.jdi.AbsentInformationException
at sun.jvm.hotspot.jdi.ConcreteMethodImpl.getVariables(ConcreteMethodImpl.java:394)
at sun.jvm.hotspot.jdi.ConcreteMethodImpl.arguments(ConcreteMethodImpl.java:357)
at nsk.sajdi.Method.arguments.arguments001.runIt(arguments001.java:223)
at nsk.sajdi.Method.arguments.arguments001.run(arguments001.java:26)
at nsk.sajdi.Method.arguments.arguments001.main(arguments001.java:21)
# ERROR: Method.arguments() throws AbsentInformationException:
# ERROR: method nom: 8
# ERROR: method name: methodStaticFinalEmpty
# ERROR: signature: ()C
# ERROR: exception: com.sun.jdi.AbsentInformationException
type names: 0
arg types: 0
-----------------------------------------------------------------
To reproduce this failure:
cd /net/jano.sfbay/export/disk20/GammaBase/Bugs/<this bug number>
sh build.sh $JAVA_HOME
sh run.sh [-pid | -core | -socket] [-g] [-v] $JAVA_HOME [JAVA_OPTS]
where:
-pid - run test with SA-JDI pid attaching connector (default)
-core - run test with SA-JDI core attaching connector
-socket - run test with JDI socket attaching connector
-g - run test with java_g binaries
-v - run test in verbose mode
This test will appear in the next r27 testbase release.
Running on Linux this test may fail due to known bug:
4996081 SA-JDI: SAPIDAttachingConnector.attach() throws IOEception on RH AS2.1
======================================================================
Name: ipR10196 Date: 02/19/2004
Method.variables() also throws AbsentInformationException for such
kind of methods (with legacy JDI connectors it works fine).
The following test fails:
nsk/sajdi/Method/variables/variables001
# ERROR: Method.variables() throws AbsentInformationException:
# ERROR: method nom: 0
# ERROR: method name: <init>
# ERROR: signature: ()V
# ERROR: exception: com.sun.jdi.AbsentInformationException
# ERROR: Method.variables() throws AbsentInformationException:
# ERROR: method nom: 5
# ERROR: method name: methodStaticObviousEmpty
# ERROR: signature: ()V
# ERROR: exception: com.sun.jdi.AbsentInformationException
# ERROR: Method.variables() throws AbsentInformationException:
# ERROR: method nom: 9
# ERROR: method name: methodStaticFinalEmpty
# ERROR: signature: ()C
# ERROR: exception: com.sun.jdi.AbsentInformationException
======================================================================
- relates to
-
JDK-5030113 SA-JDI: Method.variables() throws AbsentInformationException on no-locals method
- Closed
-
JDK-5030419 SA-JDI: ReferenceType.nestedTypes() returns unexpected anonymous type
- Resolved