Skip to content

Commit

Permalink
replaced by IntConverter and removed try-catch
Browse files Browse the repository at this point in the history
  • Loading branch information
chrjohn committed Jul 4, 2024
1 parent 3a24a21 commit 6a65e2b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions quickfixj-core/src/main/java/quickfix/SessionSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import quickfix.field.converter.IntConverter;

/**
* Settings for sessions. Settings are grouped by FIX version and target company
Expand Down Expand Up @@ -339,11 +340,7 @@ public int getIntOrDefault(String key, int defaultValue) throws ConfigError, Fie
* @throws FieldConvertError error during field type conversion.
*/
public int getInt(SessionID sessionID, String key) throws ConfigError, FieldConvertError {
try {
return Integer.parseInt(getString(sessionID, key));
} catch (final NumberFormatException e) {
throw new FieldConvertError(e.getMessage());
}
return IntConverter.convert(getString(sessionID, key));
}

/**
Expand Down

0 comments on commit 6a65e2b

Please sign in to comment.