Skip to content

Commit ff3436c

Browse files
committed
fix possible OutOfBoundException if there is only one parameter of type MotionEvent
1 parent 4b5f3c4 commit ff3436c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎AndroidAnnotations/androidannotations/src/main/java/org/androidannotations/helper/ValidatorParameterHelper.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ public void hasOneMotionEventOrTwoMotionEventViewParameters(ExecutableElement ex
169169
if (parameters.size() == 1 && !firstParameterType.equals(CanonicalNameConstants.MOTION_EVENT)) {
170170
valid.invalidate();
171171
annotationHelper.printAnnotationError(executableElement, "the parameter must be a " + CanonicalNameConstants.MOTION_EVENT + ", not a " + firstParameterType);
172-
} else { // if (parameters.size() == 2)
172+
}
173+
if (parameters.size() == 2) {
173174
VariableElement secondParameter = parameters.get(1);
174175
String secondParameterType = secondParameter.asType().toString();
175176

0 commit comments

Comments
 (0)