Commit 0b8de71d by Tuomas Riihimäki

Minor findbugs stuff

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