]> granicus.if.org Git - icu/commitdiff
ICU-8804 Remove unneeded fields array size check
authorMichael Ow <mow@svn.icu-project.org>
Tue, 29 Nov 2011 21:26:05 +0000 (21:26 +0000)
committerMichael Ow <mow@svn.icu-project.org>
Tue, 29 Nov 2011 21:26:05 +0000 (21:26 +0000)
X-SVN-Rev: 30988

icu4j/main/tests/core/src/com/ibm/icu/dev/test/lang/UCharacterTest.java

index b8da46df2e0660508adbe38429706a676ff11806..3a179cc8159f6f01b40312cc8469b77da1d4d748 100644 (file)
@@ -834,68 +834,61 @@ public final class UCharacterTest extends TestFmwk
                 }
 
                 // testing iso comment
-                if (fields.length >= 12) {
-                    try{
-                        String isocomment = fields[11];
-                        String comment = UCharacter.getISOComment(ch);
-                        if (comment == null) {
-                            comment = "";
-                        }
-                        if (!comment.equals(isocomment)) {
-                            errln("FAIL \\u" + hex(ch) +
-                                " expected iso comment " + isocomment);
-                            break;
-                        }
-                    }catch(Exception e){
-                        if(e.getMessage().indexOf("unames.icu") >= 0){
-                            numErrors++;
-                        }else{
-                            throw e;
-                        }
-                    }
-                }
-
-                int tempchar;
-                if (fields.length >= 13) {
-                    String upper = fields[12];
-                    tempchar = ch;
-                    if (upper.length() > 0) {
-                        tempchar = Integer.parseInt(upper, 16);
+                try{
+                    String isocomment = fields[11];
+                    String comment = UCharacter.getISOComment(ch);
+                    if (comment == null) {
+                        comment = "";
                     }
-                    if (UCharacter.toUpperCase(ch) != tempchar) {
-                        errln("FAIL \\u" + Utility.hex(ch, 4)
-                                + " expected uppercase \\u"
-                                + Utility.hex(tempchar, 4));
+                    if (!comment.equals(isocomment)) {
+                        errln("FAIL \\u" + hex(ch) +
+                            " expected iso comment " + isocomment);
                         break;
                     }
-                }
-                
-                if (fields.length >= 14) {
-                    String lower = fields[13];
-                    tempchar = ch;
-                    if (lower.length() > 0) {
-                        tempchar = Integer.parseInt(lower, 16);
-                    }
-                    if (UCharacter.toLowerCase(ch) != tempchar) {
-                        errln("FAIL \\u" + Utility.hex(ch, 4)
-                                + " expected lowercase \\u"
-                                + Utility.hex(tempchar, 4));
-                        break;
+                }catch(Exception e){
+                    if(e.getMessage().indexOf("unames.icu") >= 0){
+                        numErrors++;
+                    }else{
+                        throw e;
                     }
                 }
+
+                String upper = fields[12];
+                int tempchar = ch;
+                if (upper.length() > 0) {
+                    tempchar = Integer.parseInt(upper, 16);
+                }
+                if (UCharacter.toUpperCase(ch) != tempchar) {
+                    errln("FAIL \\u" + Utility.hex(ch, 4)
+                            + " expected uppercase \\u"
+                            + Utility.hex(tempchar, 4));
+                    break;
+                }
+
+                String lower = fields[13];
+                tempchar = ch;
+                if (lower.length() > 0) {
+                    tempchar = Integer.parseInt(lower, 16);
+                }
+                if (UCharacter.toLowerCase(ch) != tempchar) {
+                    errln("FAIL \\u" + Utility.hex(ch, 4)
+                            + " expected lowercase \\u"
+                            + Utility.hex(tempchar, 4));
+                    break;
+                }
+
                 
-                if (fields.length >= 15) {
-                    String title = fields[14];
-                    tempchar = ch;
-                    if (title.length() > 0) {
-                        tempchar = Integer.parseInt(title, 16);
-                    }
-                    if (UCharacter.toTitleCase(ch) != tempchar) {
-                        errln("FAIL \\u" + Utility.hex(ch, 4)
-                                + " expected titlecase \\u"
-                                + Utility.hex(tempchar, 4));
-                        break;
-                    }
+
+                String title = fields[14];
+                tempchar = ch;
+                if (title.length() > 0) {
+                    tempchar = Integer.parseInt(title, 16);
+                }
+                if (UCharacter.toTitleCase(ch) != tempchar) {
+                    errln("FAIL \\u" + Utility.hex(ch, 4)
+                            + " expected titlecase \\u"
+                            + Utility.hex(tempchar, 4));
+                    break;
                 }
             }
             input.close();