Menu

#88 Math object failed while calculating which ChangeSets...

open
nobody
None
5
2007-01-29
2007-01-29
Anonymous
No

perl 5.8.5
cvsmonitor 0.6.3
Array::Window 1.00
on RedHat Enterprise Linux 4.3

While searching for changesets I receive this error:
Math object failed while calculating which ChangeSets to show

In trying to fix the problem I found in the Array::Window code this statement:
...
unless ( ref $options{source} eq 'ARRAY' ) {
return undef;
}
...

The Window object for the changeset is created from an Activity object, so I tryed to patch cvsmonitor.pl blessing the Activity object to an ARRAY object before passing it to the Array::Window constructor, and back to an Activity object after the creation of the Array::Window object.

The changeset search then worked. I don't know if it's the right solution: I don't know perl, so I submit this bug and the patch.

Alessandro Guccione
alexandros.guccione@gmail.com

cvsmonitor.pl:
@@ -2273,10 +2273,16 @@
my $window_start = $fin->{window_start} || 0;
my $window_length = $fin->{window_length} || 20;

+ # Type cast the Activity object due to restriction to arrays in package Array::Window
+ # added by Guccione
+ bless ( $Activity, "ARRAY");
# Create a Window to do the math
my $Window = Array::Window->new( source => $Activity,
window_start => $window_start,
window_length => $window_length );
+ # Revert the type cast the Activity object due to restriction to arrays in package Array::Window
+ # added by Guccione
+ bless ( $Activity, "CVSMonitor::MetaData::Activity");
Error( "Math object failed while calculating which ChangeSets to show" ) unless $Window;

# Create the parser

Discussion

  • Nobody/Anonymous

    patch for cvsmonitor.pl

     
  • Nobody/Anonymous

    Logged In: NO

    Hello, anyone can help with this issue?

     

Log in to post a comment.