JDK-7152798 : TEST_BUG: sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java does not compile
  • Type: Bug
  • Component: core-svc
  • Sub-Component: java.lang.management
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-03-10
  • Updated: 2019-08-16
  • Resolved: 2012-03-27
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 Other JDK 6 JDK 7 JDK 8
5.0u65Fixed 5.0u71Fixed 6u60Fixed 7u40Fixed 8 b32Fixed
Related Reports
Relates :  
Description
The jtreg tags on this test are incorrect with a result that the test is not actually compiled and run as expected. With the @build fixed then it becomes clear that this test no longer compiles:


#Test Results (version 2)
#Sat Mar 10 10:46:13 GMT 2012
#checksum:27522fb53c7f53b4
#-----testdescription-----
$file=/net/rialto/export/Users/ab23780/ws/jdk8/tl/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java
$root=/net/rialto/export/Users/ab23780/ws/jdk8/tl/jdk/test
author=Steve Bohne
keywords=bug4858522
run=USER_SPECIFIED build GetClassLoadingTime ClassToLoad0\nUSER_SPECIFIED main GetClassLoadingTime\n
source=GetClassLoadingTime.java
title=Basic unit test of HotspotClassLoadingMBean.getClassLoadingTime()

#-----environment-----

#-----testresult-----
description=file\:/net/rialto/export/Users/ab23780/ws/jdk8/tl/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java
elapsed=180 0\:00\:00.180
end=Sat Mar 10 10\:46\:13 GMT 2012
environment=regtest
execStatus=Failed. Compilation failed\: Compilation failed
hostname=marino.ie.oracle.com
javatestOS=SunOS 5.10 (x86)
javatestVersion=4.4
script=com.sun.javatest.regtest.RegressionScript 
sections=script_messages build compile
start=Sat Mar 10 10\:46\:13 GMT 2012
test=sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java
user.name=albatem
work=/export/Scratch/ab23780/jtreg-testing/JTwork/sun/management/HotspotClassLoadingMBean

#section:script_messages
----------messages:(4/216)----------
JDK under test: (/export/Scratch/alanb/jdk1.8)
java version "1.8.0-internal"
Java(TM) SE Runtime Environment (build 1.8.0-internal-201203081830.albatem.tl-b00)
Java HotSpot(TM) Server VM (build 24.0-b01, mixed mode)

#section:build
----------messages:(3/153)----------
command: build GetClassLoadingTime ClassToLoad0
reason: User specified action: run build GetClassLoadingTime ClassToLoad0 
elapsed time (seconds): 0.179
result: Failed. Compilation failed: Compilation failed

#section:compile
----------messages:(3/326)----------
command: compile /net/rialto/export/Users/ab23780/ws/jdk8/tl/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java /net/rialto/export/Users/ab23780/ws/jdk8/tl/jdk/test/sun/management/HotspotClassLoadingMBean/ClassToLoad0.java
reason: .class file out of date or does not exist
elapsed time (seconds): 0.178
----------direct:(16/1312)----------
/net/rialto/export/Users/ab23780/ws/jdk8/tl/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java:42: warning: HotspotClassLoadingMBean is internal proprietary API and may be removed in a future release
    private static HotspotClassLoadingMBean mbean =
                   ^
/net/rialto/export/Users/ab23780/ws/jdk8/tl/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java:43: warning: HotspotClassLoadingMBean is internal proprietary API and may be removed in a future release
        (HotspotClassLoadingMBean)ManagementFactoryHelper.getHotspotClassLoadingMBean();
         ^
/net/rialto/export/Users/ab23780/ws/jdk8/tl/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java:43: warning: ManagementFactoryHelper is internal proprietary API and may be removed in a future release
        (HotspotClassLoadingMBean)ManagementFactoryHelper.getHotspotClassLoadingMBean();
                                  ^
/net/rialto/export/Users/ab23780/ws/jdk8/tl/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java:75: error: cannot find symbol
        long count = mbean.getLoadedClassCount();
                          ^
  symbol:   method getLoadedClassCount()
  location: variable mbean of type HotspotClassLoadingMBean
1 error
3 warnings
result: Failed. Compilation failed: Compilation failed


test result: Failed. Compilation failed: Compilation failed

Comments
EVALUATION The result of the call to getLoadedClassCount() is only used for trace-debugging and the call can be removed.
13-03-2012