On 31/01/2011, at 12:01 AM, Theodore Petrosky wrote:

> So my attempt is to add into LocalDate the extends like this:
> 
> public class LocalDate  extends java.util.Date implements ReadablePartial, 
> Comparable<Object>
> {
> 
> }

I don't think you need or want to do this.  I don't think your LocalDate 
wrapper (which, for those who haven't looked at Henrique's example, just 
extends java.lang.Object, implements ReadablePartial, Comparable<Object>, and 
contains a private field of type org.joda.time.LocalDate) should be a subclass 
of Date, which is a full-resolution timestamp type.

> but then there is an error:
> 
> - The interface Comparable cannot be implemented more than once with 
> different arguments: Comparable<Date> and 
>        Comparable<Object>
> 
> so I checked the docs on java.util.Date:
> 
> public class Date
> extends Object
> implements Serializable, Cloneable, Comparable<Date>
> 
> so he implements Comparable<Date> but LocalDate had Comparable<Object>.
> 
> I hate this stuff. So I deleted Comparable from LocalDate and now there is an 
> error with a method:
> 
> Name clash: The method compareTo(Object) of type LocalDate has the same 
> erasure as compareTo(T) of type Comparable<T> but does 
> not override it
> 
> I made the executive decision to comment out the compareTo() method in 
> LocalDate.
> 
> And to my complete surprise, it works.

Unfortunately, that's likely to be just some good luck.  It may well work in 
this case, but it doesn't seem right to me (or necessary).  I would go back and 
ask why JasperReports is _expecting_ to be able to cast some value to a Date.


-- 
Paul.

http://logicsquad.net/


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to