Skip to content

Commit cb76ba4

Browse files
authored
Merge pull request #1963 from SAP/pr-jdk-21.0.8+2
Merge to tag jdk-21.0.8+2
2 parents 7b4d4db + 96f7dbf commit cb76ba4

File tree

51 files changed

+181
-176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+181
-176
lines changed

src/hotspot/os/linux/os_linux.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@
141141

142142
#define MAX_PATH (2 * K)
143143

144-
#define MAX_SECS 100000000
145-
146144
// for timer info max values which include all bits
147145
#define ALL_64_BITS CONST64(0xFFFFFFFFFFFFFFFF)
148146

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,10 @@ private Type recover(DeferredType dt, Type pt) {
10891089
boolean isLambdaOrMemberRef =
10901090
dt.tree.hasTag(REFERENCE) || dt.tree.hasTag(LAMBDA);
10911091
boolean needsRecoveryType =
1092-
pt == null || (isLambdaOrMemberRef && !types.isFunctionalInterface(pt));
1092+
pt == null ||
1093+
((dt instanceof ArgumentAttr.ArgumentType<?> at) &&
1094+
at.speculativeTypes.values().stream().allMatch(type -> type.hasTag(ERROR))) ||
1095+
(isLambdaOrMemberRef && !types.isFunctionalInterface(pt));
10931096
Type ptRecovery = needsRecoveryType ? Type.recoveryType: pt;
10941097
dt.check(attr.new RecoveryInfo(deferredAttrContext, ptRecovery) {
10951098
@Override

test/hotspot/jtreg/runtime/os/windows/TestAvailableProcessors.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2024, 2025, 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,18 +31,14 @@
3131
* @requires vm.flagless
3232
* @library /test/lib
3333
* @compile GetAvailableProcessors.java
34-
* @run testng TestAvailableProcessors
34+
* @run testng/othervm/native TestAvailableProcessors
3535
*/
3636

3737
import java.io.IOException;
38-
import java.nio.file.Path;
39-
import java.nio.file.Paths;
40-
import java.util.ArrayList;
4138
import java.util.List;
4239
import java.util.HashSet;
4340
import java.util.Set;
4441

45-
import jdk.test.lib.Utils;
4642
import jdk.test.lib.process.OutputAnalyzer;
4743
import jdk.test.lib.process.ProcessTools;
4844

@@ -172,12 +168,8 @@ private static void verifyAvailableProcessorsWithEnabledProductFlag(boolean sche
172168

173169
@Test
174170
private static void testProcessorAvailability() throws IOException {
175-
// Launch GetProcessorInfo.exe to gather processor counts
176-
Path nativeGetProcessorInfo = Paths.get(Utils.TEST_NATIVE_PATH)
177-
.resolve("GetProcessorInfo.exe")
178-
.toAbsolutePath();
179-
180-
var processBuilder = new ProcessBuilder(nativeGetProcessorInfo.toString());
171+
// Launch "<nativepath>/GetProcessorInfo.exe" to gather processor counts
172+
var processBuilder = new ProcessBuilder("GetProcessorInfo.exe");
181173
var outputAnalyzer= new OutputAnalyzer(processBuilder.start());
182174
outputAnalyzer.shouldHaveExitValue(0);
183175
outputAnalyzer.shouldContain(totalProcessorCountMessage);

test/hotspot/jtreg/vmTestbase/nsk/share/jdb/JdbTest.java

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -204,37 +204,34 @@ protected int runTest(String argv[], PrintStream out) {
204204
}
205205
}
206206

207-
} catch (Exception e) {
208-
failure("Caught unexpected exception: " + e);
209-
e.printStackTrace(out);
210-
207+
} catch (Throwable t) {
208+
failure("Caught unexpected exception: " + t);
209+
t.printStackTrace(out);
210+
} finally {
211211
if (jdb != null) {
212+
log.complain("jdb reference is not null, check for exception in the logs.");
212213
try {
213214
jdb.close();
214215
} catch (Throwable ex) {
215216
failure("Caught exception/error while closing jdb streams:\n\t" + ex);
216217
ex.printStackTrace(log.getOutStream());
217218
}
218-
} else {
219-
log.complain("jdb reference is null, cannot run jdb.close() method");
220219
}
221220

222-
if (debuggee != null) {
221+
if (debuggee != null && !debuggee.terminated()) {
222+
log.complain("debuggee is still running, check for exception in the logs.");
223223
debuggee.killDebuggee();
224-
} else {
225-
log.complain("debuggee reference is null, cannot run debuggee.killDebuggee() method");
226224
}
227-
228225
}
229226

230227
if (!success) {
231228
log.complain("TEST FAILED");
232229
return FAILED;
233230
}
234231

235-
} catch (Exception e) {
236-
out.println("Caught unexpected exception while starting the test: " + e);
237-
e.printStackTrace(out);
232+
} catch (Throwable t) {
233+
out.println("Caught unexpected exception while starting the test: " + t);
234+
t.printStackTrace(out);
238235
out.println("TEST FAILED");
239236
return FAILED;
240237
}

test/hotspot/jtreg/vmTestbase/nsk/share/LocalProcess.java renamed to test/hotspot/jtreg/vmTestbase/nsk/share/jdb/LocalProcess.java

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 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
@@ -21,9 +21,7 @@
2121
* questions.
2222
*/
2323

24-
package nsk.share;
25-
26-
import nsk.share.*;
24+
package nsk.share.jdb;
2725

2826
import java.io.*;
2927

@@ -33,14 +31,9 @@
3331
* This class provides abilities to launch such process,
3432
* redirect standard output streams, wait for process terminates
3533
* or kill the process, and so on.
36-
* <p>
37-
* This object is finalized with <code>nsk.share.Finalizer</code>.
38-
*
39-
* @see nsk.share.FinalizableObject
40-
* @see nsk.share.Finalizer
4134
*/
4235

43-
public class LocalProcess extends FinalizableObject {
36+
class LocalProcess {
4437

4538
public final static int PROCESS_IS_ALIVE = 222;
4639

@@ -59,16 +52,11 @@ public void launch (String[] args) throws IOException {
5952
}
6053

6154
process = Runtime.getRuntime().exec(args);
62-
63-
registerCleanup();
6455
}
6556

6657
public void launch (String cmdLine) throws IOException {
6758
System.out.println("Launching process by command line: " + cmdLine);
68-
6959
process = Runtime.getRuntime().exec(cmdLine);
70-
71-
registerCleanup();
7260
}
7361

7462
/** Return exit status. */
@@ -163,12 +151,4 @@ protected void kill() {
163151
process.destroy();
164152
}
165153

166-
/**
167-
* This method is called at finalization and calls <code>kill()</code>.
168-
*
169-
*/
170-
@Override
171-
public void cleanup() {
172-
kill();
173-
}
174154
}

test/jdk/com/sun/security/auth/callback/TextCallbackHandler/Default.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2025, 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
@@ -23,7 +23,7 @@
2323

2424
/*
2525
* @test
26-
* @library /test/lib /java/security/testlibrary
26+
* @library /test/lib
2727
* @bug 4470717
2828
* @summary fix default handling and other misc
2929
* @run main/othervm Default
@@ -34,6 +34,7 @@
3434

3535
import javax.security.auth.callback.*;
3636
import java.io.*;
37+
import jdk.test.lib.security.HumanInputStream;
3738

3839
public class Default {
3940
public static void main(String args[]) throws Exception {

test/jdk/com/sun/tools/attach/Agent.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 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
@@ -28,6 +28,7 @@
2828
* the given port.
2929
*/
3030
import java.net.Socket;
31+
import java.net.InetAddress;
3132
import java.net.InetSocketAddress;
3233
import java.io.IOException;
3334

@@ -38,7 +39,7 @@ public static void agentmain(String args) throws IOException {
3839
int port = Integer.parseInt(args);
3940
System.out.println("Agent connecting back to Tool....");
4041
Socket s = new Socket();
41-
s.connect( new InetSocketAddress(port) );
42+
s.connect(new InetSocketAddress(InetAddress.getLoopbackAddress(), port));
4243
System.out.println("Agent connected to Tool.");
4344
s.close();
4445
}

test/jdk/com/sun/tools/attach/BasicTests.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
import java.io.File;
2525
import java.io.IOException;
26+
import java.net.InetAddress;
27+
import java.net.InetSocketAddress;
2628
import java.net.ServerSocket;
2729
import java.net.Socket;
2830
import java.util.List;
@@ -213,7 +215,8 @@ public static void main(String args[]) throws Exception {
213215

214216
System.out.println(" - Test: End-to-end connection with agent");
215217

216-
ServerSocket ss = new ServerSocket(0);
218+
ServerSocket ss = new ServerSocket();
219+
ss.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0));
217220
int port = ss.getLocalPort();
218221

219222
System.out.println(" - Loading Agent.jar into target VM ...");
@@ -231,7 +234,8 @@ public static void main(String args[]) throws Exception {
231234

232235
System.out.println(" - Test: End-to-end connection with RedefineAgent");
233236

234-
ServerSocket ss2 = new ServerSocket(0);
237+
ServerSocket ss2 = new ServerSocket();
238+
ss2.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0));
235239
int port2 = ss2.getLocalPort();
236240

237241
System.out.println(" - Loading RedefineAgent.jar into target VM ...");

test/jdk/com/sun/tools/attach/RedefineAgent.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2006, 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
@@ -32,6 +32,7 @@
3232
* 6446941 java.lang.instrument: multiple agent attach fails (first agent chooses capabilities)
3333
*/
3434
import java.net.Socket;
35+
import java.net.InetAddress;
3536
import java.net.InetSocketAddress;
3637
import java.io.IOException;
3738
import java.util.Arrays;
@@ -104,7 +105,7 @@ public static void agentmain(String args, Instrumentation inst) throws Exception
104105
int port = Integer.parseInt(args);
105106
System.out.println("RedefineAgent connecting back to Tool....");
106107
Socket s = new Socket();
107-
s.connect( new InetSocketAddress(port) );
108+
s.connect(new InetSocketAddress(InetAddress.getLoopbackAddress(), port));
108109
System.out.println("RedefineAgent connected to Tool.");
109110

110111
testRedefine(inst);

test/jdk/java/security/KeyFactory/Failover.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, 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,16 +24,16 @@
2424
/**
2525
* @test
2626
* @bug 4894125 7054918 8130181
27-
* @library ../testlibrary /test/lib
27+
* @library /test/lib
2828
* @summary test that failover for KeyFactory works
2929
* @author Andreas Sterbenz
3030
*/
3131

3232
import java.util.*;
3333

3434
import java.security.*;
35-
import java.security.interfaces.*;
3635
import java.security.spec.*;
36+
import jdk.test.lib.security.ProvidersSnapshot;
3737
import jdk.test.lib.security.SecurityUtils;
3838

3939
public class Failover {

test/jdk/java/security/KeyPairGenerator/Failover.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, 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,16 +24,16 @@
2424
/**
2525
* @test
2626
* @bug 4894125 7054918 8130181
27-
* @library ../testlibrary
27+
* @library /test/lib
2828
* @summary test that failover for KeyPairGenerator works
2929
* @author Andreas Sterbenz
3030
*/
3131

3232
import java.util.*;
3333

3434
import java.security.*;
35-
import java.security.interfaces.*;
3635
import java.security.spec.*;
36+
import jdk.test.lib.security.ProvidersSnapshot;
3737

3838
public class Failover {
3939

test/jdk/java/security/Provider/ChangeProviders.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, 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,14 +24,13 @@
2424
/*
2525
* @test
2626
* @bug 4856968 7054918 8130181
27-
* @library ../testlibrary
27+
* @library /test/lib
2828
* @summary make sure add/insert/removeProvider() work correctly
2929
* @author Andreas Sterbenz
3030
*/
3131

32-
import java.util.*;
33-
3432
import java.security.*;
33+
import jdk.test.lib.security.ProvidersSnapshot;
3534

3635
public class ChangeProviders extends Provider {
3736

test/jdk/java/security/Provider/GetInstance.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, 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
/*
2525
* @test
2626
* @bug 4856968 7054918 8130181
27-
* @library ../testlibrary
27+
* @library /test/lib
2828
* @summary make sure getInstance() works correctly, including failover
2929
* and delayed provider selection for Signatures
3030
* @author Andreas Sterbenz
@@ -34,6 +34,7 @@
3434

3535
import java.security.*;
3636
import java.security.cert.*;
37+
import jdk.test.lib.security.ProvidersSnapshot;
3738

3839
public class GetInstance {
3940

test/jdk/java/security/Provider/GetServiceRace.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2025, 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,6 @@
2424
/*
2525
* @test
2626
* @bug 8231387
27-
* @library ../testlibrary
2827
* @summary make sure getService() avoids a race
2928
* @author Tianmin Shi
3029
*/

0 commit comments

Comments
 (0)