|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Some contributionsWhile I was looking for the default length of enclosures (which I knew
was probably not null, as the docs said (;¬) ), I noticed that NumberParser effectively boxed and unboxed in the course of parsing, which bugs me. So I altered it to use the parse call directly, and I filled out the TODO. After that, I fixed the docs to say 0 instead of null for the default length of enclosures. I don't know the policy of this project and contributions, and I'm a newbie at version control, so I just attached my versions of the source files (I didn't think it would be too big). If there are any legal entanglements (since I noticed this is in com.sun.* which is mentioned in the JDK EULAs): I hereby release these changes into the public domain. (Copyright is ridiculous). --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
|
|
RE: Some contributionsThanks Sean,
Could you resend your changes as a patch using diff -u? Thanks > -----Original Message----- > From: rprogrammer@... [mailto:rprogrammer@...] On Behalf Of > Sean > Sent: Sunday, 22 March 2009 2:25 PM > To: dev@... > Subject: Some contributions > > While I was looking for the default length of enclosures (which I knew > was probably not null, as the docs said (;¬) ), I noticed that > NumberParser effectively boxed and unboxed in the course of parsing, > which bugs me. So I altered it to use the parse call directly, and I > filled out the TODO. After that, I fixed the docs to say 0 instead of > null for the default length of enclosures. > > I don't know the policy of this project and contributions, and I'm a > newbie at version control, so I just attached my versions of the source > files (I didn't think it would be too big). If there are any legal > entanglements (since I noticed this is in com.sun.* which is mentioned > in the JDK EULAs): > I hereby release these changes into the public domain. (Copyright is > ridiculous). IMPORTANT: This e-mail, including any attachments, may contain private or confidential information. If you think you may not be the intended recipient, or if you have received this e-mail in error, please contact the sender immediately and delete all copies of this e-mail. If you are not the intended recipient, you must not reproduce any part of this e-mail or disclose its contents to any other party. This email represents the views of the individual sender, which do not necessarily reflect those of Education.au except where the sender expressly states otherwise. It is your responsibility to scan this email and any files transmitted with it for viruses or any other defects. education.au limited will not be liable for any loss, damage or consequence caused directly or indirectly by this email. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
|
|
Re: Some contributions--------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
|
|
RE: Some contributionsThanks.
I've committed the fixes for the documentation. I had problems with the patches for Link.java and NumberParser.java. Link.java.patch doesn't appear to be a patchfile, and NumberParser.java seems to have the file removed and re-added as a patch. That make it pretty difficult to see exactly what is changed. In NumberParser I think what you want is for the parse* methods which take a default value not to delegate to the parse* methods which don't' take a parameter. Eg: + /** + * Parse a <code>int</code> from a String, with a default value. + * + * @param def the value to return if the String cannot be parsed + */ + public static int parseInt(String str, int def) { + if (str != null) { + try { + return Integer.parseInt(str); + } + catch (NumberFormatException exc) { + //Let it pass through to the default + } + } + return def; + } That's fine - but note that the parsers we have handle the case where the string passed in has white space on the ends. Eg - public static Integer parseInt(String str) { - if (null != str) { - try { - return Integer.valueOf(Integer.parseInt(str.trim())); - } catch (Exception e) { - // :IGNORE: - } - } - return null; - } I agree we should be catching NumberFormatException rather than Exception there, though. Nick > -----Original Message----- > From: rprogrammer@... [mailto:rprogrammer@...] On Behalf Of > Sean > Sent: Wednesday, 25 March 2009 6:57 AM > To: dev@... > Subject: Re: Some contributions > IMPORTANT: This e-mail, including any attachments, may contain private or confidential information. If you think you may not be the intended recipient, or if you have received this e-mail in error, please contact the sender immediately and delete all copies of this e-mail. If you are not the intended recipient, you must not reproduce any part of this e-mail or disclose its contents to any other party. This email represents the views of the individual sender, which do not necessarily reflect those of Education.au except where the sender expressly states otherwise. It is your responsibility to scan this email and any files transmitted with it for viruses or any other defects. education.au limited will not be liable for any loss, damage or consequence caused directly or indirectly by this email. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
| Free embeddable forum powered by Nabble | Forum Help |