Skip to content

Commit 75e34d2

Browse files
committed
try to fix build error, overly concrete parameter
1 parent 24c9da8 commit 75e34d2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/thealgorithms/conversions/WordsToNumber.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.math.BigDecimal;
55
import java.util.ArrayDeque;
66
import java.util.ArrayList;
7+
import java.util.Collection;
78
import java.util.HashMap;
89
import java.util.List;
910
import java.util.Map;
@@ -123,7 +124,7 @@ private static BigDecimal handleHundred(BigDecimal currentChunk, String word, bo
123124
return currentChunk.multiply(BigDecimal.valueOf(100));
124125
}
125126

126-
private static void handlePowerOfTen(List<BigDecimal> chunks, BigDecimal currentChunk, BigDecimal powerOfTen, String word, boolean prevNumWasPowerOfTen) {
127+
private static void handlePowerOfTen(Collection<BigDecimal> chunks, BigDecimal currentChunk, BigDecimal powerOfTen, String word, boolean prevNumWasPowerOfTen) {
127128
boolean currentChunkIsZero = currentChunk.compareTo(BigDecimal.ZERO) == 0;
128129
if (currentChunkIsZero || prevNumWasPowerOfTen) {
129130
throw new WordsToNumberException(WordsToNumberException.ErrorType.UNEXPECTED_WORD, word);
@@ -136,7 +137,7 @@ private static void handlePowerOfTen(List<BigDecimal> chunks, BigDecimal current
136137
chunks.add(nextChunk);
137138
}
138139

139-
private static BigDecimal handleNumber(List<BigDecimal> chunks, BigDecimal currentChunk, String word, Integer number) {
140+
private static BigDecimal handleNumber(Collection<BigDecimal> chunks, BigDecimal currentChunk, String word, Integer number) {
140141
boolean currentChunkIsZero = currentChunk.compareTo(BigDecimal.ZERO) == 0;
141142
if (number == 0 && !(currentChunkIsZero && chunks.isEmpty())) {
142143
throw new WordsToNumberException(WordsToNumberException.ErrorType.UNEXPECTED_WORD, word);

0 commit comments

Comments
 (0)