sanha commented on a change in pull request #240: [NEMO-424] Fix Sonarcloud 
bugs regarding Optional
URL: https://github.com/apache/incubator-nemo/pull/240#discussion_r332820554
 
 

 ##########
 File path: 
runtime/executor/src/main/java/org/apache/nemo/runtime/executor/bytetransfer/ClosableBlockingQueue.java
 ##########
 @@ -32,7 +32,7 @@
 public final class ClosableBlockingQueue<T> implements AutoCloseable {
 
   private final Queue<T> queue;
-  private volatile boolean closed = false;
+  private boolean closed = false;
 
 Review comment:
   The original SonarCloud issue was about `throwable`, but not about `closed`.
   
   SonarCloud pointed out that the `volatile` volatilizes the reference only, 
but not the object.
   However, the original purpose of the `volatile` at `throwable` seems to 
volatilize the reference.
   
   IMHO, these two fields must be volatile. Maybe we can just keep this 
SonarCloud issue as known-issue.

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