Notifications

35 views

Description

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:

    1. Open /sys.scripts.do
    2. input the following script and submit
    3. 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

Article Information

Last Updated:2020-04-03 16:44:37
Published:2020-04-03