Example usage for java.lang Throwable equals

List of usage examples for java.lang Throwable equals

Introduction

In this page you can find the example usage for java.lang Throwable equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:org.openstreetmap.josm.tools.Utils.java

/**
 * Returns the root cause of a throwable object.
 * @param t The object to get root cause for
 * @return the root cause of {@code t}/* w  ww .ja va 2s  . c  o m*/
 * @since 6639
 */
public static Throwable getRootCause(Throwable t) {
    Throwable result = t;
    if (result != null) {
        Throwable cause = result.getCause();
        while (cause != null && !cause.equals(result)) {
            result = cause;
            cause = result.getCause();
        }
    }
    return result;
}