-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.4.0
-
generic
-
generic
Name: abR10010 Date: 09/18/2001
Test : nsk/regression/b4225064
TestBase : testbase_nsk
The nsk/regression/b4225064 test fails to get valid value of static field
from loaded class under the HotSpot VM (build 1.4.0-beta3-b78).
The Field.get(null) method returns the null value for a field declared
as static array of int while the b4225064 test expects non-null value
has to be returned.
This failure happens on all the platforms with both the Client and the Server
HotSpot VM starting with the build 1.4.0-beta3-b78.
The builds 1.4.0-beta3-b77 passes this test.
The nsk/regression/b4225064 test source:
===============================================================================
// File: @(#)b4225064.java 1.1 99/05/23
// Copyright 05/23/99 Sun Microsystems, Inc. All Rights Reserved
import java.io.PrintStream;
import java.lang.reflect.Field;
public class b4225064 {
public static void main (String[] args) throws Exception {
System.exit(run(args, System.out) + 95/*STATUS_TEMP*/);
}
public static int run(String argv[], PrintStream ref) throws Exception {
String className = "b4225064i";
b4225064a classFinder = new b4225064a();
Class clazz = classFinder.getClass(className);
String fieldName = "classInheritancePath";
Field f = clazz.getField(fieldName);
Object fieldValue = f.get(null);
if (fieldValue == null)
return 2/*STATUS_FAILED*/;
return 0/*STATUS_PASSED*/;
}
}
class b4225064a extends ClassLoader {
Class getClass (String className) throws Exception {
return super.findSystemClass(className);
}
}
interface b4225064i {
public static final int classInheritancePath[] = new int[2];
}
===============================================================================
======================================================================
- duplicates
-
JDK-4498653 reflective access of static field doesn't trigger class initialization
-
- Closed
-