You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2009/01/06 07:41:06 UTC

svn commit: r731846 - /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/StringSource.java

Author: davsclaus
Date: Mon Jan  5 22:41:06 2009
New Revision: 731846

URL: http://svn.apache.org/viewvc?rev=731846&view=rev
Log:
Polished code so its immutable (no setters)

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/StringSource.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/StringSource.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/StringSource.java?rev=731846&r1=731845&r2=731846&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/StringSource.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/StringSource.java Mon Jan  5 22:41:06 2009
@@ -54,9 +54,9 @@
     }
 
     public StringSource(String text, String systemId, String encoding) {
-        this.text = text;
+        this(text, systemId);
+        ObjectHelper.notNull(encoding, "encoding");
         this.encoding = encoding;
-        setSystemId(systemId);
     }
 
     public InputStream getInputStream() {
@@ -83,14 +83,6 @@
         return encoding;
     }
 
-    public void setEncoding(String encoding) {
-        this.encoding = encoding;
-    }
-
-    public void setText(String text) {
-        this.text = text;
-    }
-
     public void writeExternal(ObjectOutput out) throws IOException {
         out.writeUTF(text);
         out.writeUTF(encoding);