Skip to content

Commit

Permalink
[weathercompany] Alignment according to #14407 (#14505)
Browse files Browse the repository at this point in the history
Signed-off-by: lsiepel <leosiepel@gmail.com>
  • Loading branch information
lsiepel authored Feb 26, 2023
1 parent b023e5a commit 8a433bd
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 some static utility 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 8a433bd

Please sign in to comment.