@@ -131,7 +131,10 @@ private Map<Class, AddFilterAdaptor> getAddFilters(
131
131
for (KubernetesReconcilerWatch watch : watches .value ()) {
132
132
for (Method method : reconciler .getClass ().getMethods ()) {
133
133
AddWatchEventFilter annotation = method .getAnnotation (AddWatchEventFilter .class );
134
- if (annotation != null && watch .apiTypeClass ().equals (annotation .apiTypeClass ())) {
134
+ if (annotation == null ) {
135
+ continue ;
136
+ }
137
+ if (watch .apiTypeClass ().equals (annotation .apiTypeClass ())) {
135
138
if (filters .containsKey (watch .apiTypeClass ())) {
136
139
log .warn (
137
140
"Duplicated watch ADD event filter upon apiType {}" , annotation .apiTypeClass ());
@@ -157,7 +160,10 @@ private Map<Class, UpdateFilterAdaptor> getUpdateFilters(
157
160
for (KubernetesReconcilerWatch watch : watches .value ()) {
158
161
for (Method method : reconciler .getClass ().getMethods ()) {
159
162
UpdateWatchEventFilter annotation = method .getAnnotation (UpdateWatchEventFilter .class );
160
- if (annotation != null && watch .apiTypeClass ().equals (annotation .apiTypeClass ())) {
163
+ if (annotation == null ) {
164
+ continue ;
165
+ }
166
+ if (watch .apiTypeClass ().equals (annotation .apiTypeClass ())) {
161
167
if (filters .containsKey (watch .apiTypeClass ())) {
162
168
log .warn (
163
169
"Duplicated watch UPDATE event filter upon apiType {}" , annotation .apiTypeClass ());
@@ -184,7 +190,10 @@ private Map<Class, DeleteFilterAdaptor> getDeleteFilters(
184
190
for (KubernetesReconcilerWatch watch : watches .value ()) {
185
191
for (Method method : reconciler .getClass ().getMethods ()) {
186
192
DeleteWatchEventFilter annotation = method .getAnnotation (DeleteWatchEventFilter .class );
187
- if (annotation != null && watch .apiTypeClass ().equals (annotation .apiTypeClass ())) {
193
+ if (annotation == null ) {
194
+ continue ;
195
+ }
196
+ if (watch .apiTypeClass ().equals (annotation .apiTypeClass ())) {
188
197
if (filters .containsKey (watch .apiTypeClass ())) {
189
198
log .warn (
190
199
"Duplicated watch DELETE event filter upon apiType {}" , annotation .apiTypeClass ());
0 commit comments