wonook 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_r334262326
##########
File path:
runtime/executor/src/main/java/org/apache/nemo/runtime/executor/datatransfer/PipeOutputWriter.java
##########
@@ -137,8 +137,10 @@ private void doInitialize() {
}
private List<ByteOutputContext> getPipeToWrite(final Object element) {
- final CommunicationPatternProperty.Value comm =
- (CommunicationPatternProperty.Value)
runtimeEdge.getPropertyValue(CommunicationPatternProperty.class).get();
+ final Optional<CommunicationPatternProperty.Value> comValueOptional =
+ runtimeEdge.getPropertyValue(CommunicationPatternProperty.class);
+ final CommunicationPatternProperty.Value comm =
comValueOptional.orElseThrow(IllegalStateException::new);
+
if (comm.equals(CommunicationPatternProperty.Value.ONE_TO_ONE)) {
Review comment:
ditto
----------------------------------------------------------------
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