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 2ede2c6cfc48560145b17016107ee4263452a5fe Author: Timothy A. Bish <[email protected]> AuthorDate: Mon Apr 5 15:47:48 2010 +0000 https://issues.apache.org/activemq/browse/AMQNET-246 Fix the generated code to use correct interfaces. --- pom.xml | 2 +- .../nms/openwire/tool/commands/CommandCodeGenerator.java | 6 ++++++ .../activemq/nms/openwire/tool/commands/CommandGenerator.java | 9 +++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5669d39..ce3636c 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ </mailingLists> <properties> - <activemq-version>5.3.0</activemq-version> + <activemq-version>5.3.1</activemq-version> <projectName>Apache NMS.ActiveMQ</projectName> <annogen-version>0.1.0</annogen-version> <ant-version>1.6.2</ant-version> diff --git a/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandCodeGenerator.java b/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandCodeGenerator.java index 7faaf0e..106c11f 100644 --- a/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandCodeGenerator.java +++ b/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandCodeGenerator.java @@ -145,6 +145,12 @@ public abstract class CommandCodeGenerator { else if( name.equals("ByteSequence") ) { return "byte[]"; } + else if( name.equals("Comparable") ) { + return null; + } + else if( name.equals("MarshallAware") ) { + return null; + } else if( name.equals("boolean") ) { return "bool"; } diff --git a/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandGenerator.java b/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandGenerator.java index be47189..a58015d 100644 --- a/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandGenerator.java +++ b/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandGenerator.java @@ -86,6 +86,15 @@ public class CommandGenerator extends MultiSourceGenerator { generator.setOpenWireOpCode( getOpenWireOpCode(getJclass()) ); generator.setComparable( className.endsWith("Id") || generator.isComparable() ); + for (int i = 0; i < getJclass().getInterfaces().length; i++) { + JClass intf = getJclass().getInterfaces()[i]; + + String name = generator.toCSharpType( intf ); + if( name != null && !name.endsWith("DataStructure") && !name.equals("Command") ) { + generator.addAdditionalBase( name ); + } + } + PrintWriter out = null; try { out = new PrintWriter(new FileWriter(headerFile));
