Skip to content

Commit

Permalink
Revert removal of casts and add CommandLineSettingsTests to the suite
Browse files Browse the repository at this point in the history
  • Loading branch information
waynebeaton committed Jan 13, 2025
1 parent f15c9c0 commit 3ce24e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class CommandLineSettings implements ISettings {
@Override
public int getBatchSize() {
try {
return commandLine.getParsedOptionValue(BATCH_OPTION, () -> ISettings.super.getBatchSize()).intValue();
return ((Number) commandLine.getParsedOptionValue(BATCH_OPTION, () -> ISettings.super.getBatchSize())).intValue();
} catch (ParseException e) {
// TODO Deal with this
throw new RuntimeException(e);
Expand All @@ -63,7 +63,7 @@ public int getTimeout() {
@Override
public int getConfidenceThreshold() {
try {
return commandLine.getParsedOptionValue(CONFIDENCE_OPTION, () -> ISettings.super.getConfidenceThreshold()).intValue();

This comment has been minimized.

Copy link
@sophokles73

sophokles73 Jan 14, 2025

Contributor

FMPOV the fix should actually be to change the corresponding Options' type from Number to Integer.

This comment has been minimized.

Copy link
@waynebeaton

waynebeaton Jan 15, 2025

Author Collaborator

Agreed. I'll push an update.

return ((Number) commandLine.getParsedOptionValue(CONFIDENCE_OPTION, () -> ISettings.super.getConfidenceThreshold())).intValue();
} catch (ParseException e) {
// TODO Deal with this
throw new RuntimeException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.eclipse.dash.licenses.cli.CommandLineSettings;
import org.junit.jupiter.api.Test;

class CommandLineSettingsTest {
class CommandLineSettingsTests {

@Test
void testCustomBatchSize() {
Expand Down

0 comments on commit 3ce24e0

Please sign in to comment.