Skip to content

Commit

Permalink
Fixes generated EJB remote interfaces loading
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Pinčuk <[email protected]>
  • Loading branch information
avpinchuk committed Aug 28, 2023
1 parent 9e815e6 commit 6fbf895
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Eclipse Foundation and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2023 Eclipse Foundation and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -239,6 +239,7 @@ private static boolean useMethodHandles(final ClassLoader loader, final Class<?>
if (anchorClass == null || loader.getParent() == null || loader.getClass() == ASURLClassLoader.class) {
return false;
}
return Objects.equals(targetPackageName, anchorClass.getPackageName());
// Use MethodHandles.Lookup only if the anchor run-time Package defined by CL.
return Objects.equals(anchorClass.getPackage(), loader.getDefinedPackage(targetPackageName));
}
}

0 comments on commit 6fbf895

Please sign in to comment.