You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2011/01/20 16:58:35 UTC

svn commit: r1061357 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandClassGenerator.java

Author: tabish
Date: Thu Jan 20 15:58:35 2011
New Revision: 1061357

URL: http://svn.apache.org/viewvc?rev=1061357&view=rev
Log:
Updates the generator for some things needed in:
https://issues.apache.org/jira/browse/AMQNET-290

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandClassGenerator.java

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandClassGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandClassGenerator.java?rev=1061357&r1=1061356&r2=1061357&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandClassGenerator.java (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandClassGenerator.java Thu Jan 20 15:58:35 2011
@@ -221,7 +221,11 @@ public class CommandClassGenerator exten
         for( JProperty property : getProperties() ) {
             String name = property.getSimpleName();
 
-            out.print("                \"" + name + " = \" + " + name + " + ");
+            if( property.getType().isArrayType() && toCSharpType(property.getType()).startsWith("byte")) {
+                out.print("                \"" + name + " = \" + System.Text.ASCIIEncoding.ASCII.GetString(" + name + ") + ");
+            } else {
+                out.print("                \"" + name + " = \" + " + name + " + ");
+            }
 
             if( ++count != size ) {
                 out.println("\", \" + ");
@@ -287,10 +291,17 @@ public class CommandClassGenerator exten
             for( JProperty property : getProperties() ) {
                 String accessorName = property.getSimpleName();
 
-                out.println("            if(!Equals(this."+accessorName+", that."+accessorName+"))");
-                out.println("            {");
-                out.println("                return false;");
-                out.println("            }");
+                if( !property.getType().isArrayType() ) {
+                    out.println("            if(!Equals(this."+accessorName+", that."+accessorName+"))");
+                    out.println("            {");
+                    out.println("                return false;");
+                    out.println("            }");
+                } else {
+                    out.println("            if(!ArrayEquals(this."+accessorName+", that."+accessorName+"))");
+                    out.println("            {");
+                    out.println("                return false;");
+                    out.println("            }");
+                }
             }
 
             out.println("");