Oh crap.
The Loggers don't strip out the Exception if it's the last element, so they actually *depend* on this ignoring the last odd element. Revert my last change until I figure some reasonable compromise out. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2892 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -51,8 +51,8 @@ public class LogBuilder
|
||||
*/
|
||||
public LogBuilder append (Object... args)
|
||||
{
|
||||
if (args != null) {
|
||||
for (int ii = 0, nn = args.length; ii < nn; ii += 2) {
|
||||
if (args != null && args.length > 1) {
|
||||
for (int ii = 0, nn = args.length - (args.length % 2); ii < nn; ii += 2) {
|
||||
if (_hasArgs) {
|
||||
_log.append(", ");
|
||||
} else {
|
||||
@@ -65,7 +65,7 @@ public class LogBuilder
|
||||
}
|
||||
_log.append(args[ii]).append("=");
|
||||
try {
|
||||
Object arg = args[ii + 1]; // this may cause ArrayIndexOutOfBoundsException
|
||||
Object arg = args[ii + 1];
|
||||
_log.append(((arg == null) || !arg.getClass().isArray()) ? arg : arrayStr(arg));
|
||||
} catch (Throwable t) {
|
||||
_log.append("<toString() failure: " + t + ">");
|
||||
|
||||
Reference in New Issue
Block a user