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_r334477207
 
 

 ##########
 File path: 
compiler/optimizer/src/main/java/org/apache/nemo/compiler/optimizer/pass/compiletime/annotating/ResourceSitePass.java
 ##########
 @@ -164,7 +164,7 @@ private static void assignNodeShares(
    */
   private static boolean isOneToOneEdge(final Collection<IREdge> inEdges) {
     return inEdges.size() == 1 && inEdges.iterator().next()
-      .getPropertyValue(CommunicationPatternProperty.class).get()
+      
.getPropertyValue(CommunicationPatternProperty.class).orElseThrow(IllegalStateException::new)
 
 Review comment:
   In my thought, it makes sense only if the empty value of the `Optional` is 
legal. 
   
   We suppose that all `IREdge` has `CommunicationPatternProperty` property 
value, so the empty value is an illegal state. In this case, it would be good 
to stop processing immediately and not propagate the illegal state.

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