Skip to content

Commit 1d09409

Browse files
committed
Merge master jdk-17.0.6+4 into openj9-staging
Signed-off-by: J9 Build <[email protected]>
2 parents e0b9642 + fbc2fa3 commit 1d09409

File tree

18 files changed

+1200
-34
lines changed

18 files changed

+1200
-34
lines changed

make/data/cldr/common/bcp47/timezone.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ For terms of use, see http://www.unicode.org/copyright.html
393393
<type name="tvfun" description="Funafuti, Tuvalu" alias="Pacific/Funafuti"/>
394394
<type name="twtpe" description="Taipei, Taiwan" alias="Asia/Taipei ROC"/>
395395
<type name="tzdar" description="Dar es Salaam, Tanzania" alias="Africa/Dar_es_Salaam"/>
396-
<type name="uaiev" description="Kiev, Ukraine" alias="Europe/Kiev"/>
396+
<type name="uaiev" description="Kyiv, Ukraine" alias="Europe/Kiev Europe/Kyiv"/>
397397
<type name="uaozh" description="Zaporizhia (Zaporozhye), Ukraine" alias="Europe/Zaporozhye"/>
398398
<type name="uasip" description="Simferopol, Ukraine" alias="Europe/Simferopol"/>
399399
<type name="uauzh" description="Uzhhorod (Uzhgorod), Ukraine" alias="Europe/Uzhgorod"/>

make/devkit/createJMHBundle.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# Create a bundle in the build directory, containing what's needed to
2727
# build and run JMH microbenchmarks from the OpenJDK build.
2828

29-
JMH_VERSION=1.34
29+
JMH_VERSION=1.35
3030
COMMONS_MATH3_VERSION=3.2
3131
JOPT_SIMPLE_VERSION=4.6
3232

src/jdk.jfr/share/conf/jfr/default.jfc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,10 @@
521521
<setting name="enabled" control="compiler-enabled-failure">false</setting>
522522
</event>
523523

524+
<event name="jdk.JITRestart">
525+
<setting name="enabled" control="compiler-enabled">true</setting>
526+
</event>
527+
524528
<event name="jdk.CodeSweeperConfiguration">
525529
<setting name="enabled" control="compiler-enabled">true</setting>
526530
<setting name="period">beginChunk</setting>

src/jdk.jfr/share/conf/jfr/profile.jfc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,10 @@
521521
<setting name="enabled" control="compiler-enabled-failure">false</setting>
522522
</event>
523523

524+
<event name="jdk.JITRestart">
525+
<setting name="enabled" control="compiler-enabled">true</setting>
526+
</event>
527+
524528
<event name="jdk.CodeSweeperConfiguration">
525529
<setting name="enabled" control="compiler-enabled">true</setting>
526530
<setting name="period">beginChunk</setting>

test/hotspot/jtreg/gc/epsilon/TestMemoryMXBeans.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* gc.epsilon.TestMemoryMXBeans
3737
* -1 256
3838
*
39-
* @run main/othervm -Xmx256m -Xmx256m
39+
* @run main/othervm -Xms256m -Xmx256m
4040
* -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC
4141
* gc.epsilon.TestMemoryMXBeans
4242
* 256 256

test/hotspot/jtreg/gc/g1/TestShrinkAuxiliaryData30.java renamed to test/hotspot/jtreg/gc/g1/TestShrinkAuxiliaryData27.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
2424
package gc.g1;
2525

2626
/**
27-
* @test TestShrinkAuxiliaryData30
27+
* @test TestShrinkAuxiliaryData27
2828
* @key randomness
2929
* @bug 8038423 8061715 8078405
3030
* @summary Checks that decommitment occurs for JVM with different
@@ -36,11 +36,11 @@
3636
* java.management
3737
* @build sun.hotspot.WhiteBox
3838
* @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox
39-
* @run main/timeout=720 gc.g1.TestShrinkAuxiliaryData30
39+
* @run main/timeout=720 gc.g1.TestShrinkAuxiliaryData27
4040
*/
41-
public class TestShrinkAuxiliaryData30 {
41+
public class TestShrinkAuxiliaryData27 {
4242

4343
public static void main(String[] args) throws Exception {
44-
new TestShrinkAuxiliaryData(30).test();
44+
new TestShrinkAuxiliaryData(27).test();
4545
}
4646
}

test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTools.java

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@
2727
* Common code for string deduplication tests
2828
*/
2929

30+
import com.sun.management.GarbageCollectionNotificationInfo;
3031
import java.lang.reflect.*;
32+
import java.lang.management.*;
3133
import java.util.*;
34+
import javax.management.*;
35+
import javax.management.openmbean.*;
3236
import jdk.test.lib.process.ProcessTools;
3337
import jdk.test.lib.process.OutputAnalyzer;
3438
import sun.misc.*;
@@ -89,21 +93,58 @@ private static void doFullGc(int numberOfTimes) {
8993
}
9094
}
9195

96+
private static volatile int gcCount;
97+
private static NotificationListener listener = new NotificationListener() {
98+
@Override
99+
public void handleNotification(Notification n, Object o) {
100+
if (n.getType().equals(GarbageCollectionNotificationInfo.GARBAGE_COLLECTION_NOTIFICATION)) {
101+
GarbageCollectionNotificationInfo info = GarbageCollectionNotificationInfo.from((CompositeData) n.getUserData());
102+
// Shenandoah and Z GC also report GC pauses, skip them
103+
if (info.getGcName().startsWith("Shenandoah") || info.getGcName().startsWith("ZGC")) {
104+
if ("end of GC cycle".equals(info.getGcAction())) {
105+
gcCount++;
106+
}
107+
} else {
108+
gcCount++;
109+
}
110+
}
111+
}
112+
};
113+
114+
private static void registerGCListener() {
115+
for (GarbageCollectorMXBean bean : ManagementFactory.getGarbageCollectorMXBeans()) {
116+
((NotificationEmitter)bean).addNotificationListener(listener, null, null);
117+
}
118+
}
119+
120+
private static void unregisterGCListener() {
121+
for (GarbageCollectorMXBean bean : ManagementFactory.getGarbageCollectorMXBeans()) {
122+
try {
123+
((NotificationEmitter) bean).removeNotificationListener(listener, null, null);
124+
} catch (Exception e) {
125+
}
126+
}
127+
}
128+
92129
private static void doYoungGc(int numberOfTimes) {
93-
// Provoke at least numberOfTimes young GCs
94130
final int objectSize = 128;
95-
final int maxObjectInYoung = (Xmn * MB) / objectSize;
96131
List<List<String>> newStrings = new ArrayList<List<String>>();
97-
for (int i = 0; i < numberOfTimes; i++) {
132+
133+
// Provoke at least numberOfTimes young GCs
134+
gcCount = 0;
135+
registerGCListener();
136+
while (gcCount < numberOfTimes) {
137+
int currentCount = gcCount;
98138
// Create some more strings for every collection, to ensure
99139
// there will be deduplication work that will be reported.
100140
newStrings.add(createStrings(SmallNumberOfStrings, SmallNumberOfStrings));
101-
System.out.println("Begin: Young GC " + (i + 1) + "/" + numberOfTimes);
102-
for (int j = 0; j < maxObjectInYoung + 1; j++) {
141+
System.out.println("Begin: Young GC " + (currentCount + 1) + "/" + numberOfTimes);
142+
while (currentCount == gcCount) {
103143
dummy = new byte[objectSize];
104144
}
105-
System.out.println("End: Young GC " + (i + 1) + "/" + numberOfTimes);
145+
System.out.println("End: Young GC " + (currentCount + 1) + "/" + numberOfTimes);
106146
}
147+
unregisterGCListener();
107148
}
108149

109150
private static void forceDeduplication(int ageThreshold, String gcType) {

test/jdk/ProblemList.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,6 @@ javax/sound/sampled/Clip/Drain/ClipDrain.java 7062792 generic-all
685685
javax/sound/sampled/Mixers/DisabledAssertionCrash.java 7067310 generic-all
686686

687687
javax/sound/midi/Sequencer/Recording.java 8167580,8265485 linux-all,macosx-aarch64
688-
javax/sound/midi/Sequencer/MetaCallback.java 8178698 linux-all
689688
javax/sound/midi/Sequencer/Looping.java 8136897 generic-all
690689

691690
############################################################################
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
/*
2+
* Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
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
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
23+
24+
import java.awt.Dimension;
25+
import java.awt.EventQueue;
26+
import java.awt.FlowLayout;
27+
import java.awt.Frame;
28+
import java.awt.Point;
29+
import java.awt.Robot;
30+
import java.awt.TextArea;
31+
import java.awt.event.InputEvent;
32+
import java.awt.event.KeyEvent;
33+
34+
/*
35+
* @test
36+
* @key headful
37+
* @bug 8296632
38+
* @summary Verify the content changes of a TextArea via TextListener.
39+
* @run main TextAreaTextEventTest
40+
*/
41+
public class TextAreaTextEventTest {
42+
43+
private static Frame frame;
44+
private volatile static TextArea textArea;
45+
private volatile static boolean textChanged = false;
46+
private volatile static Point textAreaAt;
47+
private volatile static Dimension textAreaSize;
48+
private static Robot robot = null;
49+
50+
public static void main(String[] args) throws Exception {
51+
try {
52+
EventQueue.invokeAndWait(TextAreaTextEventTest::initializeGUI);
53+
54+
robot = new Robot();
55+
robot.setAutoDelay(100);
56+
57+
robot.waitForIdle();
58+
EventQueue.invokeAndWait(() -> {
59+
textAreaAt = textArea.getLocationOnScreen();
60+
textAreaSize = textArea.getSize();
61+
});
62+
robot.mouseMove(textAreaAt.x + textAreaSize.width / 2,
63+
textAreaAt.y + textAreaSize.height / 2);
64+
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
65+
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
66+
typeKey(KeyEvent.VK_T);
67+
68+
robot.waitForIdle();
69+
if (!textChanged) {
70+
throw new RuntimeException(
71+
"FAIL: TextEvent not triggered when key 'T' typed on TextArea");
72+
}
73+
74+
typeKey(KeyEvent.VK_E);
75+
typeKey(KeyEvent.VK_S);
76+
typeKey(KeyEvent.VK_T);
77+
78+
textChanged = false;
79+
typeKey(KeyEvent.VK_ENTER);
80+
81+
robot.waitForIdle();
82+
if (!textChanged) {
83+
throw new RuntimeException(
84+
"FAIL: TextEvent not triggered when Enter pressed on TextArea");
85+
}
86+
87+
textChanged = false;
88+
robot.mouseMove(textAreaAt.x + 4, textAreaAt.y + 10);
89+
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
90+
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
91+
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
92+
for (int i = 0; i < textAreaSize.width / 2; i++) {
93+
robot.mouseMove(textAreaAt.x + 4 + i, textAreaAt.y + 10);
94+
}
95+
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
96+
97+
robot.waitForIdle();
98+
if (textChanged) {
99+
throw new RuntimeException(
100+
"FAIL: TextEvent triggered when text is selected on TextArea!");
101+
}
102+
103+
textChanged = false;
104+
typeKey(KeyEvent.VK_F3);
105+
106+
robot.waitForIdle();
107+
if (textChanged) {
108+
throw new RuntimeException(
109+
"FAIL: TextEvent triggered when special key F3 is pressed on TextArea!");
110+
}
111+
System.out.println("Test passed!");
112+
} finally {
113+
EventQueue.invokeAndWait(TextAreaTextEventTest::disposeFrame);
114+
}
115+
}
116+
117+
private static void initializeGUI() {
118+
frame = new Frame("Test Frame");
119+
frame.setLayout(new FlowLayout());
120+
textArea = new TextArea(5, 15);
121+
textArea.addTextListener((event) -> {
122+
System.out.println("Got a text event: " + event);
123+
textChanged = true;
124+
});
125+
frame.add(textArea);
126+
frame.pack();
127+
frame.setLocationRelativeTo(null);
128+
frame.setVisible(true);
129+
}
130+
131+
public static void disposeFrame() {
132+
if (frame != null) {
133+
frame.dispose();
134+
}
135+
}
136+
137+
private static void typeKey(int key) throws Exception {
138+
robot.keyPress(key);
139+
robot.keyRelease(key);
140+
}
141+
}

test/jdk/javax/sound/midi/Sequencer/MetaCallback.java

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -31,13 +31,16 @@
3131
import javax.sound.midi.Sequencer;
3232
import javax.sound.midi.ShortMessage;
3333
import javax.sound.midi.Track;
34+
import java.util.ArrayList;
35+
import java.util.Collections;
36+
import java.util.List;
3437

3538
/**
3639
* @test
3740
* @bug 4347135
3841
* @summary MIDI MetaMessage callback inconsistent
3942
* @key intermittent sound
40-
* @run main/othervm MetaCallback
43+
* @run main/othervm/timeout=120 MetaCallback
4144
*/
4245
public class MetaCallback implements MetaEventListener {
4346

@@ -59,11 +62,15 @@ static ShortMessage MidiMsg3(int a, int b, int c) {
5962

6063
public static int TOTAL_COUNT = 100;
6164

62-
int metaCount = 0;
63-
boolean finished = false;
65+
volatile int metaCount = 0;
66+
volatile boolean finished = false;
67+
// On M1 Mac sometimes system notifies listener about the same message twice
68+
static List<MetaMessage> received = Collections.synchronizedList(new ArrayList<>());
69+
long startTimeMs;
6470

6571
MetaCallback() throws Exception {
6672

73+
startTimeMs = System.currentTimeMillis();
6774
sequencer=MidiSystem.getSequencer();
6875
sequence=new Sequence(Sequence.PPQ,240);
6976
track=sequence.createTrack();
@@ -101,13 +108,28 @@ static ShortMessage MidiMsg3(int a, int b, int c) {
101108
}
102109
}
103110
void start() {sequencer.start();}
104-
void stop() {sequencer.stop();}
111+
void stop() {
112+
sequencer.stop();
113+
sequencer.close();
114+
}
105115

106116
public void meta(MetaMessage msg) {
107117
System.out.println(""+metaCount+": got "+msg);
108118
if (msg.getType() == 0x2F) {
109119
finished = true;
110120
} else if (msg.getData().length > 0 && msg.getType() == 1) {
121+
if (!received.contains(msg)) {
122+
received.add(msg);
123+
} else {
124+
// Add some additional debug output for the case of duplicate meta message
125+
// The test will fail anyway at the end
126+
System.out.println("Duplicate message received after getting "
127+
+ received.size() + " messages.");
128+
System.out.println("Sequencer in use: " + sequencer);
129+
System.out.println("Time from test start: " +
130+
(System.currentTimeMillis() - startTimeMs) + "ms");
131+
Thread.dumpStack();
132+
}
111133
metaCount++;
112134
}
113135
}

0 commit comments

Comments
 (0)