@@ -0,0 +1,1952 @@
+/*%0A * Copyright (C) 2010 TranceCode Software%0A *%0A * This library is free software; you can redistribute it and/or modify it under%0A * the terms of the GNU Lesser General Public License as published by the Free%0A * Software Foundation; either version 2.1 of the License, or (at your option)%0A * any later version.%0A * %0A * This library is distributed in the hope that it will be useful, but WITHOUT%0A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS%0A * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more%0A * details.%0A * %0A * You should have received a copy of the GNU Lesser General Public License%0A * along with this library; if not, write to the Free Software Foundation, Inc.,%0A * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA %0A */%0Apackage org.trancecode.core;%0A%0Aimport com.google.common.base.Preconditions;%0A%0A/**%0A * Utility methods related to %7B@link Exception%7D.%0A * %0A * @author Herve Quiroz%0A */%0Apublic final class TcExceptions%0A%7B%0A    /**%0A     * Throws the passed exception or error as an unchecked exception.%0A     * %3Cp%3E%0A     * If the passed exception is a checked one, it is wrapped within an%0A     * %7B@link IllegalStateException%7D.%0A     * %0A     * @throws Error%0A     *             if the passed exception is an %7B@link Error%7D.%0A     * @throws RuntimeException%0A     *             if the passed exception is a %7B@link RuntimeException%7D.%0A     * @throws IllegalStateException%0A     *             if the passed exception is a checked one.%0A     */%0A    public static void throwUnchecked(final Throwable throwable)%0A    %7B%0A        Preconditions.checkNotNull(throwable);%0A        if (throwable instanceof RuntimeException)%0A        %7B%0A            throw (RuntimeException) throwable;%0A        %7D%0A        if (throwable instanceof Error)%0A        %7B%0A            throw (Error) throwable;%0A        %7D%0A%0A        throw new IllegalStateException(throwable);%0A    %7D%0A%0A    private TcExceptions()%0A    %7B%0A        // No instantiation%0A    %7D%0A%7D%0A

Add TcExceptions