Skip to content

Commit 5705d30

Browse files
author
Santiago Gala
committed
Constructor NumberFormatException(GStringImpl (or String), Exception) does not exist
Also, typo in waitForPidsRemoved: intersection should be NON empty. [1] Example seen: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: java.lang.NumberFormatException(org.codehaus.groovy.runtime.GStringImpl, java.lang.NumberFormatException) at noe.tomcat.tests.JWSSELinux.JWS1363TomcatRunWithUnconfinedDomain(JWSSELinux.groovy:182)
1 parent 31b601a commit 5705d30

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

core/src/main/groovy/noe/common/utils/Cmd.groovy

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,8 @@ public class Cmd {
854854
try {
855855
javaPids.add(Integer.parseInt(pid))
856856
} catch (NumberFormatException ex) {
857-
throw new NumberFormatException("Guys, I can't parse Integer from:${pid}", ex)
857+
log.error("Error trying to parse process ID from: \"${pid}\"")
858+
throw ex
858859
}
859860
}
860861

@@ -897,7 +898,8 @@ public class Cmd {
897898
try {
898899
pids.add(Integer.parseInt(pid))
899900
} catch (NumberFormatException ex) {
900-
throw new NumberFormatException("Guys, I can't parse Integer from:${pid}", ex)
901+
log.error("Error trying to parse process ID from: \"${pid}\"")
902+
throw ex
901903
}
902904
}
903905

@@ -952,7 +954,8 @@ public class Cmd {
952954
try {
953955
pids.add(Integer.parseInt(pid))
954956
} catch (NumberFormatException ex) {
955-
throw new NumberFormatException("Guys, I can't parse Integer from:${pid}", ex)
957+
log.error("Error trying to parse process ID from: \"${pid}\"")
958+
throw ex
956959
}
957960
} else {
958961
log.error("WIDLE match didn't succeed :-) it was: match.size():${match.size()}")
@@ -1053,9 +1056,9 @@ public class Cmd {
10531056
*/
10541057
static boolean waitForPidsRemoved(List<Integer> pids, int timeout, TimeUnit timeUnit) {
10551058
long maxTime = System.currentTimeMillis() + timeUnit.toMillis(timeout)
1056-
boolean anyPidExist = getPidList().intersect(pids).isEmpty()
1059+
boolean anyPidExist = !getPidList().intersect(pids).isEmpty()
10571060
while (anyPidExist && System.currentTimeMillis() <= maxTime) {
1058-
anyPidExist = getPidList().intersect(pids).isEmpty()
1061+
anyPidExist = !getPidList().intersect(pids).isEmpty()
10591062
Library.letsSleep(42)
10601063
}
10611064
if (anyPidExist) {

0 commit comments

Comments
 (0)