You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "salmansharifov (via GitHub)" <gi...@apache.org> on 2023/05/18 22:09:44 UTC
[GitHub] [shardingsphere] salmansharifov commented on a diff in pull request #25717: small fixes added for sonar
salmansharifov commented on code in PR #25717:
URL: https://github.com/apache/shardingsphere/pull/25717#discussion_r1198351983
##########
kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/check/consistency/algorithm/AbstractStreamingDataConsistencyCalculateAlgorithm.java:
##########
@@ -78,13 +78,13 @@ public boolean hasNext() {
@Override
public DataConsistencyCalculatedResult next() {
calculateIfNecessary();
- Optional<DataConsistencyCalculatedResult> nextResult = this.nextResult.get();
+ Optional<DataConsistencyCalculatedResult> nextCalculatedResult = this.nextResult.get();
this.nextResult.set(null);
- return nextResult.orElseThrow(NoSuchElementException::new);
+ return nextCalculatedResult.orElseThrow(NoSuchElementException::new);
}
private void calculateIfNecessary() {
- if (null == nextResult.get()) {
+ if (!nextResult.get().isPresent()) {
nextResult.set(calculateChunk(param));
}
Review Comment:
change reverted
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org