ode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Kearns (JIRA)" <j...@apache.org>
Subject [jira] Created: (ODE-349) OAssign$Literal serialization breaks for large literals
Date Tue, 29 Jul 2008 02:28:31 GMT
OAssign$Literal serialization breaks for large literals
-------------------------------------------------------

                 Key: ODE-349
                 URL: https://issues.apache.org/jira/browse/ODE-349
             Project: ODE
          Issue Type: Bug
          Components: BPEL Compilation/Parsing
            Reporter: Dan Kearns



writeUTF has a 64k limit on string size. Here's a fix against an older branch, but it should
work against trunk as well.

dan@mtop :-)svn diff src/main/java/org/apache/ode/bpel/o/OAssign.java 
Index: src/main/java/org/apache/ode/bpel/o/OAssign.java
===================================================================
--- src/main/java/org/apache/ode/bpel/o/OAssign.java    (revision 429)
+++ src/main/java/org/apache/ode/bpel/o/OAssign.java    (working copy)
@@ -82,13 +82,21 @@
         private void writeObject(java.io.ObjectOutputStream out)
                 throws IOException
         {
-            out.writeUTF(DOMUtils.domToString(xmlLiteral));
+         String x = DOMUtils.domToString(xmlLiteral);
+         int len = x.length();
+         out.writeInt(len);
+         out.writeChars(x);
         }
 
         private void readObject(java.io.ObjectInputStream in)
                 throws IOException
         {
-            String domStr = in.readUTF();
+           int len = in.readInt();
+           StringBuffer sb = new StringBuffer();
+           for(int i=0;i<len;++i) {
+              sb.append(in.readChar());
+           }
+           String domStr = sb.toString();
             try {
                 xmlLiteral = DOMUtils.stringToDOM(domStr).getOwnerDocument();
             } catch (Exception ex) {


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


Mime
View raw message