Details
Description
Hi, I have the same issue as in GROOVY-4587.
For the inputs
[0.0], [], [], [543]
the function-code below does throw an Exception which can be fixed by changing
if (ReWK < 0) {
to
if (((int)ReWK) < 0) {
Seems like a bug to me or am I doing it wrong? Various other inputs run fine.
Gesamtbetrag,Direktabzug,Prozent,Einzelbetrag-> def int ReWK = 0 def arrAbzWK = []; Gesamtbetrag.eachWithIndex { it, index -> if(Gesamtbetrag[index] > 0){ if(Prozent[index] != 0 && Prozent[index] != null) { ReWK = Math.ceil( Gesamtbetrag[index] * (100 - Prozent[index]) / 100 ) } else if (Direktabzug[index] > 0 ) { ReWK = Math.ceil( Gesamtbetrag[index] - Direktabzug[index] ) if (ReWK < 0) { ReWK = 0 } } else if (Einzelbetrag[index] > 0) { ReWK = Math.ceil( Einzelbetrag[index] ) } else { ReWK = 0 } } arrAbzWK.add(ReWK) } return arrAbzWK
Activity
David Hansmann
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Attachment | test.groovy [ 54394 ] |
David Hansmann
made changes -
| Attachment | gmaven-1.3.tgz [ 54395 ] |
Guillaume Laforge
made changes -
| Description |
Hi, I have the same issue as in For the inputs [0.0], [], [], [543] the function-code below does throw an Exception which can be fixed by changing if (ReWK < 0) { to if (((int)ReWK) < 0) { Seems like a bug to me or am I doing it wrong? Various other inputs run fine. Gesamtbetrag,Direktabzug,Prozent,Einzelbetrag-> def int ReWK = 0 def arrAbzWK = []; Gesamtbetrag.eachWithIndex { it, index -> if(Gesamtbetrag[index] > 0){ if(Prozent[index] != 0 && Prozent[index] != null) { ReWK = Math.ceil( Gesamtbetrag[index] * (100 - Prozent[index]) / 100 ) } else if (Direktabzug[index] > 0 ) { ReWK = Math.ceil( Gesamtbetrag[index] - Direktabzug[index] ) if (ReWK < 0) { ReWK = 0 } } else if (Einzelbetrag[index] > 0) { ReWK = Math.ceil( Einzelbetrag[index] ) } else { ReWK = 0 } } arrAbzWK.add(ReWK) } return arrAbzWK |
Hi, I have the same issue as in For the inputs {code} [0.0], [], [], [543] {code} the function-code below does throw an Exception which can be fixed by changing {code} if (ReWK < 0) { {code} to {code} if (((int)ReWK) < 0) { {code} Seems like a bug to me or am I doing it wrong? Various other inputs run fine. {code} Gesamtbetrag,Direktabzug,Prozent,Einzelbetrag-> def int ReWK = 0 def arrAbzWK = []; Gesamtbetrag.eachWithIndex { it, index -> if(Gesamtbetrag[index] > 0){ if(Prozent[index] != 0 && Prozent[index] != null) { ReWK = Math.ceil( Gesamtbetrag[index] * (100 - Prozent[index]) / 100 ) } else if (Direktabzug[index] > 0 ) { ReWK = Math.ceil( Gesamtbetrag[index] - Direktabzug[index] ) if (ReWK < 0) { ReWK = 0 } } else if (Einzelbetrag[index] > 0) { ReWK = Math.ceil( Einzelbetrag[index] ) } else { ReWK = 0 } } arrAbzWK.add(ReWK) } return arrAbzWK {code} |
Guillaume Laforge
made changes -
| Assignee | Jochen Theodorou [ blackdrag ] | |
| Fix Version/s | 1.8-rc-4 [ 17245 ] | |
| Fix Version/s | 1.9-beta-1 [ 17153 ] | |
| Priority | Minor [ 4 ] | Critical [ 2 ] |
blackdrag blackdrag
made changes -
| Status | Open [ 1 ] | Closed [ 6 ] |
| Fix Version/s | 1.9-beta-1 [ 17153 ] | |
| Resolution | Fixed [ 1 ] |