On Friday 22 August 2008 16:25, Daniel Cheng wrote:
> On Fri, Aug 22, 2008 at 9:28 PM, Matthew Toseland
> <[EMAIL PROTECTED]> wrote:
> > On Thursday 14 August 2008 08:40, [EMAIL PROTECTED] wrote:
> >> Author: j16sdiz
> >> Date: 2008-08-14 07:40:13 +0000 (Thu, 14 Aug 2008)
> >> New Revision: 21832
> >>
> >> Modified:
> >>    trunk/freenet/src/freenet/config/Config.java
> >>    trunk/freenet/src/freenet/config/PersistentConfig.java
> >>    trunk/freenet/src/freenet/config/SubConfig.java
> >>    trunk/freenet/src/freenet/config/WrapperConfig.java
> >> Log:
> >> Generic
> >>
> >> Modified: trunk/freenet/src/freenet/config/SubConfig.java
> >> ===================================================================
> >> --- trunk/freenet/src/freenet/config/SubConfig.java   2008-08-14 07:39:51 
UTC
> > (rev 21831)
> >> +++ trunk/freenet/src/freenet/config/SubConfig.java   2008-08-14 07:40:13 
UTC
> > (rev 21832)
> >> @@ -304,15 +304,11 @@
> >>               return prefix;
> >>       }
> >>
> >> -     public int compareTo(Object o){
> >> -             if((o == null) || !(o instanceof SubConfig)) return 0;
> >> -             else{
> >> -                     SubConfig second = (SubConfig) o;
> >> -                     
if(this.getPrefix().compareTo(second.getPrefix())>0)
> >> -                             return 1;
> >> -                     else
> >> -                             return -1;
> >> -             }
> >> +     public int compareTo(SubConfig second) {
> >> +             if (this.getPrefix().compareTo(second.getPrefix()) > 0)
> >> +                     return 1;
> >> +             else
> >> +                     return -1;
> >>       }
> >
> > Why doesn't this break Comparable ?
> >
> 
> Comparable<T>  gives  declarle  public int compareTo(T obj).
> Java generic are just compile-time hints, the T is Object at bytecode level.

So does the JVM synthesise a compareTo(Object) which passes along if the type 
matches? Or that it's just a completely separate mechanism?

Attachment: pgpVtW0UGpC8w.pgp
Description: PGP signature

_______________________________________________
Devl mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to