Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 49016 invoked from network); 26 Sep 2005 22:48:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Sep 2005 22:48:04 -0000 Received: (qmail 73435 invoked by uid 500); 26 Sep 2005 22:48:03 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 73313 invoked by uid 500); 26 Sep 2005 22:48:03 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 73231 invoked by uid 99); 26 Sep 2005 22:48:02 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 26 Sep 2005 15:48:02 -0700 Received: (qmail 48829 invoked by uid 65534); 26 Sep 2005 22:47:42 -0000 Message-ID: <20050926224742.48828.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r291774 - /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/location/LocatedException.java Date: Mon, 26 Sep 2005 22:47:41 -0000 To: cvs@cocoon.apache.org From: vgritsenko@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: vgritsenko Date: Mon Sep 26 15:47:38 2005 New Revision: 291774 URL: http://svn.apache.org/viewcvs?rev=291774&view=rev Log: whitespace Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/location/LocatedException.java Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/location/LocatedException.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/location/LocatedException.java?rev=291774&r1=291773&r2=291774&view=diff ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/location/LocatedException.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/location/LocatedException.java Mon Sep 26 15:47:38 2005 @@ -1,12 +1,12 @@ /* * Copyright 2005 The Apache Software Foundation. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,37 +23,37 @@ import org.apache.commons.lang.exception.ExceptionUtils; import org.apache.commons.lang.exception.NestableException; - /** * A cascading and located Exception. It is also {@link MultiLocatable} to easily build * stack traces. - * + * * @since 2.1.8 * @version $Id$ */ -public class LocatedException extends NestableException implements LocatableException, MultiLocatable { +public class LocatedException extends NestableException + implements LocatableException, MultiLocatable { private List locations; public LocatedException(String message) { this(message, null, null); } - + public LocatedException(String message, Throwable cause) { this(message, cause, null); } - + public LocatedException(String message, Location location) { this(message, null, location); } - + public LocatedException(String message, Throwable cause, Location location) { super(message, cause); ensureCauseChainIsSet(cause); addCauseLocations(this, cause); addLocation(location); } - + private static Method INIT_CAUSE_METHOD = null; static { try { @@ -62,7 +62,7 @@ // JDK < 1.4: ignore } } - + /** * Crawl the cause chain and ensure causes are properly set using "initCause" on JDK >= 1.4. * This is needed because some exceptions (e.g. SAXException) don't have a getCause() that is @@ -71,21 +71,21 @@ public static void ensureCauseChainIsSet(Throwable thr) { if (INIT_CAUSE_METHOD == null) return; - + // Loop either until null or encountering exceptions that use this method. - while(thr != null && !(thr instanceof LocatedRuntimeException) && !(thr instanceof LocatedException)) { + while (thr != null && !(thr instanceof LocatedRuntimeException) && !(thr instanceof LocatedException)) { Throwable parent = ExceptionUtils.getCause(thr); if (parent != null) { try { INIT_CAUSE_METHOD.invoke(thr, new Object[]{ parent }); - } catch(Exception e) { + } catch (Exception e) { // can happen if parent already set on exception } } thr = parent; } } - + /** * Add to the location stack all locations of an exception chain. This allows to have all possible * location information in the stacktrace, as some exceptions like SAXParseException don't output @@ -96,7 +96,7 @@ *

* This method is static as a convenience for {@link LocatedRuntimeException other implementations} * of locatable exceptions. - * + * * @param self the current locatable exception * @param cause a cause of self */ @@ -136,10 +136,10 @@ /** * Standard way of building the message of a {@link LocatableException}, as a Java-like * stack trace of locations. - * + * * @param message the exception's message, given by super.getMessage() (can be null) * @param locations the location list (can be null) - * + * * @return the message, or null no message and locations were given. */ public static String getMessage(String message, List locations) { @@ -158,7 +158,7 @@ public String getMessage() { return getMessage(super.getMessage(), locations); } - + public void addLocation(Location loc) { if (LocationUtils.isUnknown(loc)) return;