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
13 changes: 9 additions & 4 deletions core/launcher/src/main/java/org/phoebus/product/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,15 @@
iter.remove();

logger.info("Loading settings from " + location);
if (location.endsWith(".xml"))
Preferences.importPreferences(new FileInputStream(location));
else
PropertyPreferenceLoader.load(location);
try {

Check warning on line 143 in core/launcher/src/main/java/org/phoebus/product/Launcher.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Extract this nested try block into a separate method.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AaFUUFjVHgtdV_wvKrFb&open=AaFUUFjVHgtdV_wvKrFb&pullRequest=3968
if (location.endsWith(".xml"))
Preferences.importPreferences(new FileInputStream(location));
else
PropertyPreferenceLoader.load(location);
} catch (Exception e) {
logger.severe("Failed to load settings from " + location);
e.printStackTrace();

Check warning on line 150 in core/launcher/src/main/java/org/phoebus/product/Launcher.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make sure this debug feature is deactivated before delivering the code in production.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AaFUUFjVHgtdV_wvKrFc&open=AaFUUFjVHgtdV_wvKrFc&pullRequest=3968
}

} else if (cmd.equals("-export_settings")) {
if (!iter.hasNext())
Expand Down
Loading