Skip to content

Commit d0f8431

Browse files
committed
fix LOGBACK-1623
Signed-off-by: Ceki Gulcu <[email protected]>
1 parent 4eb2914 commit d0f8431

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

logback-classic/src/main/java/ch/qos/logback/classic/spi/ThrowableProxy.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
package ch.qos.logback.classic.spi;
1515

1616
import ch.qos.logback.core.CoreConstants;
17+
import ch.qos.logback.core.util.OptionHelper;
1718

1819
import java.lang.reflect.InvocationTargetException;
1920
import java.lang.reflect.Method;
@@ -93,10 +94,10 @@ public ThrowableProxy(Throwable throwable, Set<Throwable> alreadyProcessedSet) {
9394
}
9495

9596
if (GET_SUPPRESSED_METHOD != null) {
96-
// this will only execute on Java 7
97+
// this will only execute on Java 7 and later
9798
Throwable[] throwableSuppressed = extractSupressedThrowables(throwable);
9899

99-
if (throwableSuppressed.length > 0) {
100+
if (OptionHelper.isNotEmtpy(throwableSuppressed)) {
100101
List<ThrowableProxy> suppressedList = new ArrayList<ThrowableProxy>(throwableSuppressed.length);
101102
for (Throwable sup : throwableSuppressed) {
102103
if (alreadyProcessedSet.contains(sup)) {

logback-core/src/main/java/ch/qos/logback/core/util/OptionHelper.java

+10
Original file line numberDiff line numberDiff line change
@@ -259,5 +259,15 @@ public static boolean toBoolean(String value, boolean dEfault) {
259259
public static boolean isEmpty(String str) {
260260
return ((str == null) || str.length() == 0);
261261
}
262+
263+
final public static boolean isNullOrEmpty(Object[] array) {
264+
if(array == null || array.length == 0)
265+
return true;
266+
else
267+
return false;
268+
}
262269

270+
final public static boolean isNotEmtpy(Object[] array) {
271+
return !isNullOrEmpty(array);
272+
}
263273
}

0 commit comments

Comments
 (0)