--- old/hotspot/test/gc/g1/TestShrinkDefragmentedHeap.java 2015-04-02 17:35:54.000000000 +0200 +++ new/hotspot/test/gc/g1/TestShrinkDefragmentedHeap.java 2015-04-02 17:35:54.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,10 +37,10 @@ import java.lang.management.MemoryUsage; import java.util.ArrayList; import java.util.List; -import sun.management.ManagementFactoryHelper; import static com.oracle.java.testlibrary.Asserts.*; import com.oracle.java.testlibrary.ProcessTools; import com.oracle.java.testlibrary.OutputAnalyzer; +import com.sun.management.HotSpotDiagnosticMXBean; public class TestShrinkDefragmentedHeap { // Since we store all the small objects, they become old and old regions are also allocated at the bottom of the heap @@ -142,9 +142,11 @@ "committed free heap size is not less than committed full heap size, heap hasn't been shrunk?%n" + "%s = %s%n%s = %s", MIN_FREE_RATIO_FLAG_NAME, - ManagementFactoryHelper.getDiagnosticMXBean().getVMOption(MIN_FREE_RATIO_FLAG_NAME).getValue(), + ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class) + .getVMOption(MIN_FREE_RATIO_FLAG_NAME).getValue(), MAX_FREE_RATIO_FLAG_NAME, - ManagementFactoryHelper.getDiagnosticMXBean().getVMOption(MAX_FREE_RATIO_FLAG_NAME).getValue() + ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class) + .getVMOption(MAX_FREE_RATIO_FLAG_NAME).getValue() ); }