Merge pull request #4104 from sjvs/master

Fix three lgtm.com alerts: two possible NPEs, one possible int overflow
This commit is contained in:
Stian Thorgersen 2017-05-05 13:13:02 +02:00 committed by GitHub
commit 8da766e02e
3 changed files with 4 additions and 4 deletions

View file

@ -119,7 +119,7 @@ public class JpaUserCredentialStore implements UserCredentialStore {
entity.setUser(userRef);
em.persist(entity);
MultivaluedHashMap<String, String> config = cred.getConfig();
if (config != null || !config.isEmpty()) {
if (config != null && !config.isEmpty()) {
for (String key : config.keySet()) {
List<String> values = config.getList(key);

View file

@ -130,7 +130,7 @@ public class XMLTimeUtil {
* @return
*/
public static long inMilis(int valueInMins) {
return valueInMins * 60 * 1000;
return (long) valueInMins * 60 * 1000;
}
/**

View file

@ -541,7 +541,7 @@ public class RealmAdminResource {
query.client(client);
}
if (types != null & !types.isEmpty()) {
if (types != null && !types.isEmpty()) {
EventType[] t = new EventType[types.size()];
for (int i = 0; i < t.length; i++) {
t[i] = EventType.valueOf(types.get(i));