JDK-4503986 : b4225064 test fails to get valid value of static field from loaded class
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2001-09-18
  • Updated: 2001-09-18
  • Resolved: 2001-09-18
Related Reports
Duplicate :  
Description

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];
}
===============================================================================


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