Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 22306 invoked from network); 1 Sep 2010 20:07:11 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Sep 2010 20:07:11 -0000 Received: (qmail 47875 invoked by uid 500); 1 Sep 2010 20:07:11 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 47810 invoked by uid 500); 1 Sep 2010 20:07:11 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 47803 invoked by uid 99); 1 Sep 2010 20:07:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Sep 2010 20:07:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Sep 2010 20:07:10 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E23C123888E7; Wed, 1 Sep 2010 20:05:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r991677 - in /activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool: commands/CommandClassGenerator.java marshalers/AmqCSharpMarshallersGenerator.java Date: Wed, 01 Sep 2010 20:05:52 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100901200552.E23C123888E7@eris.apache.org> Author: tabish Date: Wed Sep 1 20:05:52 2010 New Revision: 991677 URL: http://svn.apache.org/viewvc?rev=991677&view=rev Log: Update the NMS Commands and Marshalers generator to produce somewhat cleaner code, removes unneeded using statements. Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandClassGenerator.java activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/marshalers/AmqCSharpMarshallersGenerator.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=991677&r1=991676&r2=991677&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 Wed Sep 1 20:05:52 2010 @@ -197,7 +197,7 @@ public class CommandClassGenerator exten } protected void generateVisitBody( PrintWriter out ) { - out.println(" return visitor.process"+getClassName()+"( this );"); + out.println(" return visitor.process"+getClassName()+"(this);"); } protected void generateToStringBody( PrintWriter out ) { @@ -257,17 +257,22 @@ public class CommandClassGenerator exten } protected void generateHashCodeBody( PrintWriter out ) { - out.println(" int answer = 0;"); - out.println(""); - for( JProperty property : getProperties() ) { - String accessorName = property.getSimpleName(); + if( getProperties().isEmpty() ) { + out.println(" return HashCode(this);"); + } else { + out.println(" int answer = 0;"); + out.println(""); - out.println(" answer = (answer * 37) + HashCode("+accessorName+");"); - } + for( JProperty property : getProperties() ) { + String accessorName = property.getSimpleName(); - out.println(""); - out.println(" return answer;"); + out.println(" answer = (answer * 37) + HashCode("+accessorName+");"); + } + + out.println(""); + out.println(" return answer;"); + } } protected void generateEqualsBody( PrintWriter out ) { Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/marshalers/AmqCSharpMarshallersGenerator.java URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/marshalers/AmqCSharpMarshallersGenerator.java?rev=991677&r1=991676&r2=991677&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/marshalers/AmqCSharpMarshallersGenerator.java (original) +++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/marshalers/AmqCSharpMarshallersGenerator.java Wed Sep 1 20:05:52 2010 @@ -343,14 +343,6 @@ out.println(" */"); out.println(" *"); out.println(" */"); out.println(""); - out.println("using System;"); - out.println("using System.Collections;"); - out.println("using System.IO;"); - out.println(""); - out.println("using Apache.NMS.ActiveMQ.Commands;"); - out.println("using Apache.NMS.ActiveMQ.OpenWire;"); - out.println("using Apache.NMS.ActiveMQ.OpenWire.V" + getOpenwireVersion() + ";"); - out.println(""); out.println("namespace Apache.NMS.ActiveMQ.OpenWire.V" + getOpenwireVersion() + ""); out.println("{"); out.println(" /// ");