commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1471788 - in /commons/proper/io/trunk/src: main/java/org/apache/commons/io/input/XmlStreamReader.java test/java/org/apache/commons/io/input/compatibility/XmlStreamReader.java
Date Wed, 24 Apr 2013 23:58:56 GMT
Author: sebb
Date: Wed Apr 24 23:58:56 2013
New Revision: 1471788

URL: http://svn.apache.org/r1471788
Log:
Silence impossible "possible NPE" warning

Modified:
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/XmlStreamReader.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReader.java

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/XmlStreamReader.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/XmlStreamReader.java?rev=1471788&r1=1471787&r2=1471788&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/XmlStreamReader.java
(original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/XmlStreamReader.java
Wed Apr 24 23:58:56 2013
@@ -711,7 +711,7 @@ public class XmlStreamReader extends Rea
             int max = BUFFER_SIZE;
             int c = is.read(bytes, offset, max);
             int firstGT = -1;
-            String xmlProlog = null;
+            String xmlProlog = ""; // avoid possible NPE warning (cannot happen; this just
silences the warning)
             while (c != -1 && firstGT == -1 && offset < BUFFER_SIZE) {
                 offset += c;
                 max -= c;

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReader.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReader.java?rev=1471788&r1=1471787&r2=1471788&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReader.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReader.java
Wed Apr 24 23:58:56 2013
@@ -669,7 +669,7 @@ public class XmlStreamReader extends Rea
             int max = BUFFER_SIZE;
             int c = is.read(bytes, offset, max);
             int firstGT = -1;
-            String xmlProlog = null;
+            String xmlProlog = ""; // avoid possible NPE warning (cannot happen; this just
silences the warning)
             while (c != -1 && firstGT == -1 && offset < BUFFER_SIZE) {
                 offset += c;
                 max -= c;



Mime
View raw message