提交 bdc45dc6 编写于 作者: D dfuchs

8162577: Standardize logging levels

Reviewed-by: igerasim, mchung, rriggs, skoivu
上级 317ff359
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -599,11 +599,14 @@ public class Level implements java.io.Serializable {
if (list != null) {
for (KnownLevel level : list) {
Level other = level.mirroredLevel;
Class<? extends Level> type = level.levelObject.getClass();
if (l.value == other.value &&
(l.resourceBundleName == other.resourceBundleName ||
(l.resourceBundleName != null &&
l.resourceBundleName.equals(other.resourceBundleName)))) {
return level;
if (type == l.getClass()) {
return level;
}
}
}
}
......
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -502,13 +502,21 @@ public class LogRecord implements java.io.Serializable {
throw new IOException("LogRecord: bad version: " + major + "." + minor);
}
int len = in.readInt();
if (len == -1) {
if (len < -1) {
throw new NegativeArraySizeException();
} else if (len == -1) {
parameters = null;
} else {
} else if (len < 255) {
parameters = new Object[len];
for (int i = 0; i < parameters.length; i++) {
parameters[i] = in.readObject();
}
} else {
List<Object> params = new ArrayList<>(Math.min(len, 1024));
for (int i = 0; i < len; i++) {
params.add(in.readObject());
}
parameters = params.toArray(new Object[params.size()]);
}
// If necessary, try to regenerate the resource bundle.
if (resourceBundleName != null) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册