diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/converter/AbstractConverter.java b/proposal/myrmidon/src/java/org/apache/myrmidon/converter/AbstractConverter.java index 595e84758..a2c7b2b0c 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/converter/AbstractConverter.java +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/converter/AbstractConverter.java @@ -7,6 +7,8 @@ */ package org.apache.myrmidon.converter; +import org.apache.avalon.excalibur.i18n.ResourceManager; +import org.apache.avalon.excalibur.i18n.Resources; import org.apache.avalon.framework.context.Context; /** @@ -17,6 +19,9 @@ import org.apache.avalon.framework.context.Context; public abstract class AbstractConverter implements Converter { + private static final Resources REZ = + ResourceManager.getPackageResources( AbstractConverter.class ); + private final Class m_source; private final Class m_destination; @@ -46,14 +51,16 @@ public abstract class AbstractConverter { if( m_destination != destination ) { - throw new IllegalArgumentException( "Destination type " + destination.getName() + - " is not equal to " + m_destination ); + final String message = + REZ.getString( "bad-destination.error", destination.getName(), m_destination ); + throw new IllegalArgumentException( message ); } if( !m_source.isInstance( original ) ) { - throw new IllegalArgumentException( "Object '" + original + "' is not an " + - "instance of " + m_source.getName() ); + final String message = + REZ.getString( "bad-instance.error", original, m_source.getName() ); + throw new IllegalArgumentException( message ); } return convert( original, context ); diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/converter/Resources.properties b/proposal/myrmidon/src/java/org/apache/myrmidon/converter/Resources.properties new file mode 100644 index 000000000..d912151b4 --- /dev/null +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/converter/Resources.properties @@ -0,0 +1,2 @@ +bad-destination.error=Destination type ({0}) is not equal to {1}. +bad-instance.error=Object {0} is not an instance of {1}.