Return-Path: Delivered-To: apmail-jakarta-avalon-cvs-archive@apache.org Received: (qmail 84953 invoked from network); 1 Nov 2001 09:23:45 -0000 Received: from unknown (HELO osaka.betaversion.org) (192.18.49.133) by daedalus.apache.org with SMTP; 1 Nov 2001 09:23:45 -0000 Received: (qmail 19765 invoked from network); 1 Nov 2001 09:26:08 -0000 Received: from nagoya.betaversion.org (192.18.49.131) by osaka.betaversion.org with SMTP; 1 Nov 2001 09:26:08 -0000 Received: (qmail 2201 invoked by uid 97); 1 Nov 2001 09:23:57 -0000 Delivered-To: qmlist-jakarta-archive-avalon-cvs@jakarta.apache.org Received: (qmail 2153 invoked by uid 97); 1 Nov 2001 09:23:56 -0000 Mailing-List: contact avalon-cvs-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon CVS List" Reply-To: "Avalon Developers List" Delivered-To: mailing list avalon-cvs@jakarta.apache.org Received: (qmail 2142 invoked from network); 1 Nov 2001 09:23:55 -0000 Date: 1 Nov 2001 09:13:56 -0000 Message-ID: <20011101091356.28406.qmail@icarus.apache.org> From: donaldp@apache.org To: jakarta-avalon-cvs@apache.org Subject: cvs commit: jakarta-avalon/src/java/org/apache/avalon/framework/configuration AbstractConfiguration.java DefaultConfiguration.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N donaldp 01/11/01 01:13:56 Modified: src/java/org/apache/avalon/framework/configuration AbstractConfiguration.java DefaultConfiguration.java Log: Here's another patch for Configuration : it adds location information to every ConfigurationException thrown, and also erroneous values for parse failures. This is really usefull for debugging. Submitted By: Sylvain Wallez Revision Changes Path 1.6 +25 -25 jakarta-avalon/src/java/org/apache/avalon/framework/configuration/AbstractConfiguration.java Index: AbstractConfiguration.java =================================================================== RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/configuration/AbstractConfiguration.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- AbstractConfiguration.java 2001/10/02 16:24:55 1.5 +++ AbstractConfiguration.java 2001/11/01 09:13:56 1.6 @@ -15,7 +15,7 @@ * @author Stefano Mazzocchi * @author Peter Donald * @author Pierpaolo Fumagalli - * @version CVS $Revision: 1.5 $ $Date: 2001/10/02 16:24:55 $ + * @version CVS $Revision: 1.6 $ $Date: 2001/11/01 09:13:56 $ */ public abstract class AbstractConfiguration implements Configuration @@ -54,9 +54,9 @@ } catch( final Exception nfe ) { - throw - new ConfigurationException( "Cannot parse the value of the configuration " + - "element \"" + getName() + "\" as an integer" ); + throw new ConfigurationException( "Cannot parse the value \"" + value + + "\" as an integer in the configuration element \"" + + getName() + " at " + getLocation() ); } } @@ -115,9 +115,9 @@ } catch( final Exception nfe ) { - throw new ConfigurationException( "Cannot parse the value of the " + - "configuration element \"" + getName() + - "\" as a long" ); + throw new ConfigurationException( "Cannot parse the value \"" + value + + "\" as a long in the configuration element \"" + + getName() + " at " + getLocation() ); } } @@ -158,9 +158,9 @@ } catch( final Exception nfe ) { - throw new ConfigurationException( "Cannot parse the value of the " + - "configuration element \"" + getName() + - "\" as a float" ); + throw new ConfigurationException( "Cannot parse the value \"" + value + + "\" as a float in the configuration element \"" + + getName() + " at " + getLocation() ); } } @@ -202,9 +202,9 @@ } else { - throw new ConfigurationException( "Cannot parse the value of the " + - "configuration element \"" + - getName() + "\" as a boolean" ); + throw new ConfigurationException( "Cannot parse the value \"" + value + + "\" as a boolean in the configuration element \"" + + getName() + " at " + getLocation() ); } } @@ -280,9 +280,9 @@ } catch( final Exception nfe ) { - throw new ConfigurationException( "Cannot parse the value of the attribute \"" + - name + "\" of the configuration element \"" + - getName() + "\" as an integer" ); + throw new ConfigurationException( "Cannot parse the value \"" + value + + "\" as an integer in the attribute \"" + + name + " at " + getLocation() ); } } @@ -346,9 +346,9 @@ } catch( final Exception nfe ) { - throw new ConfigurationException( "Cannot parse the value of the attribute \"" + - name + "\" of the configuration element \"" + - getName() + "\" as a long" ); + throw new ConfigurationException( "Cannot parse the value \"" + value + + "\" as a long in the attribute \"" + + name + " at " + getLocation() ); } } @@ -393,9 +393,9 @@ } catch( final Exception e ) { - throw new ConfigurationException( "Cannot parse the value of the attribute \"" + - name + "\" of the configuration element \"" + - getName() + "\" as a float" ); + throw new ConfigurationException( "Cannot parse the value \"" + value + + "\" as a float in the attribute \"" + + name + " at " + getLocation() ); } } @@ -442,9 +442,9 @@ } else { - throw new ConfigurationException( "Cannot parse the value of the attribute \"" + - name + "\" of the configuration element \"" + - getName() + "\" as a boolean" ); + throw new ConfigurationException( "Cannot parse the value \"" + value + + "\" as a boolean in the attribute \"" + + name + " at " + getLocation() ); } } 1.7 +3 -2 jakarta-avalon/src/java/org/apache/avalon/framework/configuration/DefaultConfiguration.java Index: DefaultConfiguration.java =================================================================== RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/configuration/DefaultConfiguration.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- DefaultConfiguration.java 2001/10/02 16:24:55 1.6 +++ DefaultConfiguration.java 2001/11/01 09:13:56 1.7 @@ -89,7 +89,8 @@ else { throw new ConfigurationException( "No value is associated with the "+ - "configuration element \"" + getName() + "\"" ); + "configuration element \"" + getName() + + " at " + getLocation() ); } } @@ -146,7 +147,7 @@ { throw new ConfigurationException( "No attribute named \"" + name + "\" is " + "associated with the configuration element \"" + - getName() + "\"" ); + getName() + " at " + getLocation() ); } } -- To unsubscribe, e-mail: For additional commands, e-mail: