global: Clean up Java

Address Java and Android lints.

Signed-off-by: Samuel Holland <samuel@sholland.org>
This commit is contained in:
Samuel Holland
2018-04-30 11:50:21 -05:00
parent 8e4fb91a28
commit 843003f436
13 changed files with 237 additions and 215 deletions
@@ -6,17 +6,17 @@ import java.net.InetAddress;
import java.util.Locale;
public class IPCidr {
private InetAddress address;
private final InetAddress address;
private int cidr;
public IPCidr(String in) {
cidr = -1;
int slash = in.lastIndexOf('/');
final int slash = in.lastIndexOf('/');
if (slash != -1 && slash < in.length() - 1) {
try {
cidr = Integer.parseInt(in.substring(slash + 1), 10);
in = in.substring(0, slash);
} catch (Exception ignored) {
} catch (final Exception ignored) {
}
}
address = Attribute.parseIPString(in);