findbugs is now happy

This commit is contained in:
Athou
2014-08-14 08:38:13 +02:00
parent 62a8e8c119
commit 0ff477579b
3 changed files with 11 additions and 4 deletions

View File

@@ -112,7 +112,7 @@ public class FeedEntryStatusDAO extends GenericDAO<FeedEntryStatus> {
List<FeedEntryStatus> statuses = query.list(status);
for (FeedEntryStatus status : statuses) {
status = handleStatus(user, status, status.getSubscription(), status.getEntry());
status = fetchTags(user, status);
fetchTags(user, status);
}
return lazyLoadContent(includeContent, statuses);
}

View File

@@ -1,6 +1,5 @@
package com.commafeed.backend.service;
import java.io.Serializable;
import java.util.Properties;
import javax.mail.Authenticator;
@@ -21,9 +20,8 @@ import com.commafeed.backend.model.User;
* Mailing service
*
*/
@SuppressWarnings("serial")
@RequiredArgsConstructor
public class MailService implements Serializable {
public class MailService {
private final CommaFeedConfiguration config;

View File

@@ -12,12 +12,17 @@ import javax.crypto.spec.PBEKeySpec;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
// taken from http://www.javacodegeeks.com/2012/05/secure-password-storage-donts-dos-and.html
@SuppressWarnings("serial")
@Slf4j
public class PasswordEncryptionService implements Serializable {
public boolean authenticate(String attemptedPassword, byte[] encryptedPassword, byte[] salt) {
if (StringUtils.isBlank(attemptedPassword)) {
return false;
}
// Encrypt the clear-text password using the same salt that was used to
// encrypt the original password
byte[] encryptedAttemptedPassword = null;
@@ -28,6 +33,10 @@ public class PasswordEncryptionService implements Serializable {
log.error(e.getMessage(), e);
}
if (encryptedAttemptedPassword == null) {
return false;
}
// Authentication succeeds if encrypted password that the user entered
// is equal to the stored hash
return MessageDigest.isEqual(encryptedPassword, encryptedAttemptedPassword);