From 4d713a0022ae06724b14c4147fe70271c6cfe93c Mon Sep 17 00:00:00 2001 From: Andy Heninger Date: Thu, 21 Feb 2013 02:13:56 +0000 Subject: [PATCH] ICU-9715 Review comments. X-SVN-Rev: 33289 --- .../src/com/ibm/icu/impl/CharacterIteration.java | 6 +++--- .../com/ibm/icu/text/RuleBasedBreakIterator.java | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/icu4j/main/classes/core/src/com/ibm/icu/impl/CharacterIteration.java b/icu4j/main/classes/core/src/com/ibm/icu/impl/CharacterIteration.java index 8298fb55981..202f738d559 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/impl/CharacterIteration.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/impl/CharacterIteration.java @@ -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) { diff --git a/icu4j/main/classes/core/src/com/ibm/icu/text/RuleBasedBreakIterator.java b/icu4j/main/classes/core/src/com/ibm/icu/text/RuleBasedBreakIterator.java index 2c796960f67..ca6cc93abe1 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/text/RuleBasedBreakIterator.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/text/RuleBasedBreakIterator.java @@ -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); -- 2.40.0