Bug in addition

A discussion forum for the JCommon class library.
Locked
joseph

Bug in addition

Post by joseph » Fri Jan 18, 2002 4:31 pm

If you try this you can reach a java.lang.ArrayIndexOutOfBoundsException.

while(true)
{
serialDate = serialDate.addDays(1, serialDate);
}

StackTrace :

java.lang.ArrayIndexOutOfBoundsException

at com.jrefinery.date.SpreadsheetDate.calcDayMonthYear(Unknown Source)

at com.jrefinery.date.SpreadsheetDate.<init>(Unknown Source)

at com.jrefinery.date.SerialDate.createInstance(Unknown Source)

at com.jrefinery.date.SerialDate.addDays(Unknown Source)

at com.dst.test.TestDay.addXBusinessDay(TestDay.java:81)

at com.dst.test.TestDay.<init>(TestDay.java:134)

at com.dst.test.TestDay.main(TestDay.java:141)

Exception in thread "main"

@+

David Gilbert

RE: Bug in addition

Post by David Gilbert » Tue Jan 22, 2002 11:24 am

Hi Joseph,

This is a bug with the SpreadsheetDate class that I have fixed. I was sure I had included the fix in version 0.5.2 of JCommon, so I'm checking that now.

An earlier version of JCommon is included with the International Business Days utility, so it is possible that you are using that. Can you confirm which version you have?

In either case, I will be releasing a JCommon update in the next day or so which will definitely include the fix. Then I will have to see what changes I need to make to IBD to ensure that it still compiles...

Regards,

DG.

joseph

RE: Bug in addition

Post by joseph » Tue Jan 22, 2002 3:18 pm

Hi,

I found the problem.
In my test I use the version 0.4.1 of JCommon included in ibd 1.2.1.

Thanks for your remarks.

Locked