ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Skeet" <jon.sk...@peramon.com>
Subject RE: new ant task to update J2ME MIDP JAD files
Date Thu, 28 Feb 2002 23:09:29 GMT
> I wrote a small ant task (called jad) that is useful for J2ME/MIDP
> development. This task updates the size of a MIDlet jar in the jad
> file. The jar size mentioned in the jad must be accurate or the MIDlet
> is rejected by Motorola's iDEN phones. Sun's J2ME Wireless Toolkit
> does this automatically, but this tool is useful for those who prefer
> to build MIDlets using ant (like myself :-)). 

Looks mostly okay to me. A few things:

1) Copyright - I don't think we'd be able to do anything without the ASF being given the copyright
and the licence changing appropriately.

2) We'd probably want to change the package to something like org.apache.tools.ant.taskdefs.optional.j2me

3) Any reason why the jar is specified as a File but the jad is specified as a String?

4) I'd probably move tryExecute into the block of the try, personally, but that's just a style
issue.

5) I'd clean up closing readers/writers with finally blocks - currently they could hang around.

6) Is a Jad file actually a Properties file? I can't remember off-hand... If so, it's worth
using the Properties.load and Properties.store methods rather than reading it in directly.

7) If it's not a actually a Properties file, is it at least meant to be in a specific encoding?
If so, it's worth specifying.

8) It's probably worth doing more "user friendly" parameter checking than relying on IOExceptions
- check for both files existing and the jad file being writable before trying to do anything
else.

I'm a pretty new committer, so I don't know if there's anything else that needs checking.
Oh, and do you fancy writing a manual page for it? :)

Jon

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


Mime
View raw message