Skip to content

Commit 556281a

Browse files
authored
Removed unused "else" branch for no entitlements/no SM (#122354)
1 parent 9076ac4 commit 556281a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

server/src/main/java/org/elasticsearch/bootstrap/Elasticsearch.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ private static void initPhase2(Bootstrap bootstrap) throws IOException {
249249
nodeEnv.configDir(),
250250
nodeEnv.tmpDir()
251251
);
252-
} else if (RuntimeVersionFeature.isSecurityManagerAvailable()) {
252+
} else {
253+
assert RuntimeVersionFeature.isSecurityManagerAvailable();
253254
// no need to explicitly enable native access for legacy code
254255
pluginsLoader = PluginsLoader.createPluginsLoader(modulesBundles, pluginsBundles, Map.of());
255256
// install SM after natives, shutdown hooks, etc.
@@ -259,10 +260,6 @@ private static void initPhase2(Bootstrap bootstrap) throws IOException {
259260
SECURITY_FILTER_BAD_DEFAULTS_SETTING.get(args.nodeSettings()),
260261
args.pidFile()
261262
);
262-
} else {
263-
// TODO: should we throw/interrupt startup in this case?
264-
pluginsLoader = PluginsLoader.createPluginsLoader(modulesBundles, pluginsBundles, Map.of());
265-
LogManager.getLogger(Elasticsearch.class).warn("Bootstrapping without any protection");
266263
}
267264

268265
bootstrap.setPluginsLoader(pluginsLoader);

0 commit comments

Comments
 (0)