Skip to content

Commit 6407c30

Browse files
author
Sergey Nazarkin
committedMar 10, 2025
Merge tag 'jdk8u452-b04'
2 parents 177bdc2 + 6a7d893 commit 6407c30

File tree

9 files changed

+49
-54
lines changed

9 files changed

+49
-54
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/build/
22
/dist/
33
/.idea/
4+
/.vscode/
45
nbproject/private/
56
/webrev
67
/.src-rev

‎hotspot/src/share/vm/jfr/recorder/repository/jfrEmergencyDump.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ static const char* create_emergency_chunk_path(const char* repository_path) {
306306
return NULL;
307307
}
308308
// append the individual substrings
309-
jio_snprintf(chunk_path, chunkname_max_len, "%s%s%s%s", repository_path_len, os::file_separator(), date_time_buffer, chunk_file_jfr_ext);
309+
jio_snprintf(chunk_path, chunkname_max_len, "%s%s%s%s", repository_path, os::file_separator(), date_time_buffer, chunk_file_jfr_ext);
310310
return chunk_path;
311311
}
312312

‎jdk/make/src/classes/build/tools/tzdb/TzdbZoneRulesCompiler.java

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2024, 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
@@ -248,16 +248,16 @@ private void outputFile(Path dstFile, String version,
248248
// link version-region-rules
249249
out.writeShort(builtZones.size());
250250
for (Map.Entry<String, ZoneRules> entry : builtZones.entrySet()) {
251-
int regionIndex = Arrays.binarySearch(regionArray, entry.getKey());
251+
int regionIndex = findRegionIndex(regionArray, entry.getKey());
252252
int rulesIndex = rulesList.indexOf(entry.getValue());
253253
out.writeShort(regionIndex);
254254
out.writeShort(rulesIndex);
255255
}
256256
// alias-region
257257
out.writeShort(links.size());
258258
for (Map.Entry<String, String> entry : links.entrySet()) {
259-
int aliasIndex = Arrays.binarySearch(regionArray, entry.getKey());
260-
int regionIndex = Arrays.binarySearch(regionArray, entry.getValue());
259+
int aliasIndex = findRegionIndex(regionArray, entry.getKey());
260+
int regionIndex = findRegionIndex(regionArray, entry.getValue());
261261
out.writeShort(aliasIndex);
262262
out.writeShort(regionIndex);
263263
}
@@ -284,6 +284,14 @@ private void outputFile(Path dstFile, String version,
284284
/** The built zones. */
285285
private final SortedMap<String, ZoneRules> builtZones = new TreeMap<>();
286286

287+
private static int findRegionIndex(String[] regionArray, String region) {
288+
int index = Arrays.binarySearch(regionArray, region);
289+
if (index < 0) {
290+
throw new IllegalArgumentException("Unknown region: " + region);
291+
}
292+
return index;
293+
}
294+
287295
/** Whether to output verbose messages. */
288296
private boolean verbose;
289297

@@ -632,6 +640,9 @@ private void buildZoneRules() throws Exception {
632640
builtZones.remove("EST");
633641
builtZones.remove("HST");
634642
builtZones.remove("MST");
643+
links.remove("EST");
644+
links.remove("HST");
645+
links.remove("MST");
635646
}
636647

637648
/**

‎jdk/test/com/sun/jdi/PrivateTransportTest.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,13 @@ elif [ -f ${libloc}/libdt_socket.dylib ]; then
148148
echo cp ${libloc}/libdt_socket.dylib ${fullpath}
149149
cp ${libloc}/libdt_socket.dylib ${fullpath}
150150
# make sure we can find libraries in current directory
151-
if [ "${LD_LIBRARY_PATH}" = "" ] ; then
152-
LD_LIBRARY_PATH=${libdir}
151+
if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then
152+
DYLD_LIBRARY_PATH=${libdir}
153153
else
154-
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${libdir}
154+
DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${libdir}
155155
fi
156-
export LD_LIBRARY_PATH
157-
echo LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
156+
export DYLD_LIBRARY_PATH
157+
echo DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}
158158
elif [ -f ${libloc}/libdt_socket.so ] ; then
159159
fullpath=${libdir}/lib${private_transport}.so
160160
rm -f ${fullpath}

‎jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ static void test_01() throws Exception {
500500
testConnect(ports[0]);
501501

502502
jcmd(CMD_STOP);
503-
testConnect(ports[0]);
503+
testNoConnect(ports[0]);
504504

505505
jcmd(CMD_START, "jmxremote.port=" + ports[1]);
506506
testConnect(ports[1]);

‎jdk/test/tools/jar/ExtractFilesTest.java

+14-20
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,7 @@
3131
* @run junit/othervm ExtractFilesTest
3232
*/
3333

34-
import org.junit.jupiter.api.AfterAll;
35-
import org.junit.jupiter.api.Assertions;
36-
import org.junit.jupiter.api.BeforeAll;
37-
import org.junit.jupiter.api.Test;
38-
import org.junit.jupiter.api.TestInstance;
39-
import org.junit.jupiter.api.TestInstance.Lifecycle;
34+
import org.junit.*;
4035

4136
import java.io.ByteArrayOutputStream;
4237
import java.io.IOException;
@@ -51,13 +46,12 @@
5146
import jdk.testlibrary.FileUtils;
5247
import sun.tools.jar.Main;
5348

54-
@TestInstance(Lifecycle.PER_CLASS)
5549
public class ExtractFilesTest {
5650
private final String nl = System.lineSeparator();
5751
private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
5852
private final PrintStream out = new PrintStream(baos);
5953

60-
@BeforeAll
54+
@Before
6155
public void setupJar() throws IOException {
6256
mkdir("test1 test2");
6357
echo("testfile1", "test1/testfile1");
@@ -66,7 +60,7 @@ public void setupJar() throws IOException {
6660
rm("test1 test2");
6761
}
6862

69-
@AfterAll
63+
@After
7064
public void cleanup() {
7165
rm("test.jar");
7266
}
@@ -83,7 +77,7 @@ public void testExtract() throws IOException {
8377
" inflated: testfile1" + nl +
8478
" inflated: testfile2" + nl;
8579
rm("META-INF testfile1 testfile2");
86-
Assertions.assertArrayEquals(baos.toByteArray(), output.getBytes());
80+
Assert.assertArrayEquals(baos.toByteArray(), output.getBytes());
8781
}
8882

8983
/**
@@ -98,9 +92,9 @@ public void testOverwrite() throws IOException {
9892
" inflated: META-INF/MANIFEST.MF" + nl +
9993
" inflated: testfile1" + nl +
10094
" inflated: testfile2" + nl;
101-
Assertions.assertEquals("testfile1", cat("testfile1"));
95+
Assert.assertEquals("testfile1", cat("testfile1"));
10296
rm("META-INF testfile1 testfile2");
103-
Assertions.assertArrayEquals(baos.toByteArray(), output.getBytes());
97+
Assert.assertArrayEquals(baos.toByteArray(), output.getBytes());
10498
}
10599

106100
/**
@@ -115,10 +109,10 @@ public void testKeptOldFile() throws IOException {
115109
" inflated: META-INF/MANIFEST.MF" + nl +
116110
" skipped: testfile1 exists" + nl +
117111
" inflated: testfile2" + nl;
118-
Assertions.assertEquals("", cat("testfile1"));
119-
Assertions.assertEquals("testfile2", cat("testfile2"));
112+
Assert.assertEquals("", cat("testfile1"));
113+
Assert.assertEquals("testfile2", cat("testfile2"));
120114
rm("META-INF testfile1 testfile2");
121-
Assertions.assertArrayEquals(baos.toByteArray(), output.getBytes());
115+
Assert.assertArrayEquals(baos.toByteArray(), output.getBytes());
122116
}
123117

124118
/**
@@ -133,10 +127,10 @@ public void testGnuOptionsKeptOldFile() throws IOException {
133127
" inflated: META-INF/MANIFEST.MF" + nl +
134128
" skipped: testfile1 exists" + nl +
135129
" skipped: testfile2 exists" + nl;
136-
Assertions.assertEquals("", cat("testfile1"));
137-
Assertions.assertEquals("", cat("testfile2"));
130+
Assert.assertEquals("", cat("testfile1"));
131+
Assert.assertEquals("", cat("testfile2"));
138132
rm("META-INF testfile1 testfile2");
139-
Assertions.assertArrayEquals(baos.toByteArray(), output.getBytes());
133+
Assert.assertArrayEquals(baos.toByteArray(), output.getBytes());
140134
}
141135

142136
/**
@@ -152,8 +146,8 @@ public void testWarningOnInvalidKeepOption() throws IOException {
152146
"testfile1" + nl +
153147
"testfile2" + nl;
154148

155-
Assertions.assertArrayEquals(baos.toByteArray(), output.getBytes());
156-
Assertions.assertEquals("Warning: The k option is not valid with current usage, will be ignored." + nl, err);
149+
Assert.assertArrayEquals(baos.toByteArray(), output.getBytes());
150+
Assert.assertEquals("Warning: The k option is not valid with current usage, will be ignored." + nl, err);
157151
}
158152

159153
private Stream<Path> mkpath(String... args) {

‎jdk/test/tools/jar/MultipleManifestTest.java

+10-21
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,7 @@
3333

3434
import java.io.ByteArrayOutputStream;
3535

36-
import org.junit.jupiter.api.AfterAll;
37-
import org.junit.jupiter.api.AfterEach;
38-
import org.junit.jupiter.api.Assertions;
39-
import org.junit.jupiter.api.BeforeAll;
40-
import org.junit.jupiter.api.Test;
41-
import org.junit.jupiter.api.TestInstance;
42-
import org.junit.jupiter.api.TestInstance.Lifecycle;
36+
import org.junit.*;
4337

4438
import java.io.IOException;
4539
import java.io.InputStream;
@@ -60,8 +54,7 @@
6054
import jdk.testlibrary.FileUtils;
6155
import sun.tools.jar.Main;
6256

63-
@TestInstance(Lifecycle.PER_CLASS)
64-
class MultipleManifestTest {
57+
public class MultipleManifestTest {
6558
private final String nl = System.lineSeparator();
6659
private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
6760
private final PrintStream jarOut = new PrintStream(baos);
@@ -85,8 +78,9 @@ class MultipleManifestTest {
8578
*
8679
* @throws IOException if an unexpected IOException occurs
8780
*/
88-
@AfterAll
81+
@After
8982
public void cleanup() throws IOException {
83+
rm("META-INF entry1.txt entry2.txt");
9084
Files.deleteIfExists(zip);
9185
}
9286

@@ -95,7 +89,7 @@ public void cleanup() throws IOException {
9589
*
9690
* @throws IOException if an error occurs
9791
*/
98-
@BeforeAll
92+
@Before
9993
public void writeManifestAsFirstSecondAndFourthEntry() throws IOException {
10094
int locPosA, locPosB, cenPos;
10195
System.out.printf("%n%n*****Creating Jar with the Manifest as the 1st, 2nd and 4th entry*****%n%n");
@@ -132,25 +126,20 @@ public void writeManifestAsFirstSecondAndFourthEntry() throws IOException {
132126
Files.write(zip, template);
133127
}
134128

135-
@AfterEach
136-
public void removeExtractedFiles() {
137-
rm("META-INF entry1.txt entry2.txt");
138-
}
139-
140129
/**
141130
* Extract by default should have the last manifest.
142131
*/
143132
@Test
144133
public void testOverwrite() throws IOException {
145134
jar("xvf " + zip.toString());
146135
println();
147-
Assertions.assertEquals("3.0", getManifestVersion());
136+
Assert.assertEquals("3.0", getManifestVersion());
148137
String output = " inflated: META-INF/MANIFEST.MF" + nl +
149138
" inflated: META-INF/MANIFEST.MF" + nl +
150139
" inflated: entry1.txt" + nl +
151140
" inflated: META-INF/MANIFEST.MF" + nl +
152141
" inflated: entry2.txt" + nl;
153-
Assertions.assertArrayEquals(baos.toByteArray(), output.getBytes());
142+
Assert.assertArrayEquals(baos.toByteArray(), output.getBytes());
154143
}
155144

156145
/**
@@ -160,13 +149,13 @@ public void testOverwrite() throws IOException {
160149
public void testKeptOldFile() throws IOException {
161150
jar("xkvf " + zip.toString());
162151
println();
163-
Assertions.assertEquals("1.0", getManifestVersion());
152+
Assert.assertEquals("1.0", getManifestVersion());
164153
String output = " inflated: META-INF/MANIFEST.MF" + nl +
165154
" skipped: META-INF/MANIFEST.MF exists" + nl +
166155
" inflated: entry1.txt" + nl +
167156
" skipped: META-INF/MANIFEST.MF exists" + nl +
168157
" inflated: entry2.txt" + nl;
169-
Assertions.assertArrayEquals(baos.toByteArray(), output.getBytes());
158+
Assert.assertArrayEquals(baos.toByteArray(), output.getBytes());
170159
}
171160

172161
private String getManifestVersion() throws IOException {
@@ -216,4 +205,4 @@ private void rm(String cmdline) {
216205
}
217206
});
218207
}
219-
}
208+
}

‎langtools/test/tools/javac/6257443/T6257443.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* @compile package-info.java
3030
* @run main/othervm T6257443 -yes foo/package-info.class
3131
*
32-
* @clean foo.package-info
32+
* @clean foo.*
3333
*
3434
* @compile -XD-printflat package-info.java
3535
* @run main/othervm T6257443 -no foo/package-info.class

‎langtools/test/tools/javac/warnings/suppress/PackageInfo.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
* @test
2626
* @bug 8021112
2727
* @summary Verify that deprecated warnings are printed correctly for package-info.java
28-
* @clean pack.package-info pack.DeprecatedClass
28+
* @clean pack.*
2929
* @compile/ref=PackageInfo.out -XDrawDiagnostics -Xlint:deprecation pack/package-info.java pack/DeprecatedClass.java
3030
*/

0 commit comments

Comments
 (0)
Please sign in to comment.