Skip to content

Commit

Permalink
Fix reflection issues on Zulu
Browse files Browse the repository at this point in the history
  • Loading branch information
TarCV committed Feb 12, 2023
1 parent b1998b1 commit 395db0d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/bsh/Reflect.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import java.util.regex.Pattern;
import java.util.Objects;
import java.util.WeakHashMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static bsh.This.Keys.BSHTHIS;
Expand Down Expand Up @@ -76,7 +77,11 @@ public final class Reflect {
static {
String packageAccess = Security.getProperty("package.access");
if (null == packageAccess) packageAccess = "null";
PACKAGE_ACCESS = Pattern.compile("(?:"+packageAccess.replace(',', '|')+").*");

String pattern = Stream.of(packageAccess.split(","))
.filter(s -> !s.isEmpty())
.collect(Collectors.joining("|", "(?:", ").*"));
PACKAGE_ACCESS = Pattern.compile(pattern);
}


Expand Down

0 comments on commit 395db0d

Please sign in to comment.