classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] [generics] Patch: FYI: StringBuilder


From: Andrew John Hughes
Subject: Re: [cp-patches] [generics] Patch: FYI: StringBuilder
Date: Sun, 12 Sep 2004 01:31:14 +0100

On Sat, 2004-09-11 at 19:17, Tom Tromey wrote:
> >>>>> "Andrew" == Andrew John Hughes <address@hidden> writes:
> 
> >> It does implement Appendable, which is also new in 1.5.
> 
> Andrew> I didn't spot the interface, but as long as it still doesn't
> Andrew> have any 1.5 compile features, we should be okay to go (at a
> Andrew> guess, I would think it is one of the new 'marker'-style
> Andrew> interfaces
> 
> It isn't a marker interface, but it is pretty small and easy to
> document.  It only has two methods.

Yes, the class is partially as I thought it would be.  I didn't really
mean real marker interfaces, like Serializable, but interfaces like
Closeable (hence, the quotes -- I really needed a better term, but
couldn't think of one).  Sun seems to be retro-fitting interfaces to
existing classes in order to specify some of the functionality in a more
abstract way (presumably so one implementation can then be more easily
replaced by another -- you can test to see if a stream can be used with
close() by using an instanceof for example).  In the case of
StringBuffer, the Appendable interface specifies not the same methods,
but what appear to be more abstracted versions of the append(char c),
append(char[] c) and append(char[] c, int offset, int len) methods (the
array becomes a CharSequence, and it returns the more generic
Appendable).  This, I imagine, is so StringBuffer, StringBuilder and any
later additions can be used interchangeably.
> 
> I suspect Mark may want to weigh in on whether this should be merged
> at all.  My impression was there are some folks who would prefer not
> to see any 1.5 stuff on the trunk for the time being.  (I don't really
> care either way, as long as it eventually gets done...)
> 
Yes, I agree.  It would be a shame if the bits of 1.5 that are just
class additions couldn't be added now, because they don't really affect
anything (only 1.5 code will care if StringBuilder exists or not, for
example).  There is a lot of stuff that is just nice little changes, and
which don't affect backward compatibility.  It seems Mark has already
added java.lang.System.getEnv() (deprecated in 1.4, but implemented in
1.5), but I don't know whether this is a purposeful 1.5 addition or not.

> Andrew> I take it generics is just a branch from the standard
> Andrew> Classpath repository?  With gcjx being one of the possible
> Andrew> compilers for it?
> 
> Yeah, there is a branch named "generics-branch" on which all the 1.5
> work is done.
> 
> At the moment the code on the branch has never been compiled.  It
> probably has syntax errors and the like.  gcjx is still a work in
> progress and, while it can handle the 1.4 language pretty well, the
> larger 1.5 additions are still incomplete.
> 
> The non-compilability of the branch shouldn't hinder documentation
> efforts though :-)
> 
Good.  I will have a look when I finish with the util stuff.
> Tom
Cheers,
-- 
Andrew :-)
 
Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
 
Value your freedom, or you will lose it, teaches history.
`Don't bother us with politics' respond those who don't want to learn.
 

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]