Skip to content

Commit 081fdf2

Browse files
authored
SessionSettings - Cleaning up getBool() exception handling (#575)
* 378 - SessionSettings - Cleaning up the exception handling * Adjusting indentation
1 parent 196c776 commit 081fdf2

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

quickfixj-core/src/main/java/quickfix/SessionSettings.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public SessionSettings(Properties variableValues) {
111111
*
112112
* @param filename the path to the file containing the session settings
113113
* @param variableValues custom source of variable values in the settings
114-
* @throws quickfix.ConfigError when file could not be loaded
114+
* @throws ConfigError when file could not be loaded
115115
*/
116116
public SessionSettings(String filename, Properties variableValues) throws ConfigError {
117117
this(variableValues);
@@ -122,7 +122,7 @@ public SessionSettings(String filename, Properties variableValues) throws Config
122122
* Loads session settings from a file.
123123
*
124124
* @param filename the path to the file containing the session settings
125-
* @throws quickfix.ConfigError when file could not be loaded
125+
* @throws ConfigError when file could not be loaded
126126
*/
127127
public SessionSettings(String filename) throws ConfigError {
128128
this();
@@ -365,12 +365,8 @@ public boolean getBool(String key) throws ConfigError, FieldConvertError {
365365
* @throws ConfigError configuration error, probably a missing setting.
366366
* @throws FieldConvertError error during field type conversion.
367367
*/
368-
public boolean getBool(SessionID sessionID, String key) throws ConfigError, FieldConvertError {
369-
try {
370-
return BooleanConverter.convert(getString(sessionID, key));
371-
} catch (final FieldConvertError e) {
372-
throw new ConfigError(e);
373-
}
368+
public boolean getBool(SessionID sessionID, String key) throws FieldConvertError, ConfigError {
369+
return BooleanConverter.convert(getString(sessionID, key));
374370
}
375371

376372
/**
@@ -472,8 +468,7 @@ private void load(InputStream inputStream) throws ConfigError {
472468
}
473469
storeSection(currentSectionId, currentSection);
474470
} catch (final IOException e) {
475-
final ConfigError configError = new ConfigError(e.getMessage());
476-
throw configError;
471+
throw new ConfigError(e.getMessage());
477472
}
478473
}
479474

0 commit comments

Comments
 (0)