Commit 4c15d6c4 by Juho Salli

Merge branch 'findbugs' into 'master'

Findbugs stuff

Minor findbugs fixes and version updates

See merge request !221
2 parents ba2d0e50 28388dac
......@@ -13,3 +13,4 @@
/code/*/target/
/code/*/test-output/
moya-git.properties
*/*/bin
......@@ -251,6 +251,7 @@ public class BootstrapBean implements BootstrapBeanLocal {
});
dbUpdates.add(new String[] {
"DELETE FROM product_limitations_roles where productlimitation_id in (SELECT id FROM product_limitations WHERE TYPE = 'PLACE')",
"DELETE FROM products_product_limitations where productlimits_id in (SELECT id FROM product_limitations WHERE TYPE = 'PLACE')",
"DELETE FROM product_limitations WHERE TYPE = 'PLACE'",
......
......@@ -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);
......
......@@ -34,7 +34,7 @@
<dependency>
<groupId>org.apache.sshd</groupId>
<artifactId>sshd-core</artifactId>
<version>0.8.0</version>
<version>0.13.0</version>
</dependency>
<dependency>
<!-- Java melody dependency -->
......@@ -60,7 +60,7 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.13</version>
<version>6.8.15</version>
<scope>test</scope>
</dependency>
<dependency>
......@@ -114,7 +114,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.7</version>
<version>1.7.10</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
......
......@@ -27,7 +27,7 @@
<dependency>
<groupId>net.bull.javamelody</groupId>
<artifactId>javamelody-core</artifactId>
<version>1.52.0</version>
<version>1.54.0</version>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
......
......@@ -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!