From 7f545a57c987862d55966ac08ef64cfe0b9f51e4 Mon Sep 17 00:00:00 2001 From: Ken Wakasa Date: Wed, 30 Jul 2014 13:01:39 +0900 Subject: [HW7.5] Introduce the @Nonnull annotation (take 2) Change-Id: I05512b5434810046c8b72d6bb41567b6cd8b9d6e --- java/src/com/android/inputmethod/event/CombinerChain.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'java/src/com/android/inputmethod/event/CombinerChain.java') 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 previousEvents, final Event newEvent) { final ArrayList 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; } -- cgit v1.2.3-83-g751a