ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Hourihane <houriha...@yahoo.co.uk>
Subject Re: enhancement for PropertyFile, have a patch
Date Sun, 04 Sep 2005 22:43:02 GMT
Steve,

> I wonder if any of the CLASSPATH/Harmony java tests
> for property file parsing could be used here

I have a test class to accompany the submission. It
doesn't expand on the test class for the PropertyFile
task (which is, in fact, unchanged). Instead it puts
the new Properties subclass through its paces. I also
figured that the escaping would be the most likely
point of failure, so it throws whatevers kookie
escaping that I could devise at it. I don't, of
course, claim that the testing is complete (I'm not
stupid enough to make a claim like that in public :-),
but it is pretty thorough.

> and then performance impact

I don't think I've done anything terribly stupid in my
code, but I did take the approach that it is unlikely
to be used in a performance-critical portion of a
system, and so I haven't done any tuning; I decided to
leave the code as readable as possible instead.
However, saying that, it should not be hard to put it
through its paces and get some idea about relative
speeds, to I'll look into that.

> Does anyone consider it to be a backwards 
> compatibility issue if we do now retain comments?

I confess I hadn't acutally thought of that. How about
a 'retain layout/comments' flag on the task which
switches between the current implementation backed by
Java's own Properties file, and substituting in the
enhancement. For full backwards compatability the flag
would default to 'false' (i.e. don't retain
layout/comments). Of course, if we don't consider the
retentio of layout/comments to be a BF issue, we could
default it to 'true'. Or we could not bother with a
flag at all; however a flag which restored 'basic'
Java Properties-backed operation would give people an
out if they discovered a bug.

PHiL

--- Steve Loughran <stevel@apache.org> wrote:

> Phil Hourihane wrote:
> > Dominique,
> > 
> > I was pretty sure that Sun's stuff, although
> available
> > in source form, wasn't open-source per se, so I
> > avoided hacking their code. The class I have is
> > subclassed from Properties (to allow for
> polymorphic
> > substitution), and includes its own code for
> parsing
> > the incoming file and handling the escapes. The
> 'spec'
> > for it (ie. the rules for parsing a properties
> file)
> > is taken from the documentation of the Properties
> > class, and some experimentation of my own. It was
> > originally coded relying on commons-lang for some
> > string handling (using a sledgehammer to crack a
> nut
> > there), but I stripped that out to prepare it for
> Ant,
> > so now it had no dependancy outside the standard
> JDK.
> > The parsing, escaping and string handling are
> coded
> > from scratch, and although they don't claim to be
> the
> > smartest in the world, don't step on anyone's
> > licensing toes. 
> > 
> > I'll do a search for the Software Grant form that
> you
> > mention, as the intention is to make it available
> to
> > the ASF.
> > 
> > PHiL
> > 
> 
> i guess the big concern would be handling all that
> escaping stuff - I 
> wonder if any of the CLASSPATH/Harmony java tests
> for property file 
> parsing could be used here, and then performance
> impact. Being less used 
> than <property file>; perf would be less of an
> issue.
> 
> oh, one other worry. Does anyone consider it to be a
> backwards 
> compatibility issue if we do now retain comments?
> 
> Nb, on the subject of property files, Java1.5 adds a
> new XML format. See:
> http://java.sun.com/dtds/properties.dtd
> 
> There are loadXML and saveXML commands. Wierdly the
> one comment allowed 
> per file is different from Xml comments, but
> otherwise it looks ok. 
> Should we retrofit broad ant support for this format
> too? Or delay till 
> the 1.8 timeframe? That is my preference.
> 
> -steve
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
> 
> 



	
	
		
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message