Fix for bug 6695402

Nikolay Samofatov nikolay.samofatov at red-soft.biz
Sun Oct 23 15:23:55 PDT 2011


Hello, All!

The fix for JDK6 and JDK7 is pretty necessary as Russian tax office uses Russian names for its web 
service definitions.


     /**
      * Adds line breaks to enforce a maximum 72 bytes per line.
      */
     static void make72Safe(StringBuffer line) {
         int length = line.length();
         if (length > 72) {
             int index = 70;
             while (index < length - 2) {
                 // Nikolay Samofatov 2011-10-24: avoid breaking UTF8 sequences
                 while (line.charAt(index) >= 128 && line.charAt(index) < 192)
                   index--;

                 line.insert(index, "\r\n ");
                 index += 72;
                 length += 3;
             }
         }
         return;
     }


-- 
Nikolay Samofatov, MBA
Red Soft Corporation
+7 495 668 3735



More information about the jdk7-dev mailing list