Skip to content

Commit 74d7e96

Browse files
authored
Merge pull request #2172 from SAP/pr-jdk-26+34
Merge to tag jdk-26+34
2 parents 2aa9c33 + dc46cc6 commit 74d7e96

5 files changed

Lines changed: 67 additions & 8 deletions

File tree

make/conf/version-numbers.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ DEFAULT_VERSION_CLASSFILE_MINOR=0
3939
DEFAULT_VERSION_DOCS_API_SINCE=11
4040
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="25 26"
4141
DEFAULT_JDK_SOURCE_TARGET_VERSION=26
42-
DEFAULT_PROMOTED_VERSION_PRE=ea
42+
DEFAULT_PROMOTED_VERSION_PRE=

src/java.base/share/classes/sun/security/util/CryptoAlgorithmConstraints.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2025, 2026, 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
@@ -82,8 +82,10 @@ public static boolean permits(String service, String algo) {
8282
CryptoAlgorithmConstraints(String propertyName) {
8383
super(null);
8484
disabledServices = getAlgorithms(propertyName, true);
85-
debug("Before " + Arrays.deepToString(disabledServices.toArray()));
86-
for (String dk : disabledServices) {
85+
String[] entries = disabledServices.toArray(new String[0]);
86+
debug("Before " + Arrays.deepToString(entries));
87+
88+
for (String dk : entries) {
8789
int idx = dk.indexOf(".");
8890
if (idx < 1 || idx == dk.length() - 1) {
8991
// wrong syntax: missing "." or empty service or algorithm

src/java.desktop/share/classes/javax/swing/JPopupMenu.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2026, 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
@@ -960,7 +960,9 @@ public void setInvoker(Component invoker) {
960960
if (oldInvoker != null) {
961961
oldInvoker.removePropertyChangeListener("ancestor", propListener);
962962
}
963-
invoker.addPropertyChangeListener("ancestor", propListener);
963+
if (invoker != null) {
964+
invoker.addPropertyChangeListener("ancestor", propListener);
965+
}
964966
ui.installUI(this);
965967
}
966968
invalidate();
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright (c) 2026, 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+
/**
25+
* @test
26+
* @bug 8375549
27+
* @summary Test JCE layer algorithm restriction using algorithms w/ oids
28+
* @library /test/lib
29+
* @run main/othervm -Djdk.crypto.disabledAlgorithms=Cipher.DES,Cipher.RSA/ECB/PKCS1Padding TestDisabledWithOids
30+
* @run main/othervm -Djdk.crypto.disabledAlgorithms=Cipher.RSA/ECB/PKCS1Padding,Cipher.DES TestDisabledWithOids
31+
*/
32+
import java.security.NoSuchAlgorithmException;
33+
import javax.crypto.Cipher;
34+
import jdk.test.lib.Utils;
35+
36+
public class TestDisabledWithOids {
37+
public static void main(String[] args) throws Exception {
38+
String algo1 = "RSA/ECB/PKCS1Padding";
39+
String algo2 = "DES";
40+
41+
Utils.runAndCheckException(() -> Cipher.getInstance(algo1),
42+
NoSuchAlgorithmException.class);
43+
Utils.runAndCheckException(() -> Cipher.getInstance(algo2),
44+
NoSuchAlgorithmException.class);
45+
System.out.println("Done");
46+
}
47+
}

test/jdk/javax/swing/JPopupMenu/TestPopupInvoker.java

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

2424
/*
2525
* @test
26-
* @bug 4938801
26+
* @bug 4938801 8376169
2727
* @key headful
2828
* @summary Verifies popup is removed when the component is removed
2929
* @run main TestPopupInvoker
3030
*/
3131

3232
import java.awt.BorderLayout;
33+
import java.awt.Component;
3334
import java.awt.Container;
3435
import java.awt.Robot;
3536
import java.util.concurrent.CountDownLatch;
@@ -48,6 +49,7 @@ public class TestPopupInvoker {
4849
static JFrame frame;
4950
static JLabel label;
5051
static Container pane;
52+
static volatile Component invoker;
5153

5254
private static final CountDownLatch popupShown = new CountDownLatch(1);
5355
private static final CountDownLatch popupHidden = new CountDownLatch(1);
@@ -73,6 +75,7 @@ public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
7375
@Override
7476
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
7577
popupHidden.countDown();
78+
popupMenu.setInvoker(null);
7679
}
7780

7881
@Override
@@ -106,6 +109,11 @@ public static void main(String[] args) throws Exception {
106109
if (!popupHidden.await(1, SECONDS)) {
107110
throw new RuntimeException("Popup is visible after component is removed");
108111
}
112+
113+
SwingUtilities.invokeAndWait(() -> invoker = popupMenu.getInvoker());
114+
if (invoker != null) {
115+
throw new RuntimeException("Invoker is not null");
116+
}
109117
} finally {
110118
SwingUtilities.invokeAndWait(() -> {
111119
if (frame != null) {

0 commit comments

Comments
 (0)