Skip to content

Commit 8d202ab

Browse files
author
eberhardtj
committed
Fix cannot cast object 'false' to Integer
The predefined value of MaxRetries ist 0. Groovy interpret this as a boolean false instead of an integer. A call with 0 raised the following exception: Cannot cast object 'false' with class 'java.lang.Boolean' to class 'java.lang.Integer' The applied fix, catches a possible boolean value and transforms it to an integer.
1 parent 925d062 commit 8d202ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/ParallelPost.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ inputStream.withReader(utf8, { reader ->
8686
writer.setBatchSize((Integer) options.b)
8787
writer.setCommitWithinMs((Integer) options.d)
8888
writer.setThreads((Integer) options.t)
89-
writer.setMaxRetries((Integer) options.r)
89+
writer.setMaxRetries(options.r ? options.r.toInteger() : 0)
9090
writer.setWaitMs((Integer) options.w)
9191

9292
decoder.setReceiver(handler)

0 commit comments

Comments
 (0)