NPE in LoggerImpl when formatted logger called with null or empty arguments
@@ -321,6 +321,9 @@ public class LoggerImpl implements Logger {
}
String format(String format, LogParameters logParameters) {
+ if (logParameters.isEmpty()) {
+ return format;
+ }
StringBuilder sb = new StringBuilder();
int offset = 0;
int length = format.length();
@@ -369,6 +372,9 @@ public class LoggerImpl implements Logger {
this.sr = sr;
this.t = t;
}
+ public boolean isEmpty() {
+ return (args == null) || (args.length == 0);
+ }
final Object[] args;
final ServiceReference<?> sr;
final Throwable t;
