Skip to content

Commit

Permalink
(Valhalla) Merging openj9-openjdk-jdk/openj9 into openj9
Browse files Browse the repository at this point in the history
Conflicts:
	src/java.base/share/classes/java/io/ObjectInputStream.java
	src/java.base/share/classes/java/io/ObjectStreamClass.java

Signed-off-by: Jason Feng <[email protected]>
  • Loading branch information
JasonFengJ9 committed Nov 20, 2024
2 parents efd3e0e + 9fe7c73 commit e1eedbb
Show file tree
Hide file tree
Showing 431 changed files with 24,172 additions and 29,853 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ NashornProfile.txt
/.settings/
/compile_commands.json
/.cache
/.gdbinit
/.lldbinit
4 changes: 2 additions & 2 deletions make/ZipSecurity.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 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 @@ -27,7 +27,7 @@ default: all

include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
include ZipArchive.gmk

################################################################################
#
Expand Down
4 changes: 2 additions & 2 deletions make/ZipSource.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 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 @@ -27,8 +27,8 @@ default: all

include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
include Modules.gmk
include ZipArchive.gmk

SRC_ZIP_WORK_DIR := $(SUPPORT_OUTPUTDIR)/src
$(if $(filter $(TOPDIR)/%, $(SUPPORT_OUTPUTDIR)), $(eval SRC_ZIP_BASE := $(TOPDIR)), $(eval SRC_ZIP_BASE := $(SUPPORT_OUTPUTDIR)))
Expand Down
10 changes: 0 additions & 10 deletions make/common/modules/LauncherCommon.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,8 @@ ifeq ($(call isTargetOsType, unix)+$(MAKEFILE_PREFIX), true+Launcher)
# We assume all our man pages should reside in section 1.

MAN_FILES_MD := $(wildcard $(addsuffix /*.md, $(call FindModuleManDirs, $(MODULE))))
MAN_FILES_TROFF := $(wildcard $(addsuffix /*.1, $(call FindModuleManDirs, $(MODULE))))

ifneq ($(MAN_FILES_MD), )
# If we got markdown files, ignore the troff files
ifeq ($(ENABLE_PANDOC), false)
$(info Warning: pandoc not found. Not generating man pages)
else
Expand Down Expand Up @@ -250,13 +248,5 @@ ifeq ($(call isTargetOsType, unix)+$(MAKEFILE_PREFIX), true+Launcher)

TARGETS += $(BUILD_MAN_PAGES)
endif
else
# No markdown man pages present
$(eval $(call SetupCopyFiles, COPY_MAN_PAGES, \
DEST := $(SUPPORT_OUTPUTDIR)/modules_man/$(MODULE)/man1, \
FILES := $(MAN_FILES_TROFF), \
))

TARGETS += $(COPY_MAN_PAGES)
endif
endif
1 change: 1 addition & 0 deletions make/conf/jib-profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ var getJibProfilesCommon = function (input, data) {
configure_args: concat(
"--with-exclude-translations=es,fr,it,ko,pt_BR,sv,ca,tr,cs,sk,ja_JP_A,ja_JP_HA,ja_JP_HI,ja_JP_I,zh_TW,zh_HK",
"--disable-jvm-feature-shenandoahgc",
"--disable-cds-archive-coh",
versionArgs(input, common))
};

Expand Down
1 change: 1 addition & 0 deletions make/test/BuildMicrobenchmark.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include JarArchive.gmk
include JavaCompilation.gmk
include TestFilesCompilation.gmk

Expand Down
6 changes: 0 additions & 6 deletions src/hotspot/share/include/jvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,6 @@ JVM_GetNextThreadIdOffset(JNIEnv *env, jclass threadClass);
JNIEXPORT void JNICALL
JVM_RegisterContinuationMethods(JNIEnv *env, jclass cls);

/*
* java.lang.SecurityManager
*/
JNIEXPORT jobjectArray JNICALL
JVM_GetClassContext(JNIEnv *env);

/*
* java.lang.Package
*/
Expand Down
14 changes: 3 additions & 11 deletions src/java.base/aix/classes/sun/nio/ch/DefaultSelectorProvider.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2021, 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 All @@ -25,20 +25,12 @@

package sun.nio.ch;

import java.security.AccessController;
import java.security.PrivilegedAction;

/**
* Creates this platform's default SelectorProvider
*/

@SuppressWarnings("removal")
public class DefaultSelectorProvider {
private static final SelectorProviderImpl INSTANCE;
static {
PrivilegedAction<SelectorProviderImpl> pa = PollSelectorProvider::new;
INSTANCE = AccessController.doPrivileged(pa);
}
private static final SelectorProviderImpl INSTANCE = new PollSelectorProvider();

/**
* Prevent instantiation.
Expand All @@ -51,4 +43,4 @@ private DefaultSelectorProvider() { }
public static SelectorProviderImpl get() {
return INSTANCE;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2021, 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 All @@ -25,20 +25,12 @@

package sun.nio.ch;

import java.security.AccessController;
import java.security.PrivilegedAction;

/**
* Creates this platform's default SelectorProvider
*/

@SuppressWarnings("removal")
public class DefaultSelectorProvider {
private static final SelectorProviderImpl INSTANCE;
static {
PrivilegedAction<SelectorProviderImpl> pa = EPollSelectorProvider::new;
INSTANCE = AccessController.doPrivileged(pa);
}
private static final SelectorProviderImpl INSTANCE = new EPollSelectorProvider();

/**
* Prevent instantiation.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 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 @@ -115,8 +115,6 @@ public Map<String,Object> readAttributes(String[] attributes)

@Override
public DosFileAttributes readAttributes() throws IOException {
file.checkRead();

int fd = -1;
try {
fd = file.openForAttributeAccess(followLinks);
Expand Down Expand Up @@ -249,8 +247,6 @@ private int getDosAttribute(int fd) throws UnixException {
* Updates the value of the user.DOSATTRIB extended attribute
*/
private void updateDosAttribute(int flag, boolean enable) throws IOException {
file.checkWrite();

int fd = -1;
try {
fd = file.openForAttributeAccess(followLinks);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,12 @@

package sun.nio.ch;

import java.security.AccessController;
import java.security.PrivilegedAction;

/**
* Creates this platform's default SelectorProvider
*/

@SuppressWarnings("removal")
public class DefaultSelectorProvider {
private static final SelectorProviderImpl INSTANCE;
static {
PrivilegedAction<SelectorProviderImpl> pa = KQueueSelectorProvider::new;
INSTANCE = AccessController.doPrivileged(pa);
}
private static final SelectorProviderImpl INSTANCE = new KQueueSelectorProvider();

/**
* Prevent instantiation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ private static void setTimes(UnixPath path, FileTime lastModifiedTime,
return;
}

// permission check
path.checkWrite();

// use a file descriptor if possible to avoid a race due to accessing
// a path more than once as the file at that path could change.
// if path is a symlink, then the open should fail with ELOOP and
Expand Down
4 changes: 1 addition & 3 deletions src/java.base/macosx/classes/sun/nio/fs/BsdFileSystem.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 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 @@ -28,13 +28,11 @@
import java.io.IOException;
import java.nio.file.FileStore;
import java.nio.file.WatchService;
import java.security.AccessController;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import sun.nio.ch.IOStatus;
import sun.security.action.GetPropertyAction;

import static sun.nio.fs.UnixConstants.*;
import static sun.nio.fs.UnixNativeDispatcher.chown;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ protected AlgorithmParameters engineGetParameters() {
params.init((new DerValue(
DerValue.tag_OctetString, nonceData).toByteArray()));
} catch (NoSuchAlgorithmException | IOException exc) {
throw new RuntimeException(exc);
throw new ProviderException(exc);
}
}

Expand Down Expand Up @@ -353,7 +353,7 @@ protected void engineInit(int opmode, Key key,
break;
default:
// Should never happen
throw new RuntimeException("ChaCha20 in unsupported mode");
throw new ProviderException("ChaCha20 in unsupported mode");
}
init(opmode, key, newNonce);
}
Expand Down Expand Up @@ -426,7 +426,7 @@ protected void engineInit(int opmode, Key key,
}
break;
default:
throw new RuntimeException("Invalid mode: " + mode);
throw new ProviderException("Invalid mode: " + mode);
}

// Continue with initialization
Expand Down Expand Up @@ -730,7 +730,7 @@ protected byte[] engineDoFinal(byte[] in, int inOfs, int inLen)
try {
engine.doFinal(in, inOfs, inLen, output, 0);
} catch (ShortBufferException | KeyException exc) {
throw new RuntimeException(exc);
throw new ProviderException(exc);
} finally {
// Reset the cipher's state to post-init values.
resetStartState();
Expand Down Expand Up @@ -767,7 +767,7 @@ protected int engineDoFinal(byte[] in, int inOfs, int inLen, byte[] out,
try {
bytesUpdated = engine.doFinal(in, inOfs, inLen, out, outOfs);
} catch (KeyException ke) {
throw new RuntimeException(ke);
throw new ProviderException(ke);
} finally {
// Reset the cipher's state to post-init values.
resetStartState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,8 @@ public final class DHKeyAgreement

private static class AllowKDF {

private static final boolean VALUE = getValue();

@SuppressWarnings("removal")
private static boolean getValue() {
return AccessController.doPrivileged(
(PrivilegedAction<Boolean>)
() -> Boolean.getBoolean("jdk.crypto.KeyAgreement.legacyKDF"));
}
private static final boolean VALUE =
Boolean.getBoolean("jdk.crypto.KeyAgreement.legacyKDF");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ protected AlgorithmParameters engineGetParameters() {
params.init(spec);
return params;
} catch (NoSuchAlgorithmException | InvalidParameterSpecException e) {
throw new RuntimeException(e);
throw new ProviderException(e);
}
}

Expand Down Expand Up @@ -781,7 +781,7 @@ int implGCMCrypt(ByteBuffer src, ByteBuffer dst) {
int mergeBlock(byte[] buffer, int bufOfs, int bufLen, byte[] in,
int inOfs, int inLen, byte[] block) {
if (bufLen > blockSize) {
throw new RuntimeException("mergeBlock called on an ibuffer " +
throw new ProviderException("mergeBlock called on an ibuffer " +
"too big: " + bufLen + " bytes");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@

import java.io.*;
import java.util.*;
import java.security.AccessController;
import java.security.DigestInputStream;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.Key;
import java.security.PrivateKey;
import java.security.PrivilegedAction;
import java.security.KeyStoreSpi;
import java.security.KeyStoreException;
import java.security.UnrecoverableKeyException;
Expand Down Expand Up @@ -835,15 +833,9 @@ public void engineLoad(InputStream stream, char[] password)
// read the sealed key
try {
ois = new ObjectInputStream(dis);
final ObjectInputStream ois2 = ois;
// Set a deserialization checker
@SuppressWarnings("removal")
var dummy = AccessController.doPrivileged(
(PrivilegedAction<Void>)() -> {
ois2.setObjectInputFilter(
new DeserializationChecker(fullLength));
return null;
});
ois.setObjectInputFilter(
new DeserializationChecker(fullLength));
entry.sealedKey = (SealedObject)ois.readObject();
entry.maxLength = fullLength;
// NOTE: don't close ois here since we are still
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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 @@ -73,18 +73,13 @@ AlgorithmParameters getParameters() {
return params;
}

@SuppressWarnings("removal")
final Key getKey(Cipher c, int maxLength)
throws IOException, ClassNotFoundException, IllegalBlockSizeException,
BadPaddingException {

try (ObjectInputStream ois = SharedSecrets.getJavaxCryptoSealedObjectAccess()
.getExtObjectInputStream(this, c)) {
AccessController.doPrivileged(
(PrivilegedAction<Void>) () -> {
ois.setObjectInputFilter(new DeserializationChecker(maxLength));
return null;
});
ois.setObjectInputFilter(new DeserializationChecker(maxLength));
try {
@SuppressWarnings("unchecked")
Key t = (Key) ois.readObject();
Expand Down Expand Up @@ -113,16 +108,8 @@ private static class DeserializationChecker implements ObjectInputFilter {
private static final ObjectInputFilter OWN_FILTER;

static {
@SuppressWarnings("removal")
String prop = AccessController.doPrivileged(
(PrivilegedAction<String>) () -> {
String tmp = System.getProperty(KEY_SERIAL_FILTER);
if (tmp != null) {
return tmp;
} else {
return Security.getProperty(KEY_SERIAL_FILTER);
}
});
String prop = System.getProperty(
KEY_SERIAL_FILTER, Security.getProperty(KEY_SERIAL_FILTER));
OWN_FILTER = prop == null
? null
: ObjectInputFilter.Config.createFilter(prop);
Expand Down
Loading

0 comments on commit e1eedbb

Please sign in to comment.