Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018-2023 Oak Ridge National Laboratory.
* Copyright (c) 2018-2026 Oak Ridge National Laboratory.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -544,13 +544,20 @@
Map.entry(kafka_props_arg, "kafka_properties")
);

// Allow more than one `-settings`
List<String> setting_files = new ArrayList<>();

Check warning on line 548 in services/alarm-server/src/main/java/org/phoebus/applications/alarm/server/AlarmServerMain.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AZ77LMuzYgWGM6F0gulx&open=AZ77LMuzYgWGM6F0gulx&pullRequest=3849

while (iter.hasNext()) {
final String cmd = iter.next();
if (options.contains(cmd)) {
if (!iter.hasNext())
throw new Exception("Missing argument for " + cmd);
final String arg = iter.next();
parsed_args.put(cmd, arg);
// Accumulate -settings
if (settings_arg.equals(cmd))
setting_files.add(arg);
else // other -cmd arg
parsed_args.put(cmd, arg);
} else if (flags.contains(cmd))
parsed_args.put(cmd, "");
else
Expand All @@ -564,8 +571,7 @@
if (parsed_args.containsKey(logging_arg)) {
LogManager.getLogManager().readConfiguration(new FileInputStream(parsed_args.get(logging_arg)));
}
if (parsed_args.containsKey(settings_arg)) {
final String filename = parsed_args.get(settings_arg);
for (String filename : setting_files) {
logger.info("Loading settings from " + filename);
PropertyPreferenceLoader.load(new FileInputStream(filename));
final Preferences userPrefs = Preferences.userRoot().node("org/phoebus/applications/alarm");
Expand Down
Loading