Skip to content

Commit c3be5bc

Browse files
committed
Code review feedback
- Make annotation utils check for NONE more generic - Move docs to whats-new.adoc - Polish javadoc
1 parent 623d78e commit c3be5bc

File tree

4 files changed

+24
-36
lines changed

4 files changed

+24
-36
lines changed

spring-integration-core/src/main/java/org/springframework/integration/util/MessagingAnnotationUtils.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.springframework.core.annotation.AnnotationUtils;
2727
import org.springframework.integration.annotation.EndpointId;
2828
import org.springframework.integration.annotation.Payloads;
29-
import org.springframework.integration.annotation.Poller;
3029
import org.springframework.messaging.MessagingException;
3130
import org.springframework.messaging.handler.annotation.Header;
3231
import org.springframework.messaging.handler.annotation.Headers;
@@ -71,12 +70,10 @@ public static <T> T resolveAttribute(List<Annotation> annotations, String name,
7170
}
7271

7372
/**
74-
* Determines if the value of a named attribute from an annotation instance contains an actual value.
75-
* <p>It is considered to NOT contain a value if it is null, an empty string, an empty array, or a {@link Poller}
76-
* whose 'value' field is set to {@link ValueConstants#DEFAULT_NONE}.
77-
*
73+
* Determine if the value of a named attribute from an annotation instance contains an actual value.
7874
* @param annotationValue the value of the annotation attribute
79-
* @return whether {@code annotationValue} is set to a non-empty value
75+
* @return {@code false} when {@code annotationValue} is null, an empty string, an empty array, or any annotation
76+
* whose 'value' field is set to {@link ValueConstants#DEFAULT_NONE} - {@code true} otherwise
8077
*/
8178
public static boolean hasValue(Object annotationValue) {
8279
if (annotationValue == null) {
@@ -90,8 +87,9 @@ public static boolean hasValue(Object annotationValue) {
9087
if ((annotationValue instanceof String) && ObjectUtils.isEmpty(annotationValue)) {
9188
return false;
9289
}
93-
// Poller with special 'none' value
94-
if ((annotationValue instanceof Poller) && ValueConstants.DEFAULT_NONE.equals(((Poller) annotationValue).value())) {
90+
// Annotation with 'value' set to special 'none' string
91+
if ((annotationValue instanceof Annotation) &&
92+
ValueConstants.DEFAULT_NONE.equals(AnnotationUtils.getValue((Annotation) annotationValue))) {
9593
return false;
9694
}
9795
return true;

spring-integration-core/src/test/kotlin/org/springframework/integration/function/FunctionsTests.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ import java.util.stream.Collectors
5858
* @author Artem Bilan
5959
* @author Chris Bono
6060
*
61-
*
6261
* @since 5.1
6362
*/
6463
@SpringJUnitConfig

src/reference/asciidoc/changes-5.5-6.0.adoc

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/reference/asciidoc/whats-new.adoc

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,21 @@ See <<./http.adoc#http,HTTP Support>> for more information.
3636
=== RMI Removal
3737

3838
The `spring-integration-rmi` module has been removed altogether after being deprecated in previous versions.
39-
There is no replacement: it is recommended to migrate to more secure network and application protocols, such as WebSockets, RSockets, gRPC or REST.
39+
There is no replacement: it is recommended to migrate to more secure network and application protocols, such as WebSockets, RSockets, gRPC or REST.
40+
41+
[[x6.0-poller]]
42+
==== @Poller (Messaging Annotations)
43+
44+
The messaging annotations
45+
46+
- `@Aggregator`
47+
- `@BridgeFrom`
48+
- `@BridgeTo`
49+
- `@Filter`
50+
- `@InboundChannelAdapter`
51+
- `@Router`
52+
- `@ServiceActivator`
53+
- `@Splitter`
54+
- `@Transformer`
55+
56+
used to contain a `Poller[]` attribute but now contain a single element. The array was only in place to allow an empty default (no poller). This is now accomplished with a single element using the special value of `ValueConstants.DEFAULT_NONE`.

0 commit comments

Comments
 (0)