Skip to content

Commit

Permalink
* Use @SuppressWarnings("GuardedBy") instead of `noinspection Field…
Browse files Browse the repository at this point in the history
…AccessNotGuarded` comment (#6903)

* Remove `@GuardedBy("connectionLock")` from `connectionLock` itself

* Add FieldAccessNotGuarded into inspection profile and set the level to ERROR
  • Loading branch information
asdf2014 authored and gianm committed Jan 27, 2019
1 parent ae4dba7 commit 2b73644
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .idea/inspectionProfiles/Druid.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -56,9 +56,8 @@ public class DruidConnection

// Typically synchronized by connectionLock, except in one case: the onClose function passed
// into DruidStatements contained by the map.
private final ConcurrentMap<Integer, DruidStatement> statements;

@GuardedBy("connectionLock")
private final ConcurrentMap<Integer, DruidStatement> statements;
private final Object connectionLock = new Object();

@GuardedBy("connectionLock")
Expand Down Expand Up @@ -94,6 +93,7 @@ public DruidStatement createStatement(SqlLifecycleFactory sqlLifecycleFactory)
e -> !SENSITIVE_CONTEXT_FIELDS.contains(e.getKey())
);

@SuppressWarnings("GuardedBy")
final DruidStatement statement = new DruidStatement(
connectionId,
statementId,
Expand Down

0 comments on commit 2b73644

Please sign in to comment.