test/jdk/jdk/jfr/event/gc/detailed/PromotionEvent.java
changeset 59053 ba6c248cae19
parent 50113 caf115bb98ad
equal deleted inserted replaced
59051:f0312c7d5b37 59053:ba6c248cae19
     1 /*
     1 /*
     2  * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    67         GarbageCollectorMXBean ycBean = null;
    67         GarbageCollectorMXBean ycBean = null;
    68 
    68 
    69         List<GarbageCollectorMXBean> gcBeans = ManagementFactory.getGarbageCollectorMXBeans();
    69         List<GarbageCollectorMXBean> gcBeans = ManagementFactory.getGarbageCollectorMXBeans();
    70         for (GarbageCollectorMXBean gcBean : gcBeans) {
    70         for (GarbageCollectorMXBean gcBean : gcBeans) {
    71             if ("PS Scavenge".equals(gcBean.getName())
    71             if ("PS Scavenge".equals(gcBean.getName())
    72                     || "G1 Young Generation".equals(gcBean.getName())
    72                     || "G1 Young Generation".equals(gcBean.getName())) {
    73                     || ("ParNew".equals(gcBean.getName()))) {
       
    74                 ycBean = gcBean;
    73                 ycBean = gcBean;
    75             }
    74             }
    76 
    75 
    77             if (ycBean != null) {
    76             if (ycBean != null) {
    78                 break;
    77                 break;