JDK-4359628 : JDI: methods Accessible.is...() lie about array types
  • Type: Bug
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 1.3.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_7
  • CPU: sparc
  • Submitted: 2000-08-04
  • Updated: 2002-08-30
  • Resolved: 2002-08-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.0 beta2Fixed
Related Reports
Relates :  
Description

Name: abR10010			Date: 08/04/2000


The nsk/jdi/Accessible/isPrivate/isPrivate001 test fails under
the HotSpot Client VM (build 1.3.0-b24, mixed mode).

This test checks the isPrivate() method of the Accessible interface
of the com.sun.jdi package for ArrayType, ClassType, InterfaceType.

The Java Debug Interface specification for Accessible.isPrivate()
method says:

"...For object arrays, the return value is the same as would be
returned for the component type. ..."

But the nsk isPrivate001 test shows that this assertion is violated
by the Accessible.isPrivate() method for arrays when component
type is private class type or private interface type.

To reproduce the bug run doit.sh in
/net/sqesvr/export/vsn/GammaBase/Bugs/<this bug number>.

The first parameter for doit.sh should be JDK root directory
(e.g. /java/jdk1.3/solaris) and the other parameter(s) -
VM option(s) (optional).

See log:

% doit.sh /bond/java/dest/Solaris_JDK_1.3-b24
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-b24)
Java HotSpot(TM) Client VM (build 1.3.0-b24, mixed mode)
==> nsk/jdi/Accessible/isPrivate/isPrivate001 test LOG:
==> test checks the isPrivate() method of Accessible interface
    of the com.sun.jdi package for ArrayType, ClassType, InterfaceType

--> isPrivate001: checking debugee's classes by Accessible.isPrivate() method...
!!--> isPrivate001: UNEXPECTED isPrivate() method result (false) for class: isPrivate001a$s_interf[](private)
!!--> isPrivate001: UNEXPECTED isPrivate() method result (false) for class: isPrivate001a$s_interf[][](private)
!!--> isPrivate001: UNEXPECTED isPrivate() method result (false) for class: isPrivate001a$U[](private)
!!--> isPrivate001: UNEXPECTED isPrivate() method result (false) for class: isPrivate001a$U[][](private)
--> isPrivate001: checking debugee's classes completed!
--> isPrivate001: number of checked classes = 68
!!--> isPrivate001: isPrivate() method ERRORS counter = 4

==> nsk/jdi/Accessible/isPrivate/isPrivate001 test FAILED

======================================================================

Name: elR10090			Date: 02/07/2001



This problem seems to also affect testbase_nsk tests: 

    nsk/jdi/Accessible/isPackagePrivate/accipp001
    nsk/jdi/Accessible/isPrivate/isPrivate001
    nsk/jdi/Accessible/isProtected/isProtected001
    nsk/jdi/Accessible/isPublic/isPublic001

======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin-beta2 FIXED IN: merlin-beta2 INTEGRATED IN: merlin-beta2 VERIFIED IN: merlin-rc1
14-06-2004

EVALUATION tim.bell@Eng 2001-06-14 In the javadoc for the JDI interface com.sun.jdi.Accessible at file:/usr/local/java/jdk1.4/doc/guide/jpda/jdi/com/sun/jdi/Accessible.html We have these words for isPrivate() [and similar words for the other isPxxyy() methods] Determines if this object mirrors a private item. For ArrayType, the return value depends on the array component type. For primitive arrays the return value is always false. For object arrays, the return value is the same as would be returned for the component type. For primitive classes, such as Integer.TYPE, the return value is always false. However, in the JDWP documentation/specification at file:/usr/local/java/jdk1.4/doc/guide/jpda/jdwp/jdwp-protocol.html#JDWP_ReferenceType_Modifiers We have: Returns the modifiers (also known as access flags) for a reference type. The returned bit mask contains information on the declaration of the reference type. If the reference type is an array or a primitive class (for example, java.lang.Integer.TYPE), the value of the returned bit mask is undefined. Looks like JDI is promising information that JDWP won't deliver in the current implementation. tim.bell@Eng 2001-06-17 For object arrays, the return values for Interface Accessible.isPrivate(), Accessible.isProtected(), etc... are the same as would be returned for the component type. Provide an ArrayTypeImpl.getModifiers() implementation to fetch the modifier bits from the component type and use those. Reference file:/usr/local/java/jdk1.4/doc/guide/jpda/jdi/com/sun/jdi/Accessible.html
11-06-2004

PUBLIC COMMENTS .
10-06-2004