Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master HEAD into openj9-staging #902

Merged
merged 41 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
58966fa
Fix profiles with same name beginnings being treated as one
taoliult Nov 14, 2024
8b109db
8345279: Mistake in javadoc of javax.sql.rowset.BaseRowSet#setBigDecimal
jaikiran Dec 3, 2024
1494a3c
8345141: Remove uses of SecurityManager in ShellFolder related classes
prrace Dec 3, 2024
47a9223
7038838: Unspecified NPE in java.net.IDN methods
jaikiran Dec 3, 2024
235447b
8235786: Javadoc for com/sun/net/httpserver/HttpExchange.java#setAttr…
jaikiran Dec 3, 2024
8054c42
8345297: test/jdk/javax/swing/Action/8133039/bug8133039.java fails in…
prsadhuk Dec 3, 2024
8050636
8343791: Socket.connect API should document whether the socket will b…
vy Dec 3, 2024
148e1a6
8337199: Add jcmd Thread.vthread_scheduler and Thread.vthread_pollers…
Dec 3, 2024
1ccc367
8343418: Unnecessary Hashtable usage in CSS.htmlAttrToCssAttrMap
Dec 3, 2024
b682aaa
8345120: A likely bug in StringSupport::chunkedStrlenShort
minborg Dec 3, 2024
1209356
8343780: Add since checker tests to the Tools area modules and add mi…
nizarbenalla Dec 3, 2024
1f0ae11
8343932: Error when parsing qualified generic type test pattern in sw…
biboudis Dec 3, 2024
f062ab9
8345074: java.net.InterfaceAddress constructor could be made private
Dec 3, 2024
03675a1
8336768: Allow captureCallState and critical linker options to be com…
JornVernee Dec 3, 2024
9683a66
8345158: IGV: local scheduling should not place successors before pre…
danielogh Dec 3, 2024
feafaed
8345164: Remove residual --enable-preview in FFM tests and benchmarks
minborg Dec 3, 2024
1d0fbda
8345396: Fix headers after JDK-8345164
minborg Dec 3, 2024
e21e4d7
Merge pull request #887 from taoliult/bugfix-profilename
keithc-ca Dec 3, 2024
b52d1e8
8345325: SM cleanup of GetPropertyAction in java.base
Dec 3, 2024
82f09c3
8342602: Remove JButton/PressedButtonRightClickTest test
aivanov-jdk Dec 3, 2024
1c7c57e
8337287: Update image in javax.swing.text.Document.insert
aivanov-jdk Dec 3, 2024
c9f2d98
8341649: Regressions with large metaspace apps after 8338526
coleenp Dec 3, 2024
8027681
8345393: ProblemList java/util/concurrent/locks/StampedLock/OOMEInSta…
Dec 3, 2024
3f37f1d
Modify JSR166TestCase to gather more error information
theresa-m Nov 28, 2024
fd70639
8342089: Require --enable-native-access to be the same between CDS du…
Dec 3, 2024
02a924f
8342086: FileInputStream.available() fails with "Incorrect function" …
Dec 3, 2024
b1c0c6b
8345319: Fix the tag type in PoolEntry and AnnotationValue
liach Dec 3, 2024
5c5434f
Merge pull request #898 from theresa-m/jsr166details
keithc-ca Dec 3, 2024
fc41ebf
8344589: Update IANA Language Subtag Registry to Version 2024-11-19
Dec 3, 2024
b7cbc58
8344368: IndependenceSwingTest.java and IndependenceAWTTest.java fail…
Dec 3, 2024
d9882b5
8343736: Test java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.…
Dec 3, 2024
c184049
8324491: Keyboard layout didn't keep its state if it was changed when…
dmarkov20 Dec 3, 2024
0fd0987
8345221: Replace legacy with new Provider APIs in SunNativeGSS
franferrax Dec 3, 2024
31d3be8
8345389: Bump missed copyright years for JDK-8336768
JornVernee Dec 3, 2024
373ea3a
8344987: Test serviceability/sa/TestJhsdbJstackPrintVMLocks.java fail…
lmesnik Dec 3, 2024
9ebcb33
8343839: Detect patched modules and abort run-time image link early
jerboaa Dec 3, 2024
57dd43e
8345415: Rollback JDK-8301991 change on xmlsecurity_de.properties
wangweij Dec 3, 2024
7988ed4
8345341: Fix incorrect log message in JDI stop002t test
plummercj Dec 4, 2024
70319e7
Merge latest openjdk
j9build Dec 4, 2024
ce182bb
Merge latest openj9 into openj9-staging
JasonFengJ9 Dec 4, 2024
40c1830
Merge master HEAD into openj9-staging
JasonFengJ9 Dec 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
import jdk.internal.reflect.Reflection;
import jdk.internal.reflect.CallerSensitive;

import sun.security.action.GetPropertyAction;

/*[IF CRIU_SUPPORT]*/
import openj9.internal.criu.InternalCRIUSupport;
/*[ENDIF] CRIU_SUPPORT */
Expand Down Expand Up @@ -65,10 +63,10 @@ public class NativeCrypto {
private static final Cleaner ECKeyCleaner = CleanerFactory.cleaner();

private static final boolean useNativeCrypto = Boolean.parseBoolean(
GetPropertyAction.privilegedGetProperty("jdk.nativeCrypto", "true"));
System.getProperty("jdk.nativeCrypto", "true"));

private static final boolean traceEnabled = Boolean.parseBoolean(
GetPropertyAction.privilegedGetProperty("jdk.nativeCryptoTrace", "false"));
System.getProperty("jdk.nativeCryptoTrace", "false"));

private static final class InstanceHolder {
private static final NativeCrypto instance = new NativeCrypto();
Expand Down Expand Up @@ -160,7 +158,7 @@ public static final boolean isAlgorithmEnabled(String property, String name) {
boolean useNativeAlgorithm = false;
if (useNativeCrypto) {
useNativeAlgorithm = Boolean.parseBoolean(
GetPropertyAction.privilegedGetProperty(property, "true"));
System.getProperty(property, "true"));
}
/*
* User wants to use the native crypto implementation. Ensure that the native crypto library is enabled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,10 @@ private static void getProfileID(Properties props) {
}
String defaultMatch = null;
boolean profileExists = false;
String profilePrefix = potentialProfileID + '.';
for (Object keyObject : props.keySet()) {
if (keyObject instanceof String key) {
if (key.startsWith(potentialProfileID)) {
if (key.startsWith(profilePrefix)) {
profileExists = true;
if (key.endsWith(".desc.default")) {
// Check if property is set to true.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import java.security.interfaces.*;

import javax.crypto.BadPaddingException;
import sun.security.action.GetPropertyAction;
import jdk.crypto.jniprovider.NativeCrypto;

import sun.security.jca.JCAUtil;
Expand Down
22 changes: 22 additions & 0 deletions closed/test/jdk/openj9/internal/security/TestProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@

public class TestProperties {

private static Stream<Arguments> patternMatches_expectedExitValue0() {
return Stream.of(
// 1 - Test property - Same beginnings of the profile name without version.
Arguments.of("Test-Profile-SameStartWithoutVersion",
System.getProperty("test.src") + "/property-java.security",
"(?s)(?=.*Sun)(?=.*\\bSunJCE\\b)(?=.*SunJSSE)")
);
}

private static Stream<Arguments> patternMatches_expectedExitValue1() {
return Stream.of(
// 1 - Test profile - base profile misspell properties.
Expand Down Expand Up @@ -155,6 +164,19 @@ private static Stream<Arguments> patternMatches_expectedExitValue1() {
);
}

@ParameterizedTest
@MethodSource("patternMatches_expectedExitValue0")
public void shouldContain_expectedExitValue0(String customprofile, String securityPropertyFile, String expected) throws Exception {
OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava(
"-Dsemeru.fips=true",
"-Dsemeru.customprofile=" + customprofile,
"-Djava.security.properties=" + securityPropertyFile,
"TestProperties"
);
outputAnalyzer.reportDiagnosticSummary();
outputAnalyzer.shouldHaveExitValue(0).shouldMatch(expected);
}

@ParameterizedTest
@MethodSource("patternMatches_expectedExitValue1")
public void shouldContain_expectedExitValue1(String customprofile, String securityPropertyFile, String expected) throws Exception {
Expand Down
36 changes: 36 additions & 0 deletions closed/test/jdk/openj9/internal/security/property-java.security
Original file line number Diff line number Diff line change
Expand Up @@ -525,3 +525,39 @@ RestrictedSecurity.Test-Profile-ConstraintChanged_3.Base.jce.provider.1 = com.s

RestrictedSecurity.Test-Profile-ConstraintChanged_3.Base.securerandom.provider = OpenJCEPlusFIPS
RestrictedSecurity.Test-Profile-ConstraintChanged_3.Base.securerandom.algorithm = SHA512DRBG

#
# Test-Profile-SameStartWithoutVersion
# Test property - Same beginnings of the profile name without version
#
RestrictedSecurity.Test-Profile-SameStartWithoutVersion.desc.name = Test-Profile-SameStartWithoutVersion
RestrictedSecurity.Test-Profile-SameStartWithoutVersion.desc.default = true
RestrictedSecurity.Test-Profile-SameStartWithoutVersion.desc.fips = true
RestrictedSecurity.Test-Profile-SameStartWithoutVersion.desc.hash = SHA256:2c893d75043da09c3dba8d8b24cb71dc1c7ceac5fb8bf362a35847418a933a06
RestrictedSecurity.Test-Profile-SameStartWithoutVersion.desc.number = Certificate #XXX
RestrictedSecurity.Test-Profile-SameStartWithoutVersion.desc.policy = https://csrc.nist.gov/projects/cryptographic-module-validation-program/certificate/
RestrictedSecurity.Test-Profile-SameStartWithoutVersion.desc.sunsetDate = 2026-09-21
RestrictedSecurity.Test-Profile-SameStartWithoutVersion.fips.mode = 140-3

RestrictedSecurity.Test-Profile-SameStartWithoutVersion.jce.provider.1 = sun.security.provider.Sun
RestrictedSecurity.Test-Profile-SameStartWithoutVersion.jce.provider.2 = com.sun.crypto.provider.SunJCE
RestrictedSecurity.Test-Profile-SameStartWithoutVersion.jce.provider.3 = sun.security.ssl.SunJSSE

RestrictedSecurity.Test-Profile-SameStartWithoutVersion.securerandom.provider = OpenJCEPlusFIPS
RestrictedSecurity.Test-Profile-SameStartWithoutVersion.securerandom.algorithm = SHA512DRBG

RestrictedSecurity.Test-Profile-SameStartWithoutVersionPart.desc.name = Test-Profile-SameStartWithoutVersionPart
RestrictedSecurity.Test-Profile-SameStartWithoutVersionPart.desc.default = true
RestrictedSecurity.Test-Profile-SameStartWithoutVersionPart.desc.fips = true
RestrictedSecurity.Test-Profile-SameStartWithoutVersionPart.desc.hash = SHA256:2c893d75043da09c3dba8d8b24cb71dc1c7ceac5fb8bf362a35847418a933a06
RestrictedSecurity.Test-Profile-SameStartWithoutVersionPart.desc.number = Certificate #XXX
RestrictedSecurity.Test-Profile-SameStartWithoutVersionPart.desc.policy = https://csrc.nist.gov/projects/cryptographic-module-validation-program/certificate/
RestrictedSecurity.Test-Profile-SameStartWithoutVersionPart.desc.sunsetDate = 2026-09-21
RestrictedSecurity.Test-Profile-SameStartWithoutVersionPart.fips.mode = 140-3

RestrictedSecurity.Test-Profile-SameStartWithoutVersionPart.jce.provider.1 = sun.security.provider.Sun
RestrictedSecurity.Test-Profile-SameStartWithoutVersionPart.jce.provider.2 = com.sun.crypto.provider.SunJCE
RestrictedSecurity.Test-Profile-SameStartWithoutVersionPart.jce.provider.3 = sun.security.ssl.SunJSSE

RestrictedSecurity.Test-Profile-SameStartWithoutVersionPart.securerandom.provider = OpenJCEPlusFIPS
RestrictedSecurity.Test-Profile-SameStartWithoutVersionPart.securerandom.algorithm = SHA512DRBG
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

import jdk.crypto.jniprovider.NativeCrypto;
import jdk.internal.util.StaticProperty;
import sun.security.action.GetPropertyAction;

/*
* The "SunJCE" Cryptographic Service Provider.
Expand Down
3 changes: 1 addition & 2 deletions src/java.base/share/classes/java/lang/ScopedValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.annotation.Hidden;
import jdk.internal.vm.ScopedValueContainer;
import sun.security.action.GetPropertyAction;

/**
* A value that may be safely and efficiently shared to methods without using method
Expand Down Expand Up @@ -740,7 +739,7 @@ private static final class Cache {

static {
final String propertyName = "java.lang.ScopedValue.cacheSize";
var sizeString = GetPropertyAction.privilegedGetProperty(propertyName, "16");
var sizeString = System.getProperty(propertyName, "16");
var cacheSize = Integer.valueOf(sizeString);
if (cacheSize < 2 || cacheSize > MAX_CACHE_SIZE) {
cacheSize = MAX_CACHE_SIZE;
Expand Down
10 changes: 2 additions & 8 deletions src/java.base/share/classes/java/lang/StackStreamFactory.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -45,7 +45,6 @@
import java.util.stream.StreamSupport;
import jdk.internal.vm.Continuation;
import jdk.internal.vm.ContinuationScope;
import sun.security.action.GetPropertyAction;

import static java.lang.StackStreamFactory.WalkerState.*;

Expand Down Expand Up @@ -82,13 +81,8 @@ private StackStreamFactory() {}
@Native private static final int SHOW_HIDDEN_FRAMES = 0x20; // LambdaForms are hidden by the VM
@Native private static final int FILL_LIVE_STACK_FRAMES = 0x100;

/*
* For Throwable to use StackWalker, set useNewThrowable to true.
* Performance work and extensive testing is needed to replace the
* VM built-in backtrace filled in Throwable with the StackWalker.
*/
static final boolean isDebug =
"true".equals(GetPropertyAction.privilegedGetProperty("stackwalk.debug"));
"true".equals(System.getProperty("stackwalk.debug"));

static <T> StackFrameTraverser<T>
makeStackTraverser(StackWalker walker, Function<? super Stream<StackFrame>, ? extends T> function)
Expand Down
5 changes: 5 additions & 0 deletions src/java.base/share/classes/java/lang/System.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import java.util.ResourceBundle;
import java.util.Set;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
import java.util.function.Supplier;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Stream;
Expand Down Expand Up @@ -2304,6 +2305,10 @@ public Executor virtualThreadDefaultScheduler() {
return VirtualThread.defaultScheduler();
}

public Stream<ScheduledExecutorService> virtualThreadDelayedTaskSchedulers() {
return VirtualThread.delayedTaskSchedulers();
}

public StackWalker newStackWalkerInstance(Set<StackWalker.Option> options,
ContinuationScope contScope,
Continuation continuation) {
Expand Down
3 changes: 1 addition & 2 deletions src/java.base/share/classes/java/lang/ThreadLocal.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

import jdk.internal.misc.CarrierThreadLocal;
import jdk.internal.misc.TerminatingThreadLocal;
import sun.security.action.GetPropertyAction;

/**
* This class provides thread-local variables. These variables differ from
Expand Down Expand Up @@ -804,7 +803,7 @@ private void expungeStaleEntries() {
* a stack trace should be printed when a virtual thread sets a thread local.
*/
private static boolean traceVirtualThreadLocals() {
String propValue = GetPropertyAction.privilegedGetProperty("jdk.traceVirtualThreadLocals");
String propValue = System.getProperty("jdk.traceVirtualThreadLocals");
return (propValue != null)
&& (propValue.isEmpty() || Boolean.parseBoolean(propValue));
}
Expand Down
10 changes: 9 additions & 1 deletion src/java.base/share/classes/java/lang/VirtualThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/
package java.lang;

import java.util.Arrays;
import java.util.Locale;
import java.util.Objects;
import java.util.concurrent.CountDownLatch;
Expand All @@ -37,12 +38,12 @@
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory;
import java.util.concurrent.ForkJoinTask;
import java.util.concurrent.ForkJoinWorkerThread;
import java.util.concurrent.Future;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.stream.Stream;
import jdk.internal.event.VirtualThreadEndEvent;
import jdk.internal.event.VirtualThreadStartEvent;
import jdk.internal.event.VirtualThreadSubmitFailedEvent;
Expand Down Expand Up @@ -197,6 +198,13 @@ static Executor defaultScheduler() {
return DEFAULT_SCHEDULER;
}

/**
* Returns a stream of the delayed task schedulers used to support timed operations.
*/
static Stream<ScheduledExecutorService> delayedTaskSchedulers() {
return Arrays.stream(DELAYED_TASK_SCHEDULERS);
}

/**
* Returns the continuation scope used for virtual threads.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,11 @@ default ClassDesc classSymbol() {
*
* @apiNote
* {@code TAG_}-prefixed constants in this class, such as {@link #TAG_INT},
* describe the possible return values of this method.
* describe the possible return values of this method. The return type is
* {@code int} for consistency with union indicator items in other union
* structures in the {@code class} file format.
*/
char tag();
int tag();

/**
* {@return an enum value for an element-value pair}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public sealed interface PoolEntry
* {@code TAG_}-prefixed constants in this class, such as {@link #TAG_UTF8},
* describe the possible return values of this method.
*/
byte tag();
int tag();

/**
* {@return the index within the constant pool corresponding to this entry}
Expand Down
2 changes: 0 additions & 2 deletions src/java.base/share/classes/java/lang/foreign/Linker.java
Original file line number Diff line number Diff line change
Expand Up @@ -852,8 +852,6 @@ static Option firstVariadicArg(int index) {
* // use errno
* }
* }
* <p>
* This linker option can not be combined with {@link #critical}.
*
* @param capturedState the names of the values to save
* @throws IllegalArgumentException if at least one of the provided
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ private byte[] classFileSetup(Consumer<? super ClassBuilder> config) {
return ClassFile.of().build(classEntry, pool, new Consumer<>() {
@Override
public void accept(ClassBuilder clb) {
clb.withFlags(ACC_ABSTRACT | ACC_SUPER)
clb.withFlags(ACC_FINAL | ACC_SUPER)
.withSuperclass(INVOKER_SUPER_DESC)
.with(SourceFileAttribute.of(clb.constantPool().utf8Entry(SOURCE_PREFIX + name)));
config.accept(clb);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@
import jdk.internal.misc.VM;
import jdk.internal.ref.CleanerFactory;
import sun.invoke.util.Wrapper;
import sun.security.action.GetPropertyAction;

import java.lang.invoke.MethodHandles.Lookup;
import java.lang.reflect.Field;
import java.util.Properties;

import static java.lang.invoke.MethodHandleNatives.Constants.*;
import static java.lang.invoke.MethodHandleStatics.TRACE_METHOD_LINKAGE;
Expand Down
3 changes: 3 additions & 0 deletions src/java.base/share/classes/java/net/IDN.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
* Applications are responsible for taking adequate security measures when using
* international domain names.
*
* <p>Unless otherwise specified, passing a {@code null} argument to any method
* in this class will cause a {@link NullPointerException} to be thrown.
*
* @spec https://www.rfc-editor.org/info/rfc1122
* RFC 1122: Requirements for Internet Hosts - Communication Layers
* @spec https://www.rfc-editor.org/info/rfc1123
Expand Down
7 changes: 3 additions & 4 deletions src/java.base/share/classes/java/net/InterfaceAddress.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -42,10 +42,9 @@ public class InterfaceAddress {
private short maskLength = 0;

/*
* Package private constructor. Can't be built directly, instances are
* obtained through the NetworkInterface class.
* This constructor is called via JNI in NetworkInterface.c
*/
InterfaceAddress() {
private InterfaceAddress() {
}

/**
Expand Down
Loading