Skip to content

Commit

Permalink
Merge master jdk-17.0.11+4 into openj9-staging
Browse files Browse the repository at this point in the history
Signed-off-by: J9 Build <j9build@ca.ibm.com>
  • Loading branch information
j9build committed Feb 21, 2024
2 parents 006bbe8 + e2802a9 commit e7bf276
Show file tree
Hide file tree
Showing 12 changed files with 342 additions and 35 deletions.
2 changes: 0 additions & 2 deletions make/modules/java.desktop/lib/Awt2dLibraries.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ else
LIBFREETYPE_LIBS := -lfreetype
endif

# gcc_ftobjs.c := maybe-uninitialized required for GCC 7 builds.
$(eval $(call SetupJdkLibrary, BUILD_LIBFREETYPE, \
NAME := freetype, \
OPTIMIZATION := HIGHEST, \
Expand All @@ -425,7 +424,6 @@ else
EXTRA_HEADER_DIRS := $(BUILD_LIBFREETYPE_HEADER_DIRS), \
DISABLED_WARNINGS_microsoft := 4018 4267 4244 4312 4819, \
DISABLED_WARNINGS_gcc := implicit-fallthrough cast-function-type bad-function-cast dangling-pointer stringop-overflow, \
DISABLED_WARNINGS_gcc_ftobjs.c := maybe-uninitialized, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ class Http2ClientImpl {
*/
CompletableFuture<Http2Connection> getConnectionFor(HttpRequestImpl req,
Exchange<?> exchange) {
URI uri = req.uri();
InetSocketAddress proxy = req.proxy();
String key = Http2Connection.keyFor(uri, proxy);
String key = Http2Connection.keyFor(req);

synchronized (this) {
Http2Connection connection = connections.get(key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ private Http2Connection(HttpRequestImpl request,
this(connection,
h2client,
1,
keyFor(request.uri(), request.proxy()));
keyFor(request));

Log.logTrace("Connection send window size {0} ", windowController.connectionWindowSize());

Expand Down Expand Up @@ -534,15 +534,13 @@ static String keyFor(HttpConnection connection) {
return keyString(isSecure, proxyAddr, addr.getHostString(), addr.getPort());
}

static String keyFor(URI uri, InetSocketAddress proxy) {
boolean isSecure = uri.getScheme().equalsIgnoreCase("https");

String host = uri.getHost();
int port = uri.getPort();
return keyString(isSecure, proxy, host, port);
static String keyFor(final HttpRequestImpl request) {
final InetSocketAddress targetAddr = request.getAddress();
final InetSocketAddress proxy = request.proxy();
final boolean secure = request.secure();
return keyString(secure, proxy, targetAddr.getHostString(), targetAddr.getPort());
}


// Compute the key for an HttpConnection in the Http2ClientImpl pool:
// The key string follows one of the three forms below:
// {C,S}:H:host:port
Expand Down
1 change: 1 addition & 0 deletions test/hotspot/jtreg/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ vmTestbase/nsk/jvmti/AttachOnDemand/attach045/TestDescription.java 8202971 gener
vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/TestDescription.java 8219652 aix-ppc64
vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/TestDescription.java 8219652 aix-ppc64
vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab001/TestDescription.java 8219652 aix-ppc64
vmTestbase/nsk/jvmti/scenarios/capability/CM03/cm03t001/TestDescription.java 8073470 linux-all

vmTestbase/gc/lock/jni/jnilock002/TestDescription.java 8192647 generic-all

Expand Down
3 changes: 2 additions & 1 deletion test/hotspot/jtreg/compiler/tiered/LevelTransitionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ private ExtendedTestCase(String methodName) {
}

private static class CompileMethodHolder {
private final int iter = 10;
// Make sure that loop backedge is never taken to prevent unexpected OSR compilations.
private final int iter = 1;
private int field = 42;

/**
Expand Down
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,6 @@ javax/management/monitor/DerivedGaugeMonitorTest.java 8042211 generic-al
# jdk_io

java/io/pathNames/GeneralWin32.java 8180264 windows-all
java/io/File/createTempFile/SpecialTempFile.java 8274122 windows11

############################################################################

Expand Down
20 changes: 14 additions & 6 deletions test/jdk/java/io/File/createTempFile/SpecialTempFile.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2023, 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 @@ -24,18 +24,23 @@
/*
* @test
* @bug 8013827 8011950 8017212 8025128
* @library /test/lib
* @modules java.base/jdk.internal.util
* @summary Check whether File.createTempFile can handle special parameters
* @build jdk.test.lib.OSVersion jdk.test.lib.Platform
@run main SpecialTempFile
* @author Dan Xu
*/

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

public class SpecialTempFile {
import jdk.test.lib.Platform;
import jdk.test.lib.OSVersion;

public class SpecialTempFile {
private static void test(String name, String[] prefix, String[] suffix,
boolean exceptionExpected) throws IOException
{
Expand All @@ -48,7 +53,7 @@ private static void test(String name, String[] prefix, String[] suffix,
final String exceptionMsg = "Unable to create temporary file";
String[] dirs = { null, "." };

Path testPath = Paths.get(System.getProperty("test.dir", "."));
Path testPath = Path.of(System.getProperty("test.dir", "."));
for (int i = 0; i < prefix.length; i++) {
boolean exceptionThrown = false;
File f = null;
Expand Down Expand Up @@ -99,12 +104,15 @@ public static void main(String[] args) throws Exception {
test("SlashedName", slashPre, slashSuf, true);

// Windows tests
if (!System.getProperty("os.name").startsWith("Windows"))
if (!Platform.isWindows())
return;

// Test JDK-8013827
String[] resvPre = { "LPT1.package.zip", "com7.4.package.zip" };
String[] resvSuf = { ".temp", ".temp" };
test("ReservedName", resvPre, resvSuf, true);
boolean exceptionExpected =
!(System.getProperty("os.name").endsWith("11") ||
new OSVersion(10, 0).compareTo(OSVersion.current()) > 0);
test("ReservedName", resvPre, resvSuf, exceptionExpected);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@
* @summary Verify that expect 100-continue doesn't hang
* @library /test/lib
* @run junit/othervm HttpURLConnectionExpectContinueTest
* @run junit/othervm -Djava.net.preferIPv4Stack=true HttpURLConnectionExpectContinueTest
* @run junit/othervm -Djava.net.preferIPv6Addresses=true HttpURLConnectionExpectContinueTest
*/

import jdk.test.lib.net.URIBuilder;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -73,7 +76,7 @@ public void startServerSocket() throws Exception {

control.serverSocket = new ServerSocket();
control.serverSocket.setReuseAddress(true);
control.serverSocket.bind(new InetSocketAddress("127.0.0.1", 54321));
control.serverSocket.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0));
Runnable runnable = () -> {
while (!control.stop) {
try {
Expand Down Expand Up @@ -419,8 +422,12 @@ public void testFixedLengthRequestWithDoubleExpect100ContinueResponse() throws E
}

// Creates a connection with all the common settings used in each test
private HttpURLConnection createConnection() throws IOException {
URL url = new URL("http://localhost:" + control.serverSocket.getLocalPort());
private HttpURLConnection createConnection() throws Exception {
URL url = URIBuilder.newBuilder()
.scheme("http")
.loopback()
.port(control.serverSocket.getLocalPort())
.toURL();

HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true);
Expand Down
15 changes: 14 additions & 1 deletion test/jdk/java/net/httpclient/HttpServerAdapters.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2023, 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 @@ -227,6 +227,7 @@ public static abstract class HttpTestExchange implements AutoCloseable {
public abstract URI getRequestURI();
public abstract String getRequestMethod();
public abstract void close();
public abstract InetSocketAddress getRemoteAddress();
public void serverPush(URI uri, HttpHeaders headers, byte[] body) {
ByteArrayInputStream bais = new ByteArrayInputStream(body);
serverPush(uri, headers, bais);
Expand Down Expand Up @@ -284,6 +285,12 @@ void doFilter(Filter.Chain chain) throws IOException {
}
@Override
public void close() { exchange.close(); }

@Override
public InetSocketAddress getRemoteAddress() {
return exchange.getRemoteAddress();
}

@Override
public URI getRequestURI() { return exchange.getRequestURI(); }
@Override
Expand Down Expand Up @@ -339,6 +346,12 @@ void doFilter(Filter.Chain filter) throws IOException {
}
@Override
public void close() { exchange.close();}

@Override
public InetSocketAddress getRemoteAddress() {
return exchange.getRemoteAddress();
}

@Override
public URI getRequestURI() { return exchange.getRequestURI(); }
@Override
Expand Down
Loading

0 comments on commit e7bf276

Please sign in to comment.