Code review comment: Was this meant to be included in this PR? Doesn't seem related

Code before review:
public NativeImageInvokerInfo build() {
List<String> nativeImageArgs = new ArrayList<>();
boolean enableSslNative = false;
boolean enableAllSecurityServices = nativeConfig.enableAllSecurityServices;
boolean inlineBeforeAnalysis = nativeConfig.inlineBeforeAnalysis;
boolean addAllCharsets = nativeConfig.addAllCharsets;
boolean enableHttpsUrlHandler = nativeConfig.enableHttpsUrlHandler;
for (NativeImageSystemPropertyBuildItem prop : nativeImageProperties) {
if (prop.getKey().equals("quarkus.ssl.native") && prop.getValue() != null) {
enableSslNative = Boolean.parseBoolean(prop.getValue());
} else if (prop.getKey().equals("quarkus.jni.enable") && prop.getValue().equals("false")) {
log.warn("Your application is setting the deprecated 'quarkus.jni.enable' configuration key to false."
+ " Please consider removing this configuration key as it is ignored (JNI is always enabled) and it"
+ " will be removed in a future Quarkus version.");
} else if (prop.getKey().equals("quarkus.native.enable-all-security-services") && prop.getValue() != null) {
enableAllSecurityServices |= Boolean.parseBoolean(prop.getValue());
} else if (prop.getKey().equals("quarkus.native.enable-all-charsets") && prop.getValue() != null) {
addAllCharsets |= Boolean.parseBoolean(prop.getValue());
} else if (prop.getKey().equals("quarkus.native.inline-before-analysis") && prop.getValue() != null) {
inlineBeforeAnalysis |= Boolean.parseBoolean(prop.getValue());
} else {
if (prop.getValue() == null) {
nativeImageArgs.add("-J-D" + prop.getKey());
} else {
nativeImageArgs.add("-J-D" + prop.getKey() + "=" + prop.getValue());
}
}
}
if (nativeConfig.userLanguage.isPresent()) {
nativeImageArgs.add("-J-Duser.language=" + nativeConfig.userLanguage.get());
}
if (nativeConfig.userCountry.isPresent()) {
nativeImageArgs.add("-J-Duser.country=" + nativeConfig.userCountry.get());
}
nativeImageArgs.add("-J-Dfile.encoding=" + nativeConfig.fileEncoding);
if (enableSslNative) {
enableHttpsUrlHandler = true;
enableAllSecurityServices = true;
}
handleAdditionalProperties(nativeConfig, nativeImageArgs, isContainerBuild, outputDir);
nativeImageArgs.add(
"-H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime");
nativeImageArgs.add("-H:+JNI");
nativeImageArgs.add("-H:+AllowFoldMethods");
nativeImageArgs.add("-jar");
nativeImageArgs.add(runnerJarName);
if (nativeConfig.enableFallbackImages) {
nativeImageArgs.add("-H:FallbackThreshold=5");
} else {
nativeImageArgs.add("-H:FallbackThreshold=0");
}
if (nativeConfig.reportErrorsAtRuntime) {
nativeImageArgs.add("-H:+ReportUnsupportedElementsAtRuntime");
}
if (nativeConfig.reportExceptionStackTraces) {
nativeImageArgs.add("-H:+ReportExceptionStackTraces");
}
if (nativeConfig.debug.enabled) {
nativeImageArgs.add("-g");
nativeImageArgs.add("-H:DebugInfoSourceSearchPath=" + APP_SOURCES);
}
if (nativeConfig.debugBuildProcess) {
nativeImageArgs
.add("-J-Xrunjdwp:transport=dt_socket,address=" + DEBUG_BUILD_PROCESS_PORT + ",server=y,suspend=y");
}
if (nativeConfig.enableReports) {
nativeImageArgs.add("-H:+PrintAnalysisCallTree");
}
if (nativeConfig.dumpProxies) {
nativeImageArgs.add("-Dsun.misc.ProxyGenerator.saveGeneratedFiles=true");
}
if (nativeConfig.nativeImageXmx.isPresent()) {
nativeImageArgs.add("-J-Xmx" + nativeConfig.nativeImageXmx.get());
}
List<String> protocols = new ArrayList<>(2);
if (nativeConfig.enableHttpUrlHandler) {
protocols.add("http");
}
if (enableHttpsUrlHandler) {
protocols.add("https");
}
if (addAllCharsets) {
nativeImageArgs.add("-H:+AddAllCharsets");
} else {
nativeImageArgs.add("-H:-AddAllCharsets");
}
if (!protocols.isEmpty()) {
nativeImageArgs.add("-H:EnableURLProtocols=" + String.join(",", protocols));
}
if (enableAllSecurityServices && graalVMVersion.isOlderThan(GraalVM.Version.VERSION_21_1)) {
nativeImageArgs.add("--enable-all-security-services");
}
if (inlineBeforeAnalysis) {
if (graalVMVersion.isNewerThan(GraalVM.Version.VERSION_20_3)) {
nativeImageArgs.add("-H:+InlineBeforeAnalysis");
} else {
log.warn(
"The InlineBeforeAnalysis feature is not supported in GraalVM versions prior to 21.0.0."
+ " InlineBeforeAnalysis will thus not be enabled, please consider using a newer"
+ " GraalVM version if your application relies on this feature.");
}
}
if (!noPIE.isEmpty()) {
nativeImageArgs.add("-H:NativeLinkerOption=" + noPIE);
}
if (!nativeConfig.enableIsolates) {
nativeImageArgs.add("-H:-SpawnIsolates");
}
if (!nativeConfig.enableJni) {
log.warn(
"Your application is setting the deprecated 'quarkus.native.enable-jni' configuration key to false."
+ " Please consider removing this configuration key as it is ignored (JNI is always enabled) and it"
+ " will be removed in a future Quarkus version.");
}
if (nativeConfig.enableServer) {
log.warn(
"Your application is setting the deprecated 'quarkus.native.enable-server' configuration key to true."
+ " Please consider removing this configuration key as it is ignored"
+ " (The Native image build server is always disabled) and it"
+ " will be removed in a future Quarkus version.");
}
if (nativeConfig.enableVmInspection) {
nativeImageArgs.add("-H:+AllowVMInspection");
}
if (nativeConfig.autoServiceLoaderRegistration) {
nativeImageArgs.add("-H:+UseServiceLoaderFeature");
nativeImageArgs.add("-H:+TraceServiceLoaderFeature");
} else {
nativeImageArgs.add("-H:-UseServiceLoaderFeature");
}
if (nativeConfig.fullStackTraces) {
nativeImageArgs.add("-H:+StackTrace");
} else {
nativeImageArgs.add("-H:-StackTrace");
}
if (nativeConfig.enableDashboardDump) {
nativeImageArgs.add("-H:DashboardDump=" + outputTargetBuildItem.getBaseName() + "_dashboard.dump");
nativeImageArgs.add("-H:+DashboardAll");
}
if (graalVMVersion.isNewerThan(GraalVM.Version.VERSION_21_1)) {
nativeImageArgs.add("-H:-ParseOnce");
if (!nativeImageSecurityProviders.isEmpty()) {
String additionalSecurityProviders = nativeImageSecurityProviders.stream()
.map(NativeImageSecurityProviderBuildItem::getSecurityProvider)
.collect(Collectors.joining(","));
nativeImageArgs.add("-H:AdditionalSecurityProviders=" + additionalSecurityProviders);
}
for (ExcludeConfigBuildItem excludeConfig : excludeConfigs) {
nativeImageArgs.add("--exclude-config");
nativeImageArgs.add(excludeConfig.getJarFile());
nativeImageArgs.add(excludeConfig.getResourceName());
}
}
nativeImageArgs.add(nativeImageName);
return new NativeImageInvokerInfo(nativeImageArgs);
}

Line under review: if (!nativeImageSecurityProviders.isEmpty()) {

Code after addressing the review:
public NativeImageInvokerInfo build() {
List<String> nativeImageArgs = new ArrayList<>();
boolean enableSslNative = false;
boolean enableAllSecurityServices = nativeConfig.enableAllSecurityServices;
boolean inlineBeforeAnalysis = nativeConfig.inlineBeforeAnalysis;
boolean addAllCharsets = nativeConfig.addAllCharsets;
boolean enableHttpsUrlHandler = nativeConfig.enableHttpsUrlHandler;
for (NativeImageSystemPropertyBuildItem prop : nativeImageProperties) {
if (prop.getKey().equals("quarkus.ssl.native") && prop.getValue() != null) {
enableSslNative = Boolean.parseBoolean(prop.getValue());
} else if (prop.getKey().equals("quarkus.jni.enable") && prop.getValue().equals("false")) {
log.warn("Your application is setting the deprecated 'quarkus.jni.enable' configuration key to false."
+ " Please consider removing this configuration key as it is ignored (JNI is always enabled) and it"
+ " will be removed in a future Quarkus version.");
} else if (prop.getKey().equals("quarkus.native.enable-all-security-services") && prop.getValue() != null) {
enableAllSecurityServices |= Boolean.parseBoolean(prop.getValue());
} else if (prop.getKey().equals("quarkus.native.enable-all-charsets") && prop.getValue() != null) {
addAllCharsets |= Boolean.parseBoolean(prop.getValue());
} else if (prop.getKey().equals("quarkus.native.inline-before-analysis") && prop.getValue() != null) {
inlineBeforeAnalysis |= Boolean.parseBoolean(prop.getValue());
} else {
if (prop.getValue() == null) {
nativeImageArgs.add("-J-D" + prop.getKey());
} else {
nativeImageArgs.add("-J-D" + prop.getKey() + "=" + prop.getValue());
}
}
}
if (nativeConfig.userLanguage.isPresent()) {
nativeImageArgs.add("-J-Duser.language=" + nativeConfig.userLanguage.get());
}
if (nativeConfig.userCountry.isPresent()) {
nativeImageArgs.add("-J-Duser.country=" + nativeConfig.userCountry.get());
}
nativeImageArgs.add("-J-Dfile.encoding=" + nativeConfig.fileEncoding);
if (enableSslNative) {
enableHttpsUrlHandler = true;
enableAllSecurityServices = true;
}
handleAdditionalProperties(nativeConfig, nativeImageArgs, isContainerBuild, outputDir);
nativeImageArgs.add(
"-H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime");
nativeImageArgs.add("-H:+JNI");
nativeImageArgs.add("-H:+AllowFoldMethods");
nativeImageArgs.add("-jar");
nativeImageArgs.add(runnerJarName);
if (nativeConfig.enableFallbackImages) {
nativeImageArgs.add("-H:FallbackThreshold=5");
} else {
nativeImageArgs.add("-H:FallbackThreshold=0");
}
if (nativeConfig.reportErrorsAtRuntime) {
nativeImageArgs.add("-H:+ReportUnsupportedElementsAtRuntime");
}
if (nativeConfig.reportExceptionStackTraces) {
nativeImageArgs.add("-H:+ReportExceptionStackTraces");
}
if (nativeConfig.debug.enabled) {
nativeImageArgs.add("-g");
nativeImageArgs.add("-H:DebugInfoSourceSearchPath=" + APP_SOURCES);
}
if (nativeConfig.debugBuildProcess) {
nativeImageArgs
.add("-J-Xrunjdwp:transport=dt_socket,address=" + DEBUG_BUILD_PROCESS_PORT + ",server=y,suspend=y");
}
if (nativeConfig.enableReports) {
nativeImageArgs.add("-H:+PrintAnalysisCallTree");
}
if (nativeConfig.dumpProxies) {
nativeImageArgs.add("-Dsun.misc.ProxyGenerator.saveGeneratedFiles=true");
}
if (nativeConfig.nativeImageXmx.isPresent()) {
nativeImageArgs.add("-J-Xmx" + nativeConfig.nativeImageXmx.get());
}
List<String> protocols = new ArrayList<>(2);
if (nativeConfig.enableHttpUrlHandler) {
protocols.add("http");
}
if (enableHttpsUrlHandler) {
protocols.add("https");
}
if (addAllCharsets) {
nativeImageArgs.add("-H:+AddAllCharsets");
} else {
nativeImageArgs.add("-H:-AddAllCharsets");
}
if (!protocols.isEmpty()) {
nativeImageArgs.add("-H:EnableURLProtocols=" + String.join(",", protocols));
}
if (enableAllSecurityServices && graalVMVersion.isOlderThan(GraalVM.Version.VERSION_21_1)) {
nativeImageArgs.add("--enable-all-security-services");
}
if (inlineBeforeAnalysis) {
if (graalVMVersion.isNewerThan(GraalVM.Version.VERSION_20_3)) {
nativeImageArgs.add("-H:+InlineBeforeAnalysis");
} else {
log.warn(
"The InlineBeforeAnalysis feature is not supported in GraalVM versions prior to 21.0.0."
+ " InlineBeforeAnalysis will thus not be enabled, please consider using a newer"
+ " GraalVM version if your application relies on this feature.");
}
}
if (!noPIE.isEmpty()) {
nativeImageArgs.add("-H:NativeLinkerOption=" + noPIE);
}
if (!nativeConfig.enableIsolates) {
nativeImageArgs.add("-H:-SpawnIsolates");
}
if (!nativeConfig.enableJni) {
log.warn(
"Your application is setting the deprecated 'quarkus.native.enable-jni' configuration key to false."
+ " Please consider removing this configuration key as it is ignored (JNI is always enabled) and it"
+ " will be removed in a future Quarkus version.");
}
if (nativeConfig.enableServer) {
log.warn(
"Your application is setting the deprecated 'quarkus.native.enable-server' configuration key to true."
+ " Please consider removing this configuration key as it is ignored"
+ " (The Native image build server is always disabled) and it"
+ " will be removed in a future Quarkus version.");
}
if (nativeConfig.enableVmInspection) {
nativeImageArgs.add("-H:+AllowVMInspection");
}
if (nativeConfig.autoServiceLoaderRegistration) {
nativeImageArgs.add("-H:+UseServiceLoaderFeature");
nativeImageArgs.add("-H:+TraceServiceLoaderFeature");
} else {
nativeImageArgs.add("-H:-UseServiceLoaderFeature");
}
if (nativeConfig.fullStackTraces) {
nativeImageArgs.add("-H:+StackTrace");
} else {
nativeImageArgs.add("-H:-StackTrace");
}
if (nativeConfig.enableDashboardDump) {
nativeImageArgs.add("-H:DashboardDump=" + outputTargetBuildItem.getBaseName() + "_dashboard.dump");
nativeImageArgs.add("-H:+DashboardAll");
}
if (graalVMVersion.isNewerThan(GraalVM.Version.VERSION_21_1)) {
nativeImageArgs.add("-H:-ParseOnce");
if (nativeImageSecurityProviders != null && !nativeImageSecurityProviders.isEmpty()) {
String additionalSecurityProviders = nativeImageSecurityProviders.stream()
.map(p -> p.getSecurityProvider())
.collect(Collectors.joining(","));
nativeImageArgs.add("-H:AdditionalSecurityProviders=" + additionalSecurityProviders);
}
for (ExcludeConfigBuildItem excludeConfig : excludeConfigs) {
nativeImageArgs.add("--exclude-config");
nativeImageArgs.add(excludeConfig.getJarFile());
nativeImageArgs.add(excludeConfig.getResourceName());
}
}
nativeImageArgs.add(nativeImageName);
return new NativeImageInvokerInfo(nativeImageArgs);
}