aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/event/CombinerChain.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-07-29 17:48:17 +0900
committerJean Chalard <jchalard@google.com>2014-07-29 17:49:19 +0900
commit60a2cd8ac439bf41bfddc5f5f339feda7c7ff175 (patch)
tree583ad4e3880d2c6e0a297bfa2b3c5e2433855274 /java/src/com/android/inputmethod/event/CombinerChain.java
parent99aff0af98e66b1d8515225a103f5beb84d098b9 (diff)
downloadlatinime-60a2cd8ac439bf41bfddc5f5f339feda7c7ff175.tar.gz
latinime-60a2cd8ac439bf41bfddc5f5f339feda7c7ff175.tar.xz
latinime-60a2cd8ac439bf41bfddc5f5f339feda7c7ff175.zip
[HW7.5] Introduce the @Nonnull annotation
Change-Id: I1f69ea704056943fa3371ff610e2d8181ead2376
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, 3 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/event/CombinerChain.java b/java/src/com/android/inputmethod/event/CombinerChain.java
index 8ddc9e7d9..f69bf4fd0 100644
--- a/java/src/com/android/inputmethod/event/CombinerChain.java
+++ b/java/src/com/android/inputmethod/event/CombinerChain.java
@@ -24,6 +24,8 @@ 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.
*
@@ -87,6 +89,7 @@ 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;
@@ -94,10 +97,6 @@ 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;
}