Skip to content
Snippets Groups Projects
Commit 8cf56297 authored by Paul-Christian Volkmer's avatar Paul-Christian Volkmer
Browse files

Fixed some issues found by FindBugs plugin

parent 2bf717b4
No related merge requests found
...@@ -109,7 +109,7 @@ public class CouchDBDao implements IDatabaseDao { ...@@ -109,7 +109,7 @@ public class CouchDBDao implements IDatabaseDao {
*/ */
@Override @Override
public void cleanFeedbackVotes(int cleanupFeedbackDelay) { public void cleanFeedbackVotes(int cleanupFeedbackDelay) {
final long timelimitInMillis = 60000 * cleanupFeedbackDelay; final long timelimitInMillis = 60000 * (long) cleanupFeedbackDelay;
final long maxAllowedTimeInMillis = System.currentTimeMillis() - timelimitInMillis; final long maxAllowedTimeInMillis = System.currentTimeMillis() - timelimitInMillis;
Map<String, Set<String>> affectedUsers = new HashMap<String, Set<String>>(); Map<String, Set<String>> affectedUsers = new HashMap<String, Set<String>>();
...@@ -535,7 +535,7 @@ public class CouchDBDao implements IDatabaseDao { ...@@ -535,7 +535,7 @@ public class CouchDBDao implements IDatabaseDao {
JSONObject json = JSONObject.fromObject(loggedIn); JSONObject json = JSONObject.fromObject(loggedIn);
Document doc = new Document(json); Document doc = new Document(json);
if (doc.getId() == "") { if (doc.getId().isEmpty()) {
// If this is a new user without a logged_in document, we have to remove the following // If this is a new user without a logged_in document, we have to remove the following
// pre-filled fields. Otherwise, CouchDB will take these empty fields as genuine // pre-filled fields. Otherwise, CouchDB will take these empty fields as genuine
// identifiers, and will throw errors afterwards. // identifiers, and will throw errors afterwards.
......
...@@ -56,6 +56,7 @@ public class User implements Serializable { ...@@ -56,6 +56,7 @@ public class User implements Serializable {
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj == null || ! obj.getClass().equals(this.getClass())) return false;
User other = (User) obj; User other = (User) obj;
return this.username.equals(other.username); return this.username.equals(other.username);
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment