< prev index next >

src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/XMLDeclarationParser.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -74,14 +74,12 @@
 
      public void parse()  throws TransformerException, IOException
      {
         int c = 0;
         int index = 0;
-        char[] aChar = new char[65535];
-        StringBuffer xmlDeclStr = new StringBuffer();
+        StringBuilder xmlDeclStr = new StringBuilder();
         while ((c = m_pushbackReader.read()) != -1) {
-            aChar[index] = (char)c;
             xmlDeclStr.append((char)c);
             index++;
             if (c == '>') {
                 break;
             }

@@ -102,11 +100,11 @@
             }
         }
 
         // no XML decl
         if (!utf16 && !utf8) {
-            m_pushbackReader.unread(aChar, 0, len);
+            m_pushbackReader.unread(decl.toCharArray(), 0, len);
             return;
         }
         m_hasHeader = true;
 
         if (utf16) {
< prev index next >