sanha commented on a change in pull request #241: [NEMO-424] Fix Sonarcloud
bugs regarding Optional
URL: https://github.com/apache/incubator-nemo/pull/241#discussion_r334944702
##########
File path:
runtime/executor/src/main/java/org/apache/nemo/runtime/executor/datatransfer/BlockInputReader.java
##########
@@ -67,14 +67,15 @@
@Override
public List<CompletableFuture<DataUtil.IteratorWithNumBytes>> read() {
- final Optional<CommunicationPatternProperty.Value> comValue =
+ final Optional<CommunicationPatternProperty.Value> comValueOptional =
runtimeEdge.getPropertyValue(CommunicationPatternProperty.class);
+ final CommunicationPatternProperty.Value comValue =
comValueOptional.orElseThrow(IllegalStateException::new);
- if (comValue.get().equals(CommunicationPatternProperty.Value.ONE_TO_ONE)) {
+ if (comValue.equals(CommunicationPatternProperty.Value.ONE_TO_ONE)) {
Review comment:
FYI, `comValue` can't be null.
But it would be good to change it for the style consistency.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services