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_r334327210
##########
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:
But in places like this, would it make less sense if this returns an
exception instead of a `false` if `ONE_TO_ONE` doesn't equal an empty
`Optional`, where the value is unassigned?
----------------------------------------------------------------
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