Skip to content

Commit 49924fd

Browse files
Fixed : no need to add default value for annotation field in order to check that a value has been filled
1 parent 3b020f9 commit 49924fd

2 files changed

Lines changed: 1 addition & 8 deletions

File tree

‎AndroidAnnotations/androidannotations-api/src/main/java/com/googlecode/androidannotations/annotations/OnActivityResult.java‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@
9494
@Target(ElementType.METHOD)
9595
public @interface OnActivityResult {
9696

97-
public static final int DEFAULT_VALUE = Integer.MAX_VALUE - 1;
98-
99-
int value() default DEFAULT_VALUE;
97+
int value();
10098

10199
}

‎AndroidAnnotations/androidannotations/src/main/java/com/googlecode/androidannotations/validation/OnActivityResultValidator.java‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ public boolean validate(Element element, AnnotationElements validatedElements) {
6565
OnActivityResult onResultAnnotation = element.getAnnotation(OnActivityResult.class);
6666
validatorHelper.annotationValuePositiveAndInAShort(element, valid, onResultAnnotation.value());
6767

68-
if (onResultAnnotation.value() == OnActivityResult.DEFAULT_VALUE) {
69-
annotationHelper.printAnnotationError(element, "A value has to be filled into the annotation parameter");
70-
valid.invalidate();
71-
}
72-
7368
ExecutableElement executableElement = (ExecutableElement) element;
7469
validatorHelper.returnTypeIsVoid(executableElement, valid);
7570

0 commit comments

Comments
 (0)