You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2009/02/20 03:05:08 UTC

svn commit: r746106 - /activemq/activemq-protobuf/trunk/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/AltJavaGenerator.java

Author: chirino
Date: Fri Feb 20 02:05:08 2009
New Revision: 746106

URL: http://svn.apache.org/viewvc?rev=746106&view=rev
Log:
Fixing externizable encoding

Modified:
    activemq/activemq-protobuf/trunk/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/AltJavaGenerator.java

Modified: activemq/activemq-protobuf/trunk/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/AltJavaGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-protobuf/trunk/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/AltJavaGenerator.java?rev=746106&r1=746105&r2=746106&view=diff
==============================================================================
--- activemq/activemq-protobuf/trunk/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/AltJavaGenerator.java (original)
+++ activemq/activemq-protobuf/trunk/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/AltJavaGenerator.java Fri Feb 20 02:05:08 2009
@@ -22,13 +22,10 @@
 import static org.apache.activemq.protobuf.WireFormat.WIRETYPE_VARINT;
 import static org.apache.activemq.protobuf.WireFormat.makeTag;
 
-import java.io.DataInput;
-import java.io.DataOutput;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
-import java.io.IOException;
 import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.HashSet;
@@ -1449,7 +1446,7 @@
             if( repeated ) {
                 p("if( bean.f_"+lname+"!=null ) {");
                 indent();
-                p("out.writeInt(bean.f_"+lname+".size());");
+                p("out.writeShort(bean.f_"+lname+".size());");
                 p("for(" + javaCollectionType(field) + " o : bean.f_"+lname+") {");
                 indent();
                 
@@ -1475,9 +1472,10 @@
                 }
                 unindent();
                 p("}");
+                unindent();
                 p("} else {");
                 indent();
-                p("out.writeInt(-1);");
+                p("out.writeShort(-1);");
                 unindent();
                 p("}");