Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 16309 invoked from network); 3 Feb 2009 09:34:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Feb 2009 09:34:20 -0000 Received: (qmail 20417 invoked by uid 500); 3 Feb 2009 09:34:20 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 20399 invoked by uid 500); 3 Feb 2009 09:34:20 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 20388 invoked by uid 500); 3 Feb 2009 09:34:20 -0000 Delivered-To: apmail-activemq-camel-dev@activemq.apache.org Received: (qmail 20385 invoked by uid 99); 3 Feb 2009 09:34:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2009 01:34:20 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2009 09:34:19 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 54DF3234C48D for ; Tue, 3 Feb 2009 01:33:59 -0800 (PST) Message-ID: <1099833096.1233653639333.JavaMail.jira@brutus> Date: Tue, 3 Feb 2009 01:33:59 -0800 (PST) From: "Guillaume Nodet (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Commented: (CAMEL-1309) StringSource is not serializable In-Reply-To: <2080252757.1233651359357.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/CAMEL-1309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=49098#action_49098 ] Guillaume Nodet commented on CAMEL-1309: ---------------------------------------- Yes, the problem is that there are possible null fields that throw exceptions when serialized. The problem is that writeUTF barfs when given a null string. Here is a patch I was planning to commit asap: {code} public void writeExternal(ObjectOutput out) throws IOException { int b = ((text != null ? 0x01 : 0x00) + (encoding != null ? 0x02 : 0x00) + (getPublicId() != null ? 0x04 : 0x00) + (getSystemId() != null ? 0x08 : 0x00)); out.writeByte(b); if ((b & 0x01) != 0) { out.writeUTF(text); } if ((b & 0x02) != 0) { out.writeUTF(encoding); } if ((b & 0x04) != 0) { out.writeUTF(getPublicId()); } if ((b & 0x08) != 0) { out.writeUTF(getSystemId()); } } public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { int b = in.readByte(); if ((b & 0x01) != 0) { text = in.readUTF(); } if ((b & 0x02) != 0) { encoding = in.readUTF(); } if ((b & 0x04) != 0) { setPublicId(in.readUTF()); } if ((b & 0x08) != 0) { setSystemId(in.readUTF()); } } {code} > StringSource is not serializable > -------------------------------- > > Key: CAMEL-1309 > URL: https://issues.apache.org/activemq/browse/CAMEL-1309 > Project: Apache Camel > Issue Type: Bug > Components: camel-core > Reporter: Guillaume Nodet > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.