donaldp 2002/11/12 17:07:11
Modified: src/java/org/apache/avalon/framework/configuration
AbstractConfiguration.java
Log:
extract strings
Revision Changes Path
1.22 +49 -33
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.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- AbstractConfiguration.java 7 Nov 2002 08:35:27 -0000 1.21
+++ AbstractConfiguration.java 13 Nov 2002 01:07:11 -0000 1.22
@@ -112,9 +112,11 @@
}
catch( final Exception nfe )
{
- throw new ConfigurationException( "Cannot parse the value \"" + value +
- "\" as an integer in the
configuration element \"" +
- getName() + "\" at " + getLocation()
);
+ final String message =
+ "Cannot parse the value \"" + value +
+ "\" as an integer in the configuration element \"" +
+ getName() + "\" at " + getLocation();
+ throw new ConfigurationException( message );
}
}
@@ -173,9 +175,11 @@
}
catch( final Exception nfe )
{
- throw new ConfigurationException( "Cannot parse the value \"" + value +
- "\" as a long in the configuration
element \"" +
- getName() + "\" at " + getLocation()
);
+ final String message =
+ "Cannot parse the value \"" + value +
+ "\" as a long in the configuration element \"" +
+ getName() + "\" at " + getLocation();
+ throw new ConfigurationException( message );
}
}
@@ -216,9 +220,11 @@
}
catch( final Exception nfe )
{
- throw new ConfigurationException( "Cannot parse the value \"" + value +
- "\" as a float in the configuration
element \"" +
- getName() + "\" at " + getLocation()
);
+ final String message =
+ "Cannot parse the value \"" + value +
+ "\" as a float in the configuration element \"" +
+ getName() + "\" at " + getLocation();
+ throw new ConfigurationException( message );
}
}
@@ -261,9 +267,11 @@
}
else
{
- throw new ConfigurationException( "Cannot parse the value \"" + value +
- "\" as a boolean in the configuration
element \"" +
- getName() + "\" at " + getLocation()
);
+ final String message =
+ "Cannot parse the value \"" + value +
+ "\" as a boolean in the configuration element \"" +
+ getName() + "\" at " + getLocation();
+ throw new ConfigurationException( message );
}
}
@@ -339,9 +347,11 @@
}
catch( final Exception nfe )
{
- throw new ConfigurationException( "Cannot parse the value \"" + value +
- "\" as an integer in the attribute
\"" +
- name + "\" at " + getLocation() );
+ final String message =
+ "Cannot parse the value \"" + value +
+ "\" as an integer in the attribute \"" +
+ name + "\" at " + getLocation();
+ throw new ConfigurationException( message );
}
}
@@ -405,9 +415,11 @@
}
catch( final Exception nfe )
{
- throw new ConfigurationException( "Cannot parse the value \"" + value +
- "\" as a long in the attribute \"" +
- name + "\" at " + getLocation() );
+ final String message =
+ "Cannot parse the value \"" + value +
+ "\" as a long in the attribute \"" +
+ name + "\" at " + getLocation();
+ throw new ConfigurationException( message );
}
}
@@ -452,9 +464,11 @@
}
catch( final Exception e )
{
- throw new ConfigurationException( "Cannot parse the value \"" + value +
- "\" as a float in the attribute \"" +
- name + "\" at " + getLocation() );
+ final String message =
+ "Cannot parse the value \"" + value +
+ "\" as a float in the attribute \"" +
+ name + "\" at " + getLocation();
+ throw new ConfigurationException( message );
}
}
@@ -501,26 +515,28 @@
}
else
{
- throw new ConfigurationException( "Cannot parse the value \"" + value +
- "\" as a boolean in the attribute \""
+
- name + "\" at " + getLocation() );
+ final String message =
+ "Cannot parse the value \"" + value +
+ "\" as a boolean in the attribute \"" +
+ name + "\" at " + getLocation();
+ throw new ConfigurationException( message );
}
}
private boolean isTrue( final String value )
{
- return value.equalsIgnoreCase( "true" )
- || value.equalsIgnoreCase( "yes" )
- || value.equalsIgnoreCase( "on" )
- || value.equalsIgnoreCase( "1" );
+ return value.equalsIgnoreCase( "true" ) ||
+ value.equalsIgnoreCase( "yes" ) ||
+ value.equalsIgnoreCase( "on" ) ||
+ value.equalsIgnoreCase( "1" );
}
private boolean isFalse( final String value )
{
- return value.equalsIgnoreCase( "false" )
- || value.equalsIgnoreCase( "no" )
- || value.equalsIgnoreCase( "off" )
- || value.equalsIgnoreCase( "0" );
+ return value.equalsIgnoreCase( "false" ) ||
+ value.equalsIgnoreCase( "no" ) ||
+ value.equalsIgnoreCase( "off" ) ||
+ value.equalsIgnoreCase( "0" );
}
/**
--
To unsubscribe, e-mail: <mailto:avalon-cvs-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@;jakarta.apache.org>