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:44:39 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-07-24 16:04:26 +0000
commit666f1b384f539c6426b9ee7bd6312005c69a3350 (patch)
tree94c2149cd692d9629c7f272dd51d916cf7b8a94d /java/src/com/android/inputmethod/event/CombinerChain.java
parentbcb61da581edfef5120a7a38a5de98d35fa65255 (diff)
parent8aa74da98d328a70f61569ce2a97945d442871ce (diff)
downloadlatinime-666f1b384f539c6426b9ee7bd6312005c69a3350.tar.gz
latinime-666f1b384f539c6426b9ee7bd6312005c69a3350.tar.xz
latinime-666f1b384f539c6426b9ee7bd6312005c69a3350.zip
Merge "Revert "[HW7.5] Introduce the @Nonnull annotation"" into lmp-dev
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;
}