[
https://issues.apache.org/jira/browse/FLINK-9185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16547791#comment-16547791
]
ASF GitHub Bot commented on FLINK-9185:
---------------------------------------
Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/5894#discussion_r203368063
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PrioritizedOperatorSubtaskState.java
---
@@ -281,10 +281,15 @@ public PrioritizedOperatorSubtaskState build() {
// approve-function signaled true.
if (alternative != null
&& alternative.hasState()
- && alternative.size() == 1
- && approveFun.apply(reference,
alternative.iterator().next())) {
--- End diff --
Could we wrap this application in
`BooleanUtils.isTrue(approveFun.apply(reference,
alternative.iterator().next()))` in order to avoid the extra conditions?
> Potential null dereference in
> PrioritizedOperatorSubtaskState#resolvePrioritizedAlternatives
> --------------------------------------------------------------------------------------------
>
> Key: FLINK-9185
> URL: https://issues.apache.org/jira/browse/FLINK-9185
> Project: Flink
> Issue Type: Bug
> Reporter: Ted Yu
> Assignee: Stephen Jason
> Priority: Minor
> Labels: pull-request-available
>
> {code}
> if (alternative != null
> && alternative.hasState()
> && alternative.size() == 1
> && approveFun.apply(reference, alternative.iterator().next())) {
> {code}
> The return value from approveFun.apply would be unboxed.
> We should check that the return value is not null.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)