@@ -375,7 +375,7 @@ private void ensureEntityCapacity() {
375375 private Boolean xmlDeclStandalone ;
376376 private String xmlDeclContent ;
377377
378- private static boolean noUnicode4 ;
378+ private static boolean noUnicode4 ; // no Unicode in Java 1.4
379379
380380 private void reset () {
381381 //System.out.println("reset() called");
@@ -2153,7 +2153,7 @@ else if(xmlnsPos == 5) {
21532153 return ch ;
21542154 }
21552155
2156- private char [] charRefOneCharBuf = new char [1 ];
2156+ final private char [] charRefOneCharBuf = new char [1 ];
21572157
21582158 private char [] parseEntityRef ()
21592159 throws XmlPullParserException , IOException
@@ -2209,9 +2209,10 @@ private char[] parseEntityRef()
22092209 }
22102210 }
22112211 posEnd = pos - 1 ;
2212+ char [] result = null ;
22122213 if (!noUnicode4 ) {
22132214 try {
2214- charRefOneCharBuf = Character .toChars (Integer .parseInt (sb .toString (), isHex ? 16 : 10 ));
2215+ result = Character .toChars (Integer .parseInt (sb .toString (), isHex ? 16 : 10 ));
22152216 } catch (IllegalArgumentException e ) {
22162217 throw new XmlPullParserException ("character reference (with "
22172218 + (isHex ? "hex" : "decimal" )
@@ -2231,13 +2232,13 @@ private char[] parseEntityRef()
22312232 + sb .toString ()
22322233 + ") is not supported in this runtime" , this , null );
22332234 }
2234- charRefOneCharBuf = new char [ 1 ] ;
2235+ result = charRefOneCharBuf ;
22352236 charRefOneCharBuf [0 ] = (char )i ;
22362237 }
22372238 if (tokenize ) {
2238- text = newString (charRefOneCharBuf , 0 , charRefOneCharBuf .length );
2239+ text = newString (result , 0 , result .length );
22392240 }
2240- return charRefOneCharBuf ;
2241+ return result ;
22412242 } else {
22422243 // [68] EntityRef ::= '&' Name ';'
22432244 // scan name until ;
0 commit comments