diff --git a/pom.xml b/pom.xml index 412e4529f38c795791e0c818801feaca5f2774b2..eaa346f266287c043e0b45d5952ab599a1031d75 100644 --- a/pom.xml +++ b/pom.xml @@ -87,16 +87,18 @@ <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-project-info-reports-plugin</artifactId> <version>2.4</version> - <configuration> - - </configuration> + <configuration></configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> - <configuration> - - </configuration> + <configuration></configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>findbugs-maven-plugin</artifactId> + <version>2.5.2</version> + <configuration></configuration> </plugin> </plugins> </reporting> diff --git a/src/main/java/de/thm/arsnova/dao/CouchDBDao.java b/src/main/java/de/thm/arsnova/dao/CouchDBDao.java index 812133c002db03bc090c71a0acada1d1a09129db..e72feaacb83365c563099013f9e9cdd934a27ed2 100644 --- a/src/main/java/de/thm/arsnova/dao/CouchDBDao.java +++ b/src/main/java/de/thm/arsnova/dao/CouchDBDao.java @@ -109,7 +109,7 @@ public class CouchDBDao implements IDatabaseDao { */ @Override public void cleanFeedbackVotes(int cleanupFeedbackDelay) { - final long timelimitInMillis = 60000 * cleanupFeedbackDelay; + final long timelimitInMillis = 60000 * (long) cleanupFeedbackDelay; final long maxAllowedTimeInMillis = System.currentTimeMillis() - timelimitInMillis; Map<String, Set<String>> affectedUsers = new HashMap<String, Set<String>>(); @@ -537,7 +537,7 @@ public class CouchDBDao implements IDatabaseDao { JSONObject json = JSONObject.fromObject(loggedIn); 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 // pre-filled fields. Otherwise, CouchDB will take these empty fields as genuine // identifiers, and will throw errors afterwards. diff --git a/src/main/java/de/thm/arsnova/entities/User.java b/src/main/java/de/thm/arsnova/entities/User.java index 75e5691f81f52565ae281316bea7972556a22e37..adc8c14507daa5d9e0e0cd1e7a0de22b5891ae62 100644 --- a/src/main/java/de/thm/arsnova/entities/User.java +++ b/src/main/java/de/thm/arsnova/entities/User.java @@ -70,6 +70,7 @@ public class User implements Serializable { @Override public boolean equals(Object obj) { + if (obj == null || ! obj.getClass().equals(this.getClass())) return false; User other = (User) obj; return this.username.equals(other.username) && this.type.equals(other.type); } diff --git a/src/site/site.xml b/src/site/site.xml index 0ace67ef2b2e91d8798eaee3065c4247314bd927..aed7bfb614bc41d362dd51fd12e917f5a204b781 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -50,8 +50,8 @@ <item name="The Team" href="team-list.html" /> </menu> <menu name="Documentation"> - <item name="Dependencies" href="dependencies.html" /> <item name="Installation" href="installation.html" /> + <item name="Dependencies" href="dependencies.html" /> <item name="API Docs" href="apidocs/index.html" /> </menu> <menu name="Further Information">