Skip to content

Commit

Permalink
[ecobee] Alignment according to openhab#14407 (openhab#14506)
Browse files Browse the repository at this point in the history
Signed-off-by: lsiepel <leosiepel@gmail.com>
  • Loading branch information
lsiepel authored and renescherer committed Mar 23, 2023
1 parent 6edd4d3 commit 105d654
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.util.List;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;

/**
* The {@link ExceptionUtils} class defines static Exception related methods
Expand All @@ -26,11 +25,14 @@
@NonNullByDefault
public class ExceptionUtils {

public static @Nullable Throwable getRootThrowable(@Nullable Throwable throwable) {
public static Throwable getRootThrowable(Throwable throwable) {
List<Throwable> list = new ArrayList<>();
while (throwable != null && !list.contains(throwable)) {
while (!list.contains(throwable)) {
list.add(throwable);
throwable = throwable.getCause();
Throwable throwableLocal = throwable.getCause();
if (throwableLocal != null) {
throwable = throwableLocal;
}
}
return throwable;
}
Expand Down

0 comments on commit 105d654

Please sign in to comment.