Skip to content

Commit

Permalink
Merge pull request #651 from ibmruntimes/openj9
Browse files Browse the repository at this point in the history
Merge jdk8u372-b04 and b05 to 0.38
  • Loading branch information
JasonFengJ9 authored Mar 13, 2023
2 parents a1cfd87 + 5b0b6e8 commit b9faae5
Show file tree
Hide file tree
Showing 23 changed files with 1,488 additions and 920 deletions.
2 changes: 1 addition & 1 deletion closed/openjdk-tag.gmk
Original file line number Diff line number Diff line change
@@ -1 +1 @@
OPENJDK_TAG := jdk8u372-b03
OPENJDK_TAG := jdk8u372-b05
29 changes: 29 additions & 0 deletions jdk/make/data/cacerts/certignaca
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Owner: CN=Certigna, O=Dhimyotis, C=FR
Issuer: CN=Certigna, O=Dhimyotis, C=FR
Serial number: fedce3010fc948ff
Valid from: Fri Jun 29 15:13:05 GMT 2007 until: Tue Jun 29 15:13:05 GMT 2027
Signature algorithm name: SHA1withRSA
Subject Public Key Algorithm: 2048-bit RSA key
Version: 3
-----BEGIN CERTIFICATE-----
MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNV
BAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4X
DTA3MDYyOTE1MTMwNVoXDTI3MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQ
BgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwIQ2VydGlnbmEwggEiMA0GCSqGSIb3
DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7qXOEm7RFHYeGifBZ4
QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyHGxny
gQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbw
zBfsV1/pogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q
130yGLMLLGq/jj8UEYkgDncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2
JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKfIrjxwo1p3Po6WAbfAgMBAAGjgbwwgbkw
DwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQtCRZvgHyUtVF9lo53BEw
ZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJBgNVBAYT
AkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzj
AQ/JSP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG
9w0BAQUFAAOCAQEAhQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8h
bV6lUmPOEvjvKtpv6zf+EwLHyzs+ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFnc
fca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1kluPBS1xp81HlDQwY9qcEQCYsuu
HWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY1gkIl2PlwS6w
t0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw
WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg==
-----END CERTIFICATE-----
3 changes: 2 additions & 1 deletion jdk/src/aix/classes/jdk/internal/platform/SystemMetrics.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 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 @@ -29,3 +29,4 @@ public static Metrics instance() {
return null;
}
}

8 changes: 8 additions & 0 deletions jdk/src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ private static DirContext getUsingURL(String url, Hashtable<?,?> env)
ctx = getLdapCtxFromUrl(
r.getDomainName(), url, new LdapURL(u), env);
return ctx;
} catch (AuthenticationException e) {
// do not retry on a different endpoint to avoid blocking
// the user if authentication credentials are wrong.
throw e;
} catch (NamingException e) {
// try the next element
lastException = e;
Expand Down Expand Up @@ -241,6 +245,10 @@ private static DirContext getUsingURLs(String[] urls, Hashtable<?,?> env)
for (String u : urls) {
try {
return getUsingURL(u, env);
} catch (AuthenticationException e) {
// do not retry on a different endpoint to avoid blocking
// the user if authentication credentials are wrong.
throw e;
} catch (NamingException e) {
ex = e;
}
Expand Down
7 changes: 5 additions & 2 deletions jdk/src/share/classes/jdk/jfr/internal/ChunksChannel.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,13 @@ public long transferTo(FileChannel out) throws IOException {
assert current != null;

long rem = current.getSize();

while (rem > 0) {
long n = Math.min(rem, 1024 * 1024);
long w = out.transferFrom(channel, pos, n);
// Prevent endless loop
if (w == 0) {
return out.size();
}
pos += w;
rem -= w;
}
Expand All @@ -111,7 +114,7 @@ public long transferTo(FileChannel out) throws IOException {
current = null;
}
if (!nextChannel()) {
return pos;
return out.size();
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions jdk/src/share/classes/jdk/jfr/internal/PlatformRecording.java
Original file line number Diff line number Diff line change
Expand Up @@ -682,8 +682,12 @@ public void dumpStopped(WriteableUserPath userPath) throws IOException {
synchronized (recorder) {
userPath.doPriviligedIO(() -> {
try (ChunksChannel cc = new ChunksChannel(chunks); FileChannel fc = FileChannel.open(userPath.getReal(), StandardOpenOption.WRITE, StandardOpenOption.APPEND)) {
cc.transferTo(fc);
fc.force(true);
long bytes = cc.transferTo(fc);
Logger.log(LogTag.JFR, LogLevel.INFO, "Transferred " + bytes + " bytes from the disk repository");
// No need to force if no data was transferred, which avoids IOException when device is /dev/null
if (bytes != 0) {
fc.force(true);
}
}
return null;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,11 @@ public final Provider getProvider() {
}

public final void dispose() throws GSSException {
mechContext = null;
state = STATE_DELETED;
if (mechContext != null) {
mechContext.dispose();
mechContext = null;
}
}

/**
Expand Down
108 changes: 48 additions & 60 deletions jdk/src/share/classes/sun/security/ssl/CipherSuite.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,8 @@

package sun.security.ssl;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.*;

import static sun.security.ssl.CipherSuite.HashAlg.*;
import static sun.security.ssl.CipherSuite.KeyExchange.*;
import static sun.security.ssl.CipherSuite.MacAlg.*;
Expand Down Expand Up @@ -874,6 +870,39 @@ enum CipherSuite {

final boolean exportable;

private static final Map<Integer, CipherSuite> cipherSuiteIds;
private static final Map<String, CipherSuite> cipherSuiteNames;
private static final List<CipherSuite> allowedCipherSuites;
private static final List<CipherSuite> defaultCipherSuites;

static {
Map<Integer, CipherSuite> ids = new HashMap<>();
Map<String, CipherSuite> names = new HashMap<>();
List<CipherSuite> allowedCS = new ArrayList<>();
List<CipherSuite> defaultCS = new ArrayList<>();

for(CipherSuite cs : CipherSuite.values()) {
ids.put(cs.id, cs);
names.put(cs.name, cs);
for (String alias : cs.aliases) {
names.put(alias, cs);
}

if (!cs.supportedProtocols.isEmpty()) {
allowedCS.add(cs);
}

if (cs.isDefaultEnabled) {
defaultCS.add(cs);
}
}

cipherSuiteIds = Collections.unmodifiableMap(ids);
cipherSuiteNames = Collections.unmodifiableMap(names);
allowedCipherSuites = Collections.unmodifiableList(allowedCS);
defaultCipherSuites = Collections.unmodifiableList(defaultCS);
}

// known but unsupported cipher suite
private CipherSuite(String name, int id) {
this(id, false, name, "",
Expand Down Expand Up @@ -911,62 +940,29 @@ private CipherSuite(int id, boolean isDefaultEnabled,
}

static CipherSuite nameOf(String ciperSuiteName) {
for (CipherSuite cs : CipherSuite.values()) {
if (cs.name.equals(ciperSuiteName) ||
cs.aliases.contains(ciperSuiteName)) {
return cs;
}
}

return null;
return cipherSuiteNames.get(ciperSuiteName);
}

static CipherSuite valueOf(int id) {
for (CipherSuite cs : CipherSuite.values()) {
if (cs.id == id) {
return cs;
}
}

return null;
return cipherSuiteIds.get(id);
}

static String nameOf(int id) {
for (CipherSuite cs : CipherSuite.values()) {
if (cs.id == id) {
return cs.name;
}
CipherSuite cs = cipherSuiteIds.get(id);

if (cs != null) {
return cs.name;
}

return "UNKNOWN-CIPHER-SUITE(" + Utilities.byte16HexString(id) + ")";
}

static Collection<CipherSuite> allowedCipherSuites() {
Collection<CipherSuite> cipherSuites = new LinkedList<>();
for (CipherSuite cs : CipherSuite.values()) {
if (!cs.supportedProtocols.isEmpty()) {
cipherSuites.add(cs);
} else {
// values() is ordered, remaining cipher suites are
// not supported.
break;
}
}
return cipherSuites;
return allowedCipherSuites;
}

static Collection<CipherSuite> defaultCipherSuites() {
Collection<CipherSuite> cipherSuites = new LinkedList<>();
for (CipherSuite cs : CipherSuite.values()) {
if (cs.isDefaultEnabled) {
cipherSuites.add(cs);
} else {
// values() is ordered, remaining cipher suites are
// not enabled.
break;
}
}
return cipherSuites;
return defaultCipherSuites;
}

/**
Expand All @@ -989,19 +985,11 @@ static List<CipherSuite> validValuesOf(String[] names) {
}

boolean found = false;
for (CipherSuite cs : CipherSuite.values()) {
if (!cs.supportedProtocols.isEmpty()) {
if (cs.name.equals(name) ||
cs.aliases.contains(name)) {
cipherSuites.add(cs);
found = true;
break;
}
} else {
// values() is ordered, remaining cipher suites are
// not supported.
break;
}
CipherSuite cs;
if ((cs = cipherSuiteNames.get(name)) != null
&& !cs.supportedProtocols.isEmpty()) {
cipherSuites.add(cs);
found = true;
}
if (!found) {
throw new IllegalArgumentException(
Expand Down
16 changes: 9 additions & 7 deletions jdk/src/solaris/classes/sun/awt/FcFontManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,22 @@ protected String[] getDefaultPlatformFont() {
getFontConfigManager().initFontConfigFonts(false);
FontConfigManager.FcCompFont[] fontConfigFonts =
getFontConfigManager().getFontConfigFonts();
for (int i=0; i<fontConfigFonts.length; i++) {
if ("sans".equals(fontConfigFonts[i].fcFamily) &&
0 == fontConfigFonts[i].style) {
info[0] = fontConfigFonts[i].firstFont.familyName;
info[1] = fontConfigFonts[i].firstFont.fontFile;
break;
if (fontConfigFonts != null) {
for (int i = 0; i < fontConfigFonts.length; i++) {
if ("sans".equals(fontConfigFonts[i].fcFamily) &&
0 == fontConfigFonts[i].style) {
info[0] = fontConfigFonts[i].firstFont.familyName;
info[1] = fontConfigFonts[i].firstFont.fontFile;
break;
}
}
}
/* Absolute last ditch attempt in the face of fontconfig problems.
* If we didn't match, pick the first, or just make something
* up so we don't NPE.
*/
if (info[0] == null) {
if (fontConfigFonts.length > 0 &&
if (fontConfigFonts != null && fontConfigFonts.length > 0 &&
fontConfigFonts[0].firstFont.fontFile != null) {
info[0] = fontConfigFonts[0].firstFont.familyName;
info[1] = fontConfigFonts[0].firstFont.fontFile;
Expand Down

This file was deleted.

Loading

0 comments on commit b9faae5

Please sign in to comment.