aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2015-01-06 23:11:15 +0100
committerSamuel Tardieu <sam@rfc1149.net>2015-01-06 23:11:15 +0100
commitf019e8a76d7bd0be0c7a3e1cf91c3a7d59585e2a (patch)
tree0dd5f09baed0687530572718352b3e2c86f2d553 /main
parente9674a5ff952a485b5eb873ea02b5fd280cf9ed1 (diff)
downloadcgeo-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.java5
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;
}
}