8162577: Standardize logging levels
Reviewed-by: mchung, rriggs, skoivu
This commit is contained in:
parent
60cfb25bfe
commit
23a605ff5c
@ -692,11 +692,14 @@ public class Level implements java.io.Serializable {
|
|||||||
Level levelObject = ref.get();
|
Level levelObject = ref.get();
|
||||||
if (levelObject == null) continue;
|
if (levelObject == null) continue;
|
||||||
Level other = ref.mirroredLevel;
|
Level other = ref.mirroredLevel;
|
||||||
|
Class<? extends Level> type = levelObject.getClass();
|
||||||
if (l.value == other.value &&
|
if (l.value == other.value &&
|
||||||
(l.resourceBundleName == other.resourceBundleName ||
|
(l.resourceBundleName == other.resourceBundleName ||
|
||||||
(l.resourceBundleName != null &&
|
(l.resourceBundleName != null &&
|
||||||
l.resourceBundleName.equals(other.resourceBundleName)))) {
|
l.resourceBundleName.equals(other.resourceBundleName)))) {
|
||||||
return Optional.of(levelObject);
|
if (type == l.getClass()) {
|
||||||
|
return Optional.of(levelObject);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -619,13 +619,21 @@ public class LogRecord implements java.io.Serializable {
|
|||||||
throw new IOException("LogRecord: bad version: " + major + "." + minor);
|
throw new IOException("LogRecord: bad version: " + major + "." + minor);
|
||||||
}
|
}
|
||||||
int len = in.readInt();
|
int len = in.readInt();
|
||||||
if (len == -1) {
|
if (len < -1) {
|
||||||
|
throw new NegativeArraySizeException();
|
||||||
|
} else if (len == -1) {
|
||||||
parameters = null;
|
parameters = null;
|
||||||
} else {
|
} else if (len < 255) {
|
||||||
parameters = new Object[len];
|
parameters = new Object[len];
|
||||||
for (int i = 0; i < parameters.length; i++) {
|
for (int i = 0; i < parameters.length; i++) {
|
||||||
parameters[i] = in.readObject();
|
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 necessary, try to regenerate the resource bundle.
|
||||||
if (resourceBundleName != null) {
|
if (resourceBundleName != null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user