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_r334262356
 
 

 ##########
 File path: common/src/main/java/org/apache/nemo/common/Util.java
 ##########
 @@ -117,7 +117,10 @@ public static IREdge cloneEdge(final IREdge edgeToClone,
                                  final IRVertex newSrc,
                                  final IRVertex newDst) {
     return cloneEdge(
-      edgeToClone.getPropertyValue(CommunicationPatternProperty.class).get(), 
edgeToClone, newSrc, newDst);
+      
edgeToClone.getPropertyValue(CommunicationPatternProperty.class).orElseThrow(IllegalStateException::new),
 
 Review comment:
   I'm seeing a LOT of these lines. I'm just wondering whether it would be 
simply enough to return `.orElse(null)`, if the property is empty, instead of 
throwing an exception. What do you think?

----------------------------------------------------------------
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

Reply via email to