Jfinance

A discussion forum for the JCommon class library.

Jfinance

Postby AaronPrice » Fri Jan 04, 2008 10:21 pm

Hello,

There didn't seem to be a place for this, so here goes:

I use both JFinance and JCommon packages (old stuff, I know) to calculate business days/weekends. This logic broke over the new year, due to the way that a very, very old version of jcommon (0.4.1). I've downloaded the source of the newest release of JCommon (which presumably does not have this problem), but am unable to find the source of jfinance. The link on the jfinance page is broken, is there somewhere else I can get it? I am scrambling right now because my system thinks that today is Saturday! Any help would be greatly appreciated.

Thanks,
Aaron
AaronPrice
 
Posts: 3
Joined: Fri Jan 04, 2008 10:19 pm

Postby david.gilbert » Fri Jan 04, 2008 11:27 pm

I posted a copy here:

http://www.object-refinery.com/jfinance ... -0.3.0.zip

Let me know the problem you are running into, maybe I can suggest a fix.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited
david.gilbert
JFreeChart Project Leader
 
Posts: 11623
Joined: Fri Mar 14, 2003 10:29 am

Postby AaronPrice » Mon Jan 07, 2008 9:19 pm

Hi Dave, thanks so much for the response.

The problem that we've been experiencing since the beginning of the year is that the day of week is somehow reported as one off from the actual day. For example:

SerialDate sdToday = SerialDate.createInstance( gcToday.getTime() );

System.out.println(sdToday.getDayOfWeek());

returns a 3 (Tuesday) when it should return a 2 (Monday). This only started happening at the new year, so I'm assuming that it must be a leap year bug.

I updated the jfinance code that you posted (thanks again!) to reference the latest jcommon jar, which then returned the correct results. However, now I have a new problem - we also use the IBD class (1.2.1), which now breaks because the package structure of jcommon (which IBD references) is different.

Dave, could you do me one more favor? Either I need the jar with the source code for IBD so I can manually update the imports to reference the newest jcommon jar (this seemed to work for jfinance), or perhaps you can offer a suggestion as to how to fix the problem I described? The version of jcommon we were using was 0.4.1, which I also don't have the source to (therefore making troubleshooting the problem difficult).

Otherwise I think that updating IBD would work just fine. If you happen to have it handy, I would really appreciate it!

Thanks in advance for your help!
Aaron
AaronPrice
 
Posts: 3
Joined: Fri Jan 04, 2008 10:19 pm

Postby david.gilbert » Tue Jan 08, 2008 1:05 pm

I posted a copy of the IBD source code here:

http://www.object-refinery.com/ibd/ibd-1.2.1.zip
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited
david.gilbert
JFreeChart Project Leader
 
Posts: 11623
Joined: Fri Mar 14, 2003 10:29 am

Postby AaronPrice » Tue Jan 08, 2008 8:49 pm

Thanks Dave, that did the trick. I updated the IBD source to refer to the latest version of jcommon, as well as a few other edits (some of the Swing reference had changed, presumably due to new versions of Java.. also the SerialDates class went away, but was replaced by SerialDateUtilities, etc.) Everything is working fine now, thanks so much for your help!
AaronPrice
 
Posts: 3
Joined: Fri Jan 04, 2008 10:19 pm


Return to JCommon

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron