Hi Sherman,

I'm happy to see those enhancements.

Please allow me to note, that IIRC many of them and similar others I had addressed by my patches on https://bugs.openjdk.java.net/show_bug.cgi?id=10009x. Unfortunately https://bugs.openjdk.java.net is down today, so I can't be more specific.

I would appreciate, someone would review my patches.

-Ulf

Am 08.06.2010 00:04, schrieb Xueming Shen:
Hi Andrew,

6959197: When building with JAVAC_MAX_WARNINGS=true, the build fails in sun/nio/cs due to the use of -Werror

(1)sun/io/ByteTocharISO2022JP.java
   #129,  #151

   if ((byte1 & (byte)0x80) != 0){

       if ((byte2 & (byte)0x80) != 0){


(byte) casting is not necessary as well?

(2)sun/io/ByteToCharJISAutoDetect.java

  we should (if I did not miss anything) simply change the
sun/nio/cs/ext/JISAutoDetect.getByteMask1|2 to static, then no longer need to
  have an instance in ByteToCharJISAutoDetect.

(3)sun/nio/cs/ext/EUC_JP_LINUX.java

    encoderJ0208 no longer needed?
  decodeMappingJ0208.start = 0xa1;
  decodeMappingJ0208.end = 0xfe;

seems like we should simply replace decodeMappingJ0208.start/end with start/end
     and the decodeMappingJ0208 is no longer necessary as well.

(4)

again, it might be better to do something as below. The EUC_JP_xyz are something need to
  be re-written/-re-organized when we have time.

 short[] j0208Index1 = JIS_X_0208_Solaris_Decoder.getIndex1();
 String[]j0208Index2 = JIS_X_0208_Solaris_Decoder.getIndex2();

   int start = 0xa1;
   int end = -0xfe;

100     protected char decodeDouble(int byte1, int byte2) {
101             if (byte1 == 0x8e) {
102                 return decoderJ0201.decode(byte2 - 256);
103             }
104 105             if (((byte1 < 0)
106                 || (byte1 > j0208Index1.length))
107                 || ((byte2 < start)
108                 || (byte2 > end)))
109                 return REPLACE_CHAR;
110 111             char result = super.decodeDouble(byte1, byte2);
112             if (result != '\uFFFD') {
113                 return result;
114             } else {
115                 int n = (j0208Index1[byte1 - 0x80] & 0xf) *
116                         (end - start + 1)
117                         + (byte2 - start);
118 return j0208Index2[j0208Index1[byte1 - 0x80] >> 4].charAt(n);
119             }
120         }

   encoderJ0208 is no longer needed.

(5) sun.nio.cs.ext.PCK.java

   JIS_X_0208_Solaris_Encoder jis0208 is no longer needed

-sherman


Reply via email to