]> granicus.if.org Git - icu/commitdiff
ICU-9715 Review comments.
authorAndy Heninger <andy.heninger@gmail.com>
Thu, 21 Feb 2013 02:13:56 +0000 (02:13 +0000)
committerAndy Heninger <andy.heninger@gmail.com>
Thu, 21 Feb 2013 02:13:56 +0000 (02:13 +0000)
X-SVN-Rev: 33289

icu4j/main/classes/core/src/com/ibm/icu/impl/CharacterIteration.java
icu4j/main/classes/core/src/com/ibm/icu/text/RuleBasedBreakIterator.java

index 8298fb559819c482931a6fd9a13f9064420e7249..202f738d5591311bdd1fe819efab6c1bc67acc46 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *******************************************************************************
- * Copyright (C) 2012, International Business Machines Corporation and         *
+ * Copyright (C) 2013, International Business Machines Corporation and         *
  * others. All Rights Reserved.                                                *
  *******************************************************************************
  */
@@ -28,7 +28,7 @@ public final class CharacterIteration {
      */
     public static int next32(CharacterIterator ci) {
         // If the current position is at a surrogate pair, move to the trail surrogate
-        //   which leaves it in positon for underlying iterator's next() to work.
+        //   which leaves it in position for underlying iterator's next() to work.
         int c= ci.current();
         if (c >= UTF16.LEAD_SURROGATE_MIN_VALUE && c<=UTF16.LEAD_SURROGATE_MAX_VALUE) {
             c = ci.next();   
@@ -59,7 +59,7 @@ public final class CharacterIteration {
     // The call site does an initial ci.next() and calls this function
     //    if the 16 bit value it gets is >= LEAD_SURROGATE_MIN_VALUE.
     // NOTE:  we leave the underlying char iterator positioned in the
-    //        middle of a surroage pair.  ci.next() will work correctly
+    //        middle of a surrogate pair.  ci.next() will work correctly
     //        from there, but the ci.getIndex() will be wrong, and needs
     //        adjustment.
     public static int nextTrail32(CharacterIterator ci, int lead) {
index 2c796960f673e2f54f5bc6b055476fa0363cbe02..ca6cc93abe187396e800a64be81f5e0120d510d2 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *******************************************************************************
- * Copyright (C) 2005-2012 International Business Machines Corporation and     *
+ * Copyright (C) 2005-2013 International Business Machines Corporation and     *
  * others. All Rights Reserved.                                                *
  *******************************************************************************
  */
@@ -1293,19 +1293,19 @@ public class RuleBasedBreakIterator extends BreakIterator {
 
             if (stateTable[row + RBBIDataWrapper.ACCEPTING] != 0) {
                 // Because this is an accepting state, any in-progress look-ahead match
-                //   is no longer relavant.  Clear out the pending lookahead status.
+                //   is no longer relevant.  Clear out the pending lookahead status.
                 lookaheadStatus = 0; 
             }
         }        // End of state machine main loop
 
         // The state machine is done.  Check whether it found a match...
 
-        // If c == DONE32 we ran off the end as normal, no match found. Move forward one.
-        // If the iterator failed to advance in the match engine when c != DONE32,
-        //   force it ahead by one. (This second condition really indicates a defect
-        //   in the break rules. They should always match at least one character.)
+        // If the iterator failed to advance in the match engine force it ahead by one.
+        // This indicates a defect in the break rules, which should always match
+        // at least one character.
+        
         if (result == initialPosition) {
-            if (TRACE && c != DONE32) {
+            if (TRACE) {
                 System.out.println("Iterator did not move. Advancing by 1.");
             }
             text.setIndex(initialPosition);