DateTime::Lite pure-Perl fallback returns negative local_day_of_week
DateTime::Lite v0.8.0 fails one upstream test under PerlOnJava:
t/11.accessors.t — local_day_of_week() in 1..7
The same distribution passes completely under system Perl (346/346 tests).
PerlOnJava reproduces the failure on both the JVM and interpreter backends,
using DateTime::Lite's pure-Perl fallback because its XS code is unavailable.
Observed behavior:
my $dt = DateTime::Lite->now;
my $x = $dt->day_of_week - $dt->{locale}->first_day_of_week;
# x = -5, and x % 7 returns 2
# but $dt->local_day_of_week returns -4
The dynamically autoloaded implementation is:
return( 1 + ( ( $self->day_of_week - $self->{locale}->first_day_of_week ) % 7 ) );
This suggests that the dynamically compiled/autoloaded method is applying Java
remainder semantics (-5 % 7 == -5) instead of Perl modulus semantics
(-5 % 7 == 2). A direct top-level PerlOnJava expression returns the correct
value, so the discrepancy appears specific to the dynamic/autoloaded execution
path.
Failure classification: confirmed PerlOnJava internal bug, affecting both
backends. CPAN compatibility run: 20260908-190650-31465.
DateTime::Lite pure-Perl fallback returns negative
local_day_of_weekDateTime::Lite v0.8.0 fails one upstream test under PerlOnJava:
The same distribution passes completely under system Perl (346/346 tests).
PerlOnJava reproduces the failure on both the JVM and interpreter backends,
using DateTime::Lite's pure-Perl fallback because its XS code is unavailable.
Observed behavior:
The dynamically autoloaded implementation is:
This suggests that the dynamically compiled/autoloaded method is applying Java
remainder semantics (
-5 % 7 == -5) instead of Perl modulus semantics(
-5 % 7 == 2). A direct top-level PerlOnJava expression returns the correctvalue, so the discrepancy appears specific to the dynamic/autoloaded execution
path.
Failure classification: confirmed PerlOnJava internal bug, affecting both
backends. CPAN compatibility run: 20260908-190650-31465.