You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ha...@apache.org on 2011/01/30 06:04:00 UTC

svn commit: r1065186 - /camel/trunk/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java

Author: hadrian
Date: Sun Jan 30 05:04:00 2011
New Revision: 1065186

URL: http://svn.apache.org/viewvc?rev=1065186&view=rev
Log:
CAMEL-3508. Improve way of expressing improved message

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java?rev=1065186&r1=1065185&r2=1065186&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java Sun Jan 30 05:04:00 2011
@@ -84,15 +84,12 @@ public class DataFormatDefinition extend
     public DataFormat getDataFormat(RouteContext routeContext) {
         if (dataFormat == null) {
             dataFormat = createDataFormat(routeContext);
-            if (dataFormat == null) {
-                if (dataFormatName != null) {
-                    throw new IllegalArgumentException("Data format '" + dataFormatName + "' could not be created."
-                        + "Ensure that the dataformat is valid and the associated Camel component is present on the classpath");
-                } else {
-                    throw new IllegalArgumentException("Data format could not be created. Ensure that the dataformat is valid and the associated Camel component is present on the classpath");
-                }
-            } else {
+            if (dataFormat != null) {
                 configureDataFormat(dataFormat);
+            } else {
+                throw new IllegalArgumentException(
+                    "Data format '" + (dataFormatName != null ? dataFormatName : "<null>") + "' could not be created. "
+                    + "Ensure that the dataformat is valid and the associated Camel component is present on the classpath");
             }
         }
         return dataFormat;