aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/event/CombinerChain.java
diff options
context:
space:
mode:
authorKen Wakasa <kwakasa@google.com>2014-07-29 15:51:07 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-07-29 15:51:07 +0000
commitc9bba853fa00f03bfc9b49931e320957adc15b20 (patch)
tree545fcd35c668f962f75b6dbc76918836369ed8ec /java/src/com/android/inputmethod/event/CombinerChain.java
parent8a584a2f610c2baf6f343fdccfb1eae42eda4351 (diff)
parent666f1b384f539c6426b9ee7bd6312005c69a3350 (diff)
downloadlatinime-c9bba853fa00f03bfc9b49931e320957adc15b20.tar.gz
latinime-c9bba853fa00f03bfc9b49931e320957adc15b20.tar.xz
latinime-c9bba853fa00f03bfc9b49931e320957adc15b20.zip
am 666f1b38: Merge "Revert "[HW7.5] Introduce the @Nonnull annotation"" into lmp-dev
* commit '666f1b384f539c6426b9ee7bd6312005c69a3350': Revert "[HW7.5] Introduce the @Nonnull annotation"
Diffstat (limited to 'java/src/com/android/inputmethod/event/CombinerChain.java')
-rw-r--r--java/src/com/android/inputmethod/event/CombinerChain.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/event/CombinerChain.java b/java/src/com/android/inputmethod/event/CombinerChain.java
index f69bf4fd0..8ddc9e7d9 100644
--- a/java/src/com/android/inputmethod/event/CombinerChain.java
+++ b/java/src/com/android/inputmethod/event/CombinerChain.java
@@ -24,8 +24,6 @@ import com.android.inputmethod.latin.Constants;
import java.util.ArrayList;
import java.util.HashMap;
-import javax.annotation.Nonnull;
-
/**
* This class implements the logic chain between receiving events and generating code points.
*
@@ -89,7 +87,6 @@ public class CombinerChain {
* @return the processed event. It may be the same event, or a consumed event, or a completely
* new event. However it may never be null.
*/
- @Nonnull
public Event processEvent(final ArrayList<Event> previousEvents, final Event newEvent) {
final ArrayList<Event> modifiablePreviousEvents = new ArrayList<>(previousEvents);
Event event = newEvent;
@@ -97,6 +94,10 @@ public class CombinerChain {
// A combiner can never return more than one event; it can return several
// code points, but they should be encapsulated within one event.
event = combiner.processEvent(modifiablePreviousEvents, event);
+ if (null == event) {
+ // Combiners return null if they eat the event.
+ break;
+ }
}
return event;
}