diff options
| author | Kim van der Riet <kpvdr@apache.org> | 2007-01-30 16:27:47 +0000 |
|---|---|---|
| committer | Kim van der Riet <kpvdr@apache.org> | 2007-01-30 16:27:47 +0000 |
| commit | 03ef7ca30485d905efa6e015705c1d3d63d4fdce (patch) | |
| tree | 8f7079edb345cb4f6457d3258efc3e340f173c88 /qpid | |
| parent | e0f8d9edb4f3e4473c13b9bf34d81cd065051768 (diff) | |
| download | qpid-python-03ef7ca30485d905efa6e015705c1d3d63d4fdce.tar.gz | |
Fixed codegen bug in which fields added by second XML file duplicate ordinal values.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@501448 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid')
3 files changed, 4 insertions, 5 deletions
diff --git a/qpid/gentools/src/org/apache/qpid/gentools/AmqpClass.java b/qpid/gentools/src/org/apache/qpid/gentools/AmqpClass.java index 190070ad45..51aee593eb 100644 --- a/qpid/gentools/src/org/apache/qpid/gentools/AmqpClass.java +++ b/qpid/gentools/src/org/apache/qpid/gentools/AmqpClass.java @@ -59,7 +59,7 @@ public class AmqpClass implements Printable, NodeAware indexMap.put(index, indexVersionSet); } NodeList nList = classNode.getChildNodes(); - int fieldCntr = 0; + int fieldCntr = fieldMap.size(); for (int i=0; i<nList.getLength(); i++) { Node child = nList.item(i); @@ -82,7 +82,6 @@ public class AmqpClass implements Printable, NodeAware thisField.removeVersion(version); fieldMap.remove(fieldName); } - fieldCntr++; } else if (child.getNodeName().compareTo(Utils.ELEMENT_METHOD) == 0) { @@ -94,7 +93,7 @@ public class AmqpClass implements Printable, NodeAware thisMethod = new AmqpMethod(methodName, converter); methodMap.put(methodName, thisMethod); } - if (!thisMethod.addFromNode(child, fieldCntr++, version)) + if (!thisMethod.addFromNode(child, fieldCntr, version)) { String className = converter.prepareClassName(Utils.getNamedAttribute(classNode, Utils.ATTRIBUTE_NAME)); diff --git a/qpid/gentools/src/org/apache/qpid/gentools/AmqpMethod.java b/qpid/gentools/src/org/apache/qpid/gentools/AmqpMethod.java index 01db9c9356..ce963465de 100644 --- a/qpid/gentools/src/org/apache/qpid/gentools/AmqpMethod.java +++ b/qpid/gentools/src/org/apache/qpid/gentools/AmqpMethod.java @@ -63,7 +63,7 @@ public class AmqpMethod implements Printable, NodeAware, VersionConsistencyCheck indexMap.put(index, indexVersionSet); } NodeList nList = methodNode.getChildNodes(); - int fieldCntr = 0; + int fieldCntr = fieldMap.size(); for (int i=0; i<nList.getLength(); i++) { Node child = nList.item(i); diff --git a/qpid/gentools/src/org/apache/qpid/gentools/Main.java b/qpid/gentools/src/org/apache/qpid/gentools/Main.java index f1728ab290..e8c8a80a26 100644 --- a/qpid/gentools/src/org/apache/qpid/gentools/Main.java +++ b/qpid/gentools/src/org/apache/qpid/gentools/Main.java @@ -240,7 +240,7 @@ public class Main new File(tmplDir + Utils.fileSeparator + "AMQP_Constants.h.tmpl"), new File(tmplDir + Utils.fileSeparator + "AMQP_MethodVersionMap.h.tmpl"), new File(tmplDir + Utils.fileSeparator + "AMQP_MethodVersionMap.cpp.tmpl"), - new File(tmplDir + Utils.fileSeparator + "AMQP_HighestVersion.h.tmpl") + new File(tmplDir + Utils.fileSeparator + "AMQP_HighestVersion.h.tmpl") }; methodTemplateFiles = new File[] { |
