You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Bruce Schuchardt (JIRA)" <ji...@apache.org> on 2018/11/09 16:50:00 UTC

[jira] [Created] (GEODE-6023) synchronization on non-final variable

Bruce Schuchardt created GEODE-6023:
---------------------------------------

             Summary: synchronization on non-final variable
                 Key: GEODE-6023
                 URL: https://issues.apache.org/jira/browse/GEODE-6023
             Project: Geode
          Issue Type: Bug
          Components: membership
            Reporter: Bruce Schuchardt


The class SocketCloser synchronizes on a non-final boxed instance variable, "closed".

{code}
    synchronized (closed) {
      if (!this.closed) {
        this.closed = true;
      } else {
        return;
      }
    }
{code}

This is probably okay but it's flagged as an ERROR by LGTM scans and we shouldn't be using auto-boxed variables in non-test code.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)