Skip to content

Commit

Permalink
fix LOGBACK-1623
Browse files Browse the repository at this point in the history
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
  • Loading branch information
ceki committed Mar 31, 2022
1 parent 4eb2914 commit d0f8431
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package ch.qos.logback.classic.spi;

import ch.qos.logback.core.CoreConstants;
import ch.qos.logback.core.util.OptionHelper;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
Expand Down Expand Up @@ -93,10 +94,10 @@ public ThrowableProxy(Throwable throwable, Set<Throwable> alreadyProcessedSet) {
}

if (GET_SUPPRESSED_METHOD != null) {
// this will only execute on Java 7
// this will only execute on Java 7 and later
Throwable[] throwableSuppressed = extractSupressedThrowables(throwable);

if (throwableSuppressed.length > 0) {
if (OptionHelper.isNotEmtpy(throwableSuppressed)) {
List<ThrowableProxy> suppressedList = new ArrayList<ThrowableProxy>(throwableSuppressed.length);
for (Throwable sup : throwableSuppressed) {
if (alreadyProcessedSet.contains(sup)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,5 +259,15 @@ public static boolean toBoolean(String value, boolean dEfault) {
public static boolean isEmpty(String str) {
return ((str == null) || str.length() == 0);
}

final public static boolean isNullOrEmpty(Object[] array) {
if(array == null || array.length == 0)
return true;
else
return false;
}

final public static boolean isNotEmtpy(Object[] array) {
return !isNullOrEmpty(array);
}
}

1 comment on commit d0f8431

@vikinghawk
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ceki any plans on when the following change will be released?

We are currently hitting this bug with 1.2.11 that is causing issues for us around hazelcast

Please sign in to comment.