Skip to content

Commit f9b40c7

Browse files
committed
do not use the method name as action for @ReceiverAction
1 parent a089735 commit f9b40c7

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

‎AndroidAnnotations/androidannotations-api/src/main/java/org/androidannotations/annotations/ReceiverAction.java‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
/**
2424
* <p>
2525
* Should be used on a method that must respond to a specific action in an
26-
* {@link EReceiver} annotated class. The method name will be used as action
27-
* name unless the {@link #value()} field is set.
26+
* {@link EReceiver} annotated class.
2827
* </p>
2928
* <p>
3029
* The class MAY contain several {@link ReceiverAction} annotated methods.
@@ -94,12 +93,11 @@
9493
public @interface ReceiverAction {
9594

9695
/**
97-
* Define a set of actions this method should handle. If this field isn't
98-
* set the annotated method name will be used.
99-
*
96+
* Define a set of actions this method should handle.
97+
*
10098
* @return the actions
10199
*/
102-
String[] value() default {};
100+
String[] actions();
103101

104102
/**
105103
* Define a set of data schemes to filter the Intent. If this field isn't

‎AndroidAnnotations/androidannotations/src/main/java/org/androidannotations/handler/ReceiverActionHandler.java‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,7 @@ public void process(Element element, EReceiverHolder holder) throws Exception {
8484

8585
ReceiverAction annotation = element.getAnnotation(ReceiverAction.class);
8686
String[] dataSchemes = annotation.dataSchemes();
87-
String[] actions = annotation.value();
88-
if (actions.length == 0) {
89-
actions = new String[] { methodName };
90-
}
87+
String[] actions = annotation.actions();
9188

9289
JFieldVar actionKeyField = createStaticField(holder, "actions", methodName, actions);
9390
JFieldVar dataSchemesField = createStaticField(holder, "dataSchemes", methodName, dataSchemes);

0 commit comments

Comments
 (0)