Commit 0b8de71d by Tuomas Riihimäki

Minor findbugs stuff

1 parent ba2d0e50
...@@ -13,3 +13,4 @@ ...@@ -13,3 +13,4 @@
/code/*/target/ /code/*/target/
/code/*/test-output/ /code/*/test-output/
moya-git.properties moya-git.properties
*/*/bin
...@@ -248,8 +248,8 @@ public class PlaceBean implements PlaceBeanLocal { ...@@ -248,8 +248,8 @@ public class PlaceBean implements PlaceBeanLocal {
} }
} else { } else {
List<PlaceSlot> slots = placeSlotFacade.findFreePlaceSlotsForProduct(user, place.getProduct()); List<PlaceSlot> slots = placeSlotFacade.findFreePlaceSlotsForProduct(user, place.getProduct());
logger.info("Found free slots {} for user {}", Arrays.asList(slots.toArray()), user);
if (slots != null && !slots.isEmpty()) { if (slots != null && !slots.isEmpty()) {
logger.info("Found free slots {} for user {}", Arrays.asList(slots.toArray()), user);
PlaceSlot slot = slots.get(0); PlaceSlot slot = slots.get(0);
logger.warn("Reserving place {} with placeslot {}", place, slot); logger.warn("Reserving place {} with placeslot {}", place, slot);
slot.setPlace(place); slot.setPlace(place);
......
...@@ -251,9 +251,9 @@ public class QueueBean implements QueueBeanLocal { ...@@ -251,9 +251,9 @@ public class QueueBean implements QueueBeanLocal {
if (!permbean.isCurrentUser(user) && !permbean.hasPermission(MapPermission.MANAGE_OTHERS)) if (!permbean.isCurrentUser(user) && !permbean.hasPermission(MapPermission.MANAGE_OTHERS))
throw new RuntimeException("Use " + permbean.getCurrentUser() + "tried to enter to queue in behalf of another user: " + user); throw new RuntimeException("Use " + permbean.getCurrentUser() + "tried to enter to queue in behalf of another user: " + user);
if (map == null || user == null) if (map == null || user == null) {
{
logger.warn("Can not check map {}, user {}", map, user); logger.warn("Can not check map {}, user {}", map, user);
return false;
} }
boolean ret = getMapque(map).isReserving(user); boolean ret = getMapque(map).isReserving(user);
......
...@@ -107,6 +107,8 @@ public class RestBean implements RestBeanLocal { ...@@ -107,6 +107,8 @@ public class RestBean implements RestBeanLocal {
if (!userRestAuths.containsKey(username)) { if (!userRestAuths.containsKey(username)) {
userAuthMap = Collections.synchronizedMap(new HashMap<String, Long>()); userAuthMap = Collections.synchronizedMap(new HashMap<String, Long>());
userRestAuths.put(username, userAuthMap); userRestAuths.put(username, userAuthMap);
} else {
userRestAuths.get(username);
} }
} }
} }
......
...@@ -167,9 +167,9 @@ public class LdapUserHandler { ...@@ -167,9 +167,9 @@ public class LdapUserHandler {
while (searchAttrs.hasMore()) { while (searchAttrs.hasMore()) {
Attribute next = searchAttrs.next(); Attribute next = searchAttrs.next();
logger.info("Got {}, {}, {}", new Object[] { next.getID(), next.get(), searchAttrs.hasMore() });
if (next == null || next.get() == null) if (next == null || next.get() == null)
continue; continue;
logger.info("Got {}, {}, {}", new Object[] { next.getID(), next.get(), searchAttrs.hasMore() });
List<String> resultList = resultAttrs.get(next.getID()); List<String> resultList = resultAttrs.get(next.getID());
if (resultList == null) { if (resultList == null) {
...@@ -326,11 +326,13 @@ public class LdapUserHandler { ...@@ -326,11 +326,13 @@ public class LdapUserHandler {
} }
public boolean authenticate(String username, char[] passwd) { public boolean authenticate(String username, char[] passwd) {
if (username == null || passwd == null || username.isEmpty()) {
return false;
}
String pwd = new String(passwd); String pwd = new String(passwd);
if (username == null || passwd == null || username.isEmpty() || pwd.isEmpty()) { if (pwd.isEmpty()) {
return false; return false;
} }
InitialLdapContext userCtx = null; InitialLdapContext userCtx = null;
try { try {
String userDn = buildUserRdn(username); String userDn = buildUserRdn(username);
......
...@@ -57,7 +57,7 @@ public class ImportView extends GenericCDIView { ...@@ -57,7 +57,7 @@ public class ImportView extends GenericCDIView {
// //
private UploadedFile file; private UploadedFile file;
private ArrayList<ImportWrapper> users; private ArrayList<ImportWrapper> users;
private Charset UTF8 = Charset.forName("UTF8"); private static final Charset UTF8 = Charset.forName("UTF8");
private static final Logger logger = LoggerFactory.getLogger(ImportView.class); private static final Logger logger = LoggerFactory.getLogger(ImportView.class);
// //
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!