From: <bob...@us...> - 2009-07-08 05:53:17
|
Revision: 12946 http://andromda.svn.sourceforge.net/andromda/?rev=12946&view=rev Author: bobfields Date: 2009-07-08 05:04:37 +0000 (Wed, 08 Jul 2009) Log Message: ----------- JDK 1.5 compliance - replace String.isEmpty with StringUtils.isBlank Modified Paths: -------------- trunk/andromda/src/java/org/andromda/core/common/ComponentContainer.java trunk/andromda/src/java/org/andromda/core/common/Introspector.java trunk/translation-libraries/ocl/andromda-validation/src/java/org/andromda/translation/ocl/validation/OCLIntrospector.java Modified: trunk/andromda/src/java/org/andromda/core/common/ComponentContainer.java =================================================================== --- trunk/andromda/src/java/org/andromda/core/common/ComponentContainer.java 2009-07-07 21:27:49 UTC (rev 12945) +++ trunk/andromda/src/java/org/andromda/core/common/ComponentContainer.java 2009-07-08 05:04:37 UTC (rev 12946) @@ -5,6 +5,7 @@ import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; +import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.apache.commons.lang.StringUtils; @@ -98,14 +99,13 @@ final Class type) { Object component; - implementation = StringUtils.trimToEmpty(implementation); - if (implementation.isEmpty()) + if (StringUtils.isBlank(implementation)) { component = this.newDefaultComponent(type); } else { - component = ClassUtils.newInstance(implementation); + component = ClassUtils.newInstance(StringUtils.trimToEmpty(implementation)); } return component; } Modified: trunk/andromda/src/java/org/andromda/core/common/Introspector.java =================================================================== --- trunk/andromda/src/java/org/andromda/core/common/Introspector.java 2009-07-07 21:27:49 UTC (rev 12945) +++ trunk/andromda/src/java/org/andromda/core/common/Introspector.java 2009-07-08 05:04:37 UTC (rev 12946) @@ -143,7 +143,7 @@ String name, final Object value) { - if (object != null && name != null && !name.isEmpty()) + if (object != null && StringUtils.isNotBlank(name)) { final int dotIndex = name.indexOf(NESTED_DELIMITER); if (dotIndex >= name.length()) @@ -224,7 +224,7 @@ final String name) { Object property = null; - if (object != null && name != null && !name.isEmpty()) + if (object != null && StringUtils.isNotBlank(name)) { int dotIndex = name.indexOf(NESTED_DELIMITER); if (dotIndex == -1) Modified: trunk/translation-libraries/ocl/andromda-validation/src/java/org/andromda/translation/ocl/validation/OCLIntrospector.java =================================================================== --- trunk/translation-libraries/ocl/andromda-validation/src/java/org/andromda/translation/ocl/validation/OCLIntrospector.java 2009-07-07 21:27:49 UTC (rev 12945) +++ trunk/translation-libraries/ocl/andromda-validation/src/java/org/andromda/translation/ocl/validation/OCLIntrospector.java 2009-07-08 05:04:37 UTC (rev 12946) @@ -21,6 +21,9 @@ /** * Invokes the given <code>feature</code> on the <code>element</code>. Its expected that the feature is either an * operation or a property. + * @param element + * @param feature + * @return invoke(element, feature, null) */ public static final Object invoke( final Object element, @@ -45,7 +48,7 @@ } catch (final OCLIntrospectorException throwable) { - // Dont catch our own exceptions. + // Don't catch our own exceptions. // Otherwise get Exception/Cause chain which // can hide the original exception. throw throwable; @@ -68,6 +71,10 @@ /** * Invokes the given <code>feature</code> on the specified <code>element</code> taking the given * <code>arguments</code>. If <code>arguments</code> is null its expected that the feature is an empty operation. + * @param element + * @param feature + * @param arguments + * @return invokeMethod(element, feature, arguments) */ public static Object invoke( final Object element, @@ -116,7 +123,7 @@ { Object property = null; - if (element != null && methodName != null && !methodName.isEmpty()) + if (element != null && StringUtils.isNotBlank(methodName)) { Class[] argumentTypes = getObjectTypes(arguments); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |