Skip to content

Commit

Permalink
Tolerate null in getLoaderNameID()
Browse files Browse the repository at this point in the history
* 8319436: Proxy.newProxyInstance throws NPE if loader is null
    and interface not visible from class loader

Signed-off-by: Keith W. Campbell <[email protected]>
  • Loading branch information
keithc-ca committed Nov 9, 2023
1 parent 084fe2a commit 086db59
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jcl/src/java.base/share/classes/java/lang/Access.java
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,9 @@ public <T> void setCarrierThreadLocal(CarrierThreadLocal<T> carrierThreadlocal,
/*[IF JAVA_SPEC_VERSION >= 11]*/
@Override
public String getLoaderNameID(ClassLoader loader) {
if (loader == null) {
return "null";
}
StringBuilder buffer = new StringBuilder();
String name = loader.getName();

Expand Down

0 comments on commit 086db59

Please sign in to comment.