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_r334486432
##########
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:
Alright, that makes sense. What do you think about the others, where the
empty value of `Optional` is legal? Do you think we should make the changes
there, or is the PR good to go?
----------------------------------------------------------------
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