[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: Patch: java.util.Properties#load: Whitespaces before comment charac
From: |
Jeroen Frijters |
Subject: |
FYI: Patch: java.util.Properties#load: Whitespaces before comment characters |
Date: |
Sat, 27 Mar 2004 15:14:42 +0100 |
Hi,
I committed Ito's patch.
Regards,
Jeroen
-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of Ito
Kazumitsu
Sent: Sunday, March 21, 2004 00:22
To: address@hidden
Subject: java.util.Properties#load: Whitespaces before comment
characters
With reference to java.util.Properties#load, Sun's API document says
"A comment line has an ASCII '#' or '!' as its first non-white space
character;" but GNU Classpath's java.util.Properties checkes only
comment characters at the beginning of ach line.
Here is a patch I comitted in Kaffe.
ChangeLog Entry:
2004-03-19 Ito Kazumitsu <address@hidden>
* libraries/javalib/java/util/Properties
(load): Delete leading whiltespaces before checking comment
characters.
--- java/util/Properties.java.orig Thu Mar 18 01:11:02 2004
+++ java/util/Properties.java Sun Mar 21 07:20:39 2004
@@ -188,17 +188,14 @@
{
char c = 0;
int pos = 0;
- // If empty line or begins with a comment character, skip this
line.
- if (line.length() == 0
- || line.charAt(0) == '#' || line.charAt(0) == '!')
- continue;
-
+ // Leading whitespaces must be deleted first.
while (pos < line.length()
&& Character.isWhitespace(c = line.charAt(pos)))
pos++;
- // If line is empty skip this line.
- if (pos == line.length())
+ // If empty line or begins with a comment character, skip this
line.
+ if ((line.length() - pos) == 0
+ || line.charAt(pos) == '#' || line.charAt(pos) == '!')
continue;
// The characters up to the next Whitespace, ':', or '='
_______________________________________________
Classpath mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/classpath
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: Patch: java.util.Properties#load: Whitespaces before comment characters,
Jeroen Frijters <=