diff options
author | Samuel Tardieu <sam@rfc1149.net> | 2015-01-06 23:11:15 +0100 |
---|---|---|
committer | Samuel Tardieu <sam@rfc1149.net> | 2015-01-06 23:11:15 +0100 |
commit | f019e8a76d7bd0be0c7a3e1cf91c3a7d59585e2a (patch) | |
tree | 0dd5f09baed0687530572718352b3e2c86f2d553 /main | |
parent | e9674a5ff952a485b5eb873ea02b5fd280cf9ed1 (diff) | |
download | cgeo-f019e8a76d7bd0be0c7a3e1cf91c3a7d59585e2a.zip cgeo-f019e8a76d7bd0be0c7a3e1cf91c3a7d59585e2a.tar.gz cgeo-f019e8a76d7bd0be0c7a3e1cf91c3a7d59585e2a.tar.bz2 |
Use a non-volatile variable to avoid warning
Testing the value of a volatile entity for nullness doesn't give any
clue on its *continued* nullness. The tooling knows that and complains.
Diffstat (limited to 'main')
-rw-r--r-- | main/src/cgeo/geocaching/DataStore.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/DataStore.java b/main/src/cgeo/geocaching/DataStore.java index 0f9f6bf..d36a9c9 100644 --- a/main/src/cgeo/geocaching/DataStore.java +++ b/main/src/cgeo/geocaching/DataStore.java @@ -3001,8 +3001,9 @@ public class DataStore { private static void clearPreparedStatements() { for (final PreparedStatement preparedStatement : statements) { - if (preparedStatement.statement != null) { - preparedStatement.statement.close(); + final SQLiteStatement statement = preparedStatement.statement; + if (statement != null) { + statement.close(); preparedStatement.statement = null; } } |