Skip to content

Commit

Permalink
COLDBOX-1274 #resolve
Browse files Browse the repository at this point in the history
javacasting to long for new Java LocalDateTime instead of int, Adobe not doing type promotion
  • Loading branch information
lmajano committed Apr 8, 2024
1 parent ec2f0f5 commit e144ecf
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions system/async/tasks/ScheduledTask.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -1626,29 +1626,29 @@ component accessors="true" {
if ( amount ) {
switch ( unit ) {
case "days":
variables.stats.nextRun = variables.stats.nextRun.plusDays( javacast( "int", amount ) );
variables.stats.nextRun = variables.stats.nextRun.plusDays( javacast( "long", amount ) );
break;
case "hours":
variables.stats.nextRun = variables.stats.nextRun.plusHours( javacast( "int", amount ) );
variables.stats.nextRun = variables.stats.nextRun.plusHours( javacast( "long", amount ) );
break;
case "minutes":
variables.stats.nextRun = variables.stats.nextRun.plusMinutes( javacast( "int", amount ) );
variables.stats.nextRun = variables.stats.nextRun.plusMinutes( javacast( "long", amount ) );
break;
case "milliseconds":
variables.stats.nextRun = variables.stats.nextRun.plusSeconds(
javacast( "int", amount / 1000 )
javacast( "long", amount / 1000 )
);
break;
case "microseconds":
variables.stats.nextRun = variables.stats.nextRun.plusNanos(
javacast( "int", amount * 1000 )
javacast( "long", amount * 1000 )
);
break;
case "nanoseconds":
variables.stats.nextRun = variables.stats.nextRun.plusNanos( javacast( "int", amount ) );
variables.stats.nextRun = variables.stats.nextRun.plusNanos( javacast( "long", amount ) );
break;
default:
variables.stats.nextRun = variables.stats.nextRun.plusSeconds( javacast( "int", amount ) );
variables.stats.nextRun = variables.stats.nextRun.plusSeconds( javacast( "long", amount ) );
break;
}
}
Expand Down Expand Up @@ -1791,25 +1791,25 @@ component accessors="true" {
if ( !len( variables.stats.nextRun ) ) {
switch ( variables.timeUnit ) {
case "days":
variables.stats.nextRun = now.plusDays( javacast( "int", amount ) );
variables.stats.nextRun = now.plusDays( javacast( "long", amount ) );
break;
case "hours":
variables.stats.nextRun = now.plusHours( javacast( "int", amount ) );
variables.stats.nextRun = now.plusHours( javacast( "long", amount ) );
break;
case "minutes":
variables.stats.nextRun = now.plusMinutes( javacast( "int", amount ) );
variables.stats.nextRun = now.plusMinutes( javacast( "long", amount ) );
break;
case "milliseconds":
variables.stats.nextRun = now.plusSeconds( javacast( "int", amount / 1000 ) );
variables.stats.nextRun = now.plusSeconds( javacast( "long", amount / 1000 ) );
break;
case "microseconds":
variables.stats.nextRun = now.plusNanos( javacast( "int", amount * 1000 ) );
variables.stats.nextRun = now.plusNanos( javacast( "long", amount * 1000 ) );
break;
case "nanoseconds":
variables.stats.nextRun = now.plusNanos( javacast( "int", amount ) );
variables.stats.nextRun = now.plusNanos( javacast( "long", amount ) );
break;
default:
variables.stats.nextRun = now.plusSeconds( javacast( "int", amount ) );
variables.stats.nextRun = now.plusSeconds( javacast( "long", amount ) );
break;
}
}
Expand Down

0 comments on commit e144ecf

Please sign in to comment.