This is an automated email from the ASF dual-hosted git repository. dfoulks pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/activemq-nms-openwire-generator.git
commit 2070215d21384fbd4e3092eb6d5cb6969f60501f Author: Timothy A. Bish <[email protected]> AuthorDate: Thu Jan 20 15:58:35 2011 +0000 Updates the generator for some things needed in: https://issues.apache.org/jira/browse/AMQNET-290 --- .../tool/commands/CommandClassGenerator.java | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandClassGenerator.java b/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandClassGenerator.java index 20c4782..ac04e97 100644 --- a/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandClassGenerator.java +++ b/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandClassGenerator.java @@ -221,7 +221,11 @@ public class CommandClassGenerator extends CommandCodeGenerator { 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 extends CommandCodeGenerator { 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("");
