File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/policy Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,8 @@ public class PolicyManager {
6767
6868 static final Class <?> DEFAULT_FILESYSTEM_CLASS = PathUtils .getDefaultFileSystem ().getClass ();
6969
70+ static final Set <String > MODULES_EXCLUDED_FROM_SYSTEM_MODULES = Set .of ("java.desktop" );
71+
7072 /**
7173 * @param componentName the plugin name; or else one of the special component names
7274 * like {@link #SERVER_COMPONENT_NAME} or {@link #APM_AGENT_COMPONENT_NAME}.
@@ -141,7 +143,13 @@ private static Set<Module> findSystemModules() {
141143 // entitlements is a "system" module, we can do anything from it
142144 Stream .of (PolicyManager .class .getModule ()),
143145 // anything in the boot layer is also part of the system
144- ModuleLayer .boot ().modules ().stream ().filter (m -> systemModulesDescriptors .contains (m .getDescriptor ()))
146+ ModuleLayer .boot ()
147+ .modules ()
148+ .stream ()
149+ .filter (
150+ m -> systemModulesDescriptors .contains (m .getDescriptor ())
151+ && MODULES_EXCLUDED_FROM_SYSTEM_MODULES .contains (m .getName ()) == false
152+ )
145153 ).collect (Collectors .toUnmodifiableSet ());
146154 }
147155
You can’t perform that action at this time.
0 commit comments