donaldp 02/01/27 16:09:13
Modified:
proposal/myrmidon/src/java/org/apache/myrmidon/components/configurer
DefaultObjectConfigurer.java
Log:
Reverse logic so that if duplicated typed adders are present then a different
message is issued
Revision Changes Path
1.7 +12 -13
jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/configurer/DefaultObjectConfigurer.java
Index: DefaultObjectConfigurer.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/configurer/DefaultObjectConfigurer.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DefaultObjectConfigurer.java 27 Jan 2002 23:39:46 -0000 1.6
+++ DefaultObjectConfigurer.java 28 Jan 2002 00:09:13 -0000 1.7
@@ -20,14 +20,13 @@
import org.apache.avalon.excalibur.i18n.ResourceManager;
import org.apache.avalon.excalibur.i18n.Resources;
import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.configuration.Configuration;
/**
* An object configurer which uses reflection to determine the properties
* of a class.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Adam Murdoch</a>
- * @version $Revision: 1.6 $ $Date: 2002/01/27 23:39:46 $
+ * @version $Revision: 1.7 $ $Date: 2002/01/28 00:09:13 $
*/
class DefaultObjectConfigurer
implements ObjectConfigurer
@@ -191,7 +190,17 @@
final Class currentType = candidate.getParameterTypes()[ 0 ];
// Ditch the string version, if any
- if( currentType != String.class && type == String.class )
+ if( isTypedAdder )
+ {
+ // Both are string, or both are not string
+ final String message =
+ REZ.getString(
"multiple-typed-adder-methods-for-element.error",
+ m_class.getName(),
+ type.getName(),
+ currentType.getName() );
+ throw new ConfigurationException( message );
+ }
+ else if( currentType != String.class && type == String.class
)
{
// New type is string, and current type is not. Ignore
// the new method
@@ -204,16 +213,6 @@
REZ.getString(
"multiple-adder-methods-for-element.error",
m_class.getName(),
propName );
- throw new ConfigurationException( message );
- }
- else if( isTypedAdder )
- {
- // Both are string, or both are not string
- final String message =
- REZ.getString(
"multiple-typed-adder-methods-for-element.error",
- m_class.getName(),
- type.getName(),
- currentType.getName() );
throw new ConfigurationException( message );
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>