config: Minor cleanup
- Stop implicitly assuming locales in String.format - Cleanup method visibilities - Improve uses of Integer methods - Remove unused getToken method Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
committed by
Jason A. Donenfeld
parent
ba862b166b
commit
217ab5e17f
@@ -7,6 +7,7 @@ import java.lang.reflect.Method;
|
||||
import java.net.InetAddress;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -88,17 +89,13 @@ enum Attribute {
|
||||
}
|
||||
|
||||
public String composeWith(final int value) {
|
||||
return String.format("%s = %d%n", token, value);
|
||||
return String.format(Locale.getDefault(), "%s = %d%n", token, value);
|
||||
}
|
||||
|
||||
public <T> String composeWith(final List<T> value) {
|
||||
return String.format("%s = %s%n", token, listToString(value));
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public String parse(final CharSequence line) {
|
||||
final Matcher matcher = pattern.matcher(line);
|
||||
return matcher.matches() ? matcher.group(1) : null;
|
||||
|
||||
Reference in New Issue
Block a user