19
19
import java .util .Locale ;
20
20
import java .util .Map ;
21
21
22
+ import org .jspecify .annotations .Nullable ;
23
+
22
24
import org .springframework .beans .factory .BeanFactory ;
23
25
import org .springframework .expression .Expression ;
24
26
import org .springframework .expression .common .LiteralExpression ;
30
32
import org .springframework .integration .expression .FunctionExpression ;
31
33
import org .springframework .integration .expression .SupplierExpression ;
32
34
import org .springframework .integration .handler .AbstractReplyProducingMessageHandler ;
33
- import org .springframework .lang .Nullable ;
34
35
import org .springframework .messaging .Message ;
35
36
import org .springframework .util .Assert ;
36
37
@@ -49,16 +50,15 @@ public class GraphQlMessageHandler extends AbstractReplyProducingMessageHandler
49
50
50
51
private StandardEvaluationContext evaluationContext = new StandardEvaluationContext ();
51
52
52
- @ Nullable
53
- private Expression operationExpression ;
53
+ private @ Nullable Expression operationExpression ;
54
54
55
55
private Expression operationNameExpression = new SupplierExpression <>(() -> null );
56
56
57
57
private Expression variablesExpression = new SupplierExpression <>(() -> null );
58
58
59
- @ Nullable
60
- private Locale locale ;
59
+ private @ Nullable Locale locale ;
61
60
61
+ @ SuppressWarnings ("NullAway" ) // In most cases the message really comes with an ID
62
62
private Expression executionIdExpression =
63
63
new FunctionExpression <Message <?>>(message -> message .getHeaders ().getId ());
64
64
@@ -163,19 +163,16 @@ private String evaluateOperationExpression(Message<?> message) {
163
163
return operation ;
164
164
}
165
165
166
- @ Nullable
167
- private String evaluateOperationNameExpression (Message <?> message ) {
166
+ private @ Nullable String evaluateOperationNameExpression (Message <?> message ) {
168
167
return this .operationNameExpression .getValue (this .evaluationContext , message , String .class );
169
168
}
170
169
171
- @ Nullable
172
170
@ SuppressWarnings ("unchecked" )
173
- private Map <String , Object > evaluateVariablesExpression (Message <?> message ) {
171
+ private @ Nullable Map <String , Object > evaluateVariablesExpression (Message <?> message ) {
174
172
return this .variablesExpression .getValue (this .evaluationContext , message , Map .class );
175
173
}
176
174
177
- @ Nullable
178
- private String evaluateExecutionIdExpression (Message <?> message ) {
175
+ private @ Nullable String evaluateExecutionIdExpression (Message <?> message ) {
179
176
return this .executionIdExpression .getValue (this .evaluationContext , message , String .class );
180
177
}
181
178
0 commit comments