Issue
a custom script that throws the following error in the logs:
org.mozilla.javascript.WrappedException: Wrapped org.mozilla.javascript.EvaluatorException: Cannot convert 6275679840 to java.lang.Integer
STEP TO REPRODUCE:
-
- Open /sys.scripts.do
- input the following script and submit
-
var calculator = new DurationCalculator(); var due = calculator.calcRelativeDueDate("05/26/2020", "2147483648", "16:00:00");
Cause
- java integer limit is: 2,147,483,647
- Anything above this number will throw the error
Resolution
- refactor custom code
- in the above script, the second argument to method calcRelativeDueDate is expecting the number of days
- 2147483648 days equals 58835.168438356 centuries