Sonar fixes
* use equals * inner assignment * local before return * unnecessary locals * catch and throw * uninstantiable with no statics * implement `Serializable` in `Comparator` to enable `TreeMap` serialization * exceptions as flow control
This commit is contained in:
committed by
Artem Bilan
parent
130e1bba31
commit
19b9944dd8
@@ -31,7 +31,7 @@ public final class SyslogHeaders {
|
||||
super();
|
||||
}
|
||||
|
||||
public static String PREFIX = "syslog_";
|
||||
public static final String PREFIX = "syslog_";
|
||||
|
||||
public static final String FACILITY = PREFIX + SyslogToMapTransformer.FACILITY;
|
||||
|
||||
|
||||
@@ -106,9 +106,10 @@ public class RFC6587SyslogDeserializer implements Deserializer<Map<String, ?>> {
|
||||
|
||||
private int calculateLength(DataInputStream stream, int peek) throws IOException {
|
||||
int length = peek & 0xf;
|
||||
int c;
|
||||
while (isDigit((c = stream.read()))) {
|
||||
int c = stream.read();
|
||||
while (isDigit(c)) {
|
||||
length = length * 10 + (c & 0xf);
|
||||
c = stream.read();
|
||||
}
|
||||
return length;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user