Fix possible issues presented by FindBugs

This commit is contained in:
Colin McDonald 2016-06-16 10:58:23 -04:00
parent c99052d8f1
commit fac4d50501
2 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,6 @@
package net.frozenorb.apiv3.handler; package net.frozenorb.apiv3.handler;
import com.google.common.base.Charsets;
import io.vertx.core.Handler; import io.vertx.core.Handler;
import io.vertx.ext.web.RoutingContext; import io.vertx.ext.web.RoutingContext;
import net.frozenorb.apiv3.APIv3; import net.frozenorb.apiv3.APIv3;
@ -8,6 +9,7 @@ import net.frozenorb.apiv3.model.Server;
import net.frozenorb.apiv3.model.User; import net.frozenorb.apiv3.model.User;
import net.frozenorb.apiv3.util.ErrorUtils; import net.frozenorb.apiv3.util.ErrorUtils;
import java.nio.charset.Charset;
import java.util.Base64; import java.util.Base64;
public final class ActorAttributeHandler implements Handler<RoutingContext> { public final class ActorAttributeHandler implements Handler<RoutingContext> {
@ -28,7 +30,7 @@ public final class ActorAttributeHandler implements Handler<RoutingContext> {
private void processBasicAuthorization(String authHeader, RoutingContext ctx) { private void processBasicAuthorization(String authHeader, RoutingContext ctx) {
String encodedHeader = authHeader.substring("Basic ".length()); String encodedHeader = authHeader.substring("Basic ".length());
String decodedHeader = new String(Base64.getDecoder().decode(encodedHeader.getBytes())); String decodedHeader = new String(Base64.getDecoder().decode(encodedHeader.getBytes(Charsets.UTF_8)), Charsets.UTF_8);
String[] splitHeader = decodedHeader.split(":"); String[] splitHeader = decodedHeader.split(":");
if (splitHeader.length != 2) { if (splitHeader.length != 2) {

View File

@ -26,7 +26,7 @@ public final class GETDump implements Handler<RoutingContext> {
int tick = 0; int tick = 0;
while (true) { while (true) {
if (tick == 0 || tick % 2 == 1) { if (tick == 0 || tick % 2 != 0) {
List<UUID> banCache = new ArrayList<>(); List<UUID> banCache = new ArrayList<>();
List<UUID> blacklistCache = new ArrayList<>(); List<UUID> blacklistCache = new ArrayList<>();