Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2008, 2010 VMware Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at Contributors: VMware Inc. - initial contribution /
package org.eclipse.virgo.nano.serviceability.dump;

Maintains state about which java.lang.Throwable was last seen for the current thread.

Concurrent Semantics
State is thread local.

final class FFDCExceptionState {
    private static final State STATE = new State();

Record that the supplied java.lang.Throwable has been seen.

t the Throwable.
    public static void record(Throwable t) {

Query whether the supplied java.lang.Throwable or one of its causes has been seen.

t the Throwable
true if the Throwable has been seen, otherwise false.
    public static boolean seen(Throwable t) {
        boolean seen = false;
        Throwable s = t;
        do {
            if (s.equals(.get())) {
                seen = true;
            s = s.getCause();
        } while (s != null);
        return seen;
    private static class State extends ThreadLocal<Throwable> {

        @Override public String toString() {
            return String.format("FFDC Exception State [lastSeen = '" + get() + "']");
New to GrepCode? Check out our FAQ X