I don't know if this is the right forum to post my question. If it is not, then move to the right place. I have three conditions. I have three fields of type BigDecimal.
1. If I enter $100.00 in one field, then it should show $100.00 in the second field and $75 in the third field which is working fine.
2. If I enter $0.00 in one field, then it should show $0.00 amounts in other fields which is working fine too.
3. If I enter nothing or blank, then it should show blank for all the fields based on my condition but this is not working for second and the third fields and it reads the value from the first field.
I have the following code, so please guide me in this regard.
You might also consider an enum for the type of Action. Or maybe putting action types into a Map. Those multiple ||s are potentially error-prone. What happens if you add "Employment" as a potential type of dispute? What happens if your dispute is about a "Company car"?
(Still) the class name
Line 11: TCLog.getRuleLogger().debug((new StringBuilder("In action() method Current User is ::--> ")).append(currentUser).toString()); Why not just concatenate with +?
Line 16: Why not use this object through out the method instead of getting it constantly with dispute.getDetailForKey("LITI");
Line 18: Why declare it there when it only gets used in the if-block and gets assigned there?
Line 19: Why declare it there when it only gets used on line 36?
Line 20: Why declare it there when it only gets used on line 36?
Line 30 & 33 in if and else part are the same.
Line 34: didn't you just set that?
Line 36: you're multiplying it with 75 and then 100? Why not multiply it with 7500?
Line 42: why not chain the exceptions and retain the stacktrace?
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.