[jira] Created: (CAMEL-1309) StringSource is not serializable

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (CAMEL-1309) StringSource is not serializable

JIRA jira@apache.org
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.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-1309) StringSource is not serializable

JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-1309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=49097#action_49097 ]

Claus Ibsen commented on CAMEL-1309:
------------------------------------

Guillaumn can you elaborate?

StringSource extends Externalizable that implements Serializable

public class org.apache.camel.converter.jaxp.StringSource extends StreamSource implements Externalizable


In StreamCacheConverter there is a SourceCache that extends StringSource and its missing a no-args constructor.
Could that cause trouble?

{code}
    /*
     * {@link StreamCache} implementation for {@link Source}s
     */
    private class SourceCache extends StringSource implements StreamCache {

        private static final long serialVersionUID = 4147248494104812945L;

        public SourceCache(String text) {
            super(text);
        }

        public void reset() {
            // do nothing here
        }

    }
{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.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-1309) StringSource is not serializable

JIRA jira@apache.org
In reply to this post by JIRA jira@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.

Reply | Threaded
Open this post in threaded view
|

[jira] Assigned: (CAMEL-1309) StringSource is not serializable

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-1309?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-1309:
----------------------------------

    Assignee: Claus Ibsen

> 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
>            Assignee: Claus Ibsen
>             Fix For: 1.5.1, 2.0.0
>
>


--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (CAMEL-1309) StringSource is not serializable

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-1309?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-1309:
-------------------------------

    Fix Version/s: 2.0.0
                   1.5.1

> 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
>            Assignee: Claus Ibsen
>             Fix For: 1.5.1, 2.0.0
>
>


--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-1309) StringSource is not serializable

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-1309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=49102#action_49102 ]

Claus Ibsen commented on CAMEL-1309:
------------------------------------

Trunk: 740295
1.x: 740297

> 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
>            Assignee: Claus Ibsen
>             Fix For: 1.5.1, 2.0.0
>
>


--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (CAMEL-1309) StringSource is not serializable

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-1309?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-1309.
--------------------------------

    Resolution: Fixed

> 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
>            Assignee: Claus Ibsen
>             Fix For: 1.5.1, 2.0.0
>
>


--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.