forked from ibmruntimes/openj9-openjdk-jdk17
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge master jdk-17.0.10+3 into openj9-staging
Signed-off-by: J9 Build <[email protected]>
- Loading branch information
Showing
10 changed files
with
170 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Owner: CN=ISRG Root X2, O=Internet Security Research Group, C=US | ||
Issuer: CN=ISRG Root X2, O=Internet Security Research Group, C=US | ||
Serial number: 41d29dd172eaeea780c12c6ce92f8752 | ||
Valid from: Fri Sep 04 00:00:00 GMT 2020 until: Mon Sep 17 16:00:00 GMT 2040 | ||
Signature algorithm name: SHA384withECDSA | ||
Subject Public Key Algorithm: 384-bit EC (secp384r1) key | ||
Version: 3 | ||
-----BEGIN CERTIFICATE----- | ||
MIICGzCCAaGgAwIBAgIQQdKd0XLq7qeAwSxs6S+HUjAKBggqhkjOPQQDAzBPMQsw | ||
CQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJuZXQgU2VjdXJpdHkgUmVzZWFyY2gg | ||
R3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBYMjAeFw0yMDA5MDQwMDAwMDBaFw00 | ||
MDA5MTcxNjAwMDBaME8xCzAJBgNVBAYTAlVTMSkwJwYDVQQKEyBJbnRlcm5ldCBT | ||
ZWN1cml0eSBSZXNlYXJjaCBHcm91cDEVMBMGA1UEAxMMSVNSRyBSb290IFgyMHYw | ||
EAYHKoZIzj0CAQYFK4EEACIDYgAEzZvVn4CDCuwJSvMWSj5cz3es3mcFDR0HttwW | ||
+1qLFNvicWDEukWVEYmO6gbf9yoWHKS5xcUy4APgHoIYOIvXRdgKam7mAHf7AlF9 | ||
ItgKbppbd9/w+kHsOdx1ymgHDB/qo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0T | ||
AQH/BAUwAwEB/zAdBgNVHQ4EFgQUfEKWrt5LSDv6kviejM9ti6lyN5UwCgYIKoZI | ||
zj0EAwMDaAAwZQIwe3lORlCEwkSHRhtFcP9Ymd70/aTSVaYgLXTWNLxBo1BfASdW | ||
tL4ndQavEi51mI38AjEAi/V3bNTIZargCyzuFJ0nN6T5U6VR5CmD1/iQMVtCnwr1 | ||
/q4AaOeMSQ+2b1tbFfLn | ||
-----END CERTIFICATE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
test/jdk/javax/print/PrintServiceLookup/FlushCustomClassLoader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* Copyright Amazon.com Inc. 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 | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. | ||
* | ||
* This code is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* version 2 for more details (a copy is included in the LICENSE file that | ||
* accompanied this code). | ||
* | ||
* You should have received a copy of the GNU General Public License version | ||
* 2 along with this work; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
* | ||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
* or visit www.oracle.com if you need additional information or have any | ||
* questions. | ||
*/ | ||
|
||
import java.awt.EventQueue; | ||
import java.lang.ref.Reference; | ||
import java.lang.ref.WeakReference; | ||
import java.net.URL; | ||
import java.net.URLClassLoader; | ||
|
||
import javax.print.DocFlavor; | ||
import javax.print.PrintServiceLookup; | ||
|
||
/** | ||
* @test | ||
* @bug 8273831 | ||
* @summary Tests custom class loader cleanup | ||
* @library /javax/swing/regtesthelpers | ||
* @build Util | ||
* @run main/timeout=60/othervm -mx32m FlushCustomClassLoader | ||
*/ | ||
public final class FlushCustomClassLoader { | ||
|
||
public static void main(String[] args) throws Exception { | ||
Reference<ClassLoader> loader = getLoader("testMethod"); | ||
|
||
int attempt = 0; | ||
while (loader.get() != null) { | ||
Util.generateOOME(); | ||
System.out.println("Not freed, attempt: " + attempt++); | ||
} | ||
} | ||
|
||
public static void testMethod() { | ||
DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE; | ||
PrintServiceLookup.lookupPrintServices(flavor, null); | ||
} | ||
|
||
private static Reference<ClassLoader> getLoader(String m) throws Exception { | ||
/* | ||
* The print services are stored per the AppContext, and each AppContext | ||
* caches the "current" class loader during creation. | ||
* see javax.print.PrintServiceLookup. | ||
* | ||
* To prevent AppContext from cache our test loader we force AppContext | ||
* creation early by the invokeAndWait. | ||
* The "EventQueue.invokeAndWait(() -> {});" can be removed when the | ||
* AppContext usage will be deleted in the PrintServiceLookup | ||
*/ | ||
EventQueue.invokeAndWait(() -> {}); | ||
|
||
URL url = FlushCustomClassLoader.class.getProtectionDomain() | ||
.getCodeSource().getLocation(); | ||
URLClassLoader loader = new URLClassLoader(new URL[]{url}, null); | ||
|
||
Thread ct = Thread.currentThread(); | ||
ct.setContextClassLoader(loader); | ||
Class<?> cls = Class.forName("FlushCustomClassLoader", true, loader); | ||
cls.getDeclaredMethod(m).invoke(null); | ||
ct.setContextClassLoader(null); | ||
loader.close(); | ||
return new WeakReference<>(loader); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters