classpath-patches
[Top][All Lists]
Advanced

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

[cp-patches] Patch: FYI: Properties fixlet


From: Tom Tromey
Subject: [cp-patches] Patch: FYI: Properties fixlet
Date: 25 Jul 2005 11:36:48 -0600

I'm checking this in.  This fixes a bug in Properties.load that was
found with FindBugs.

Tom

Index: ChangeLog
from  Tom Tromey  <address@hidden>

        * java/util/Properties.java (load): Handle case where backslash
        appears at EOF when reading the key.  PR classpath/22994.

Index: java/util/Properties.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/Properties.java,v
retrieving revision 1.29
diff -u -r1.29 Properties.java
--- java/util/Properties.java 5 Jul 2005 10:28:03 -0000 1.29
+++ java/util/Properties.java 25 Jul 2005 17:27:22 -0000
@@ -209,8 +209,12 @@
               {
                 if (pos == line.length())
                   {
-                    // The line continues on the next line.
+                    // The line continues on the next line.  If there
+                    // is no next line, just treat it as a key with an
+                    // empty value.
                     line = reader.readLine();
+                   if (line == null)
+                     line = "";
                     pos = 0;
                     while (pos < line.length()
                            && Character.isWhitespace(c = line.charAt(pos)))




reply via email to

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