diff options
| -rw-r--r-- | gentools/src/org/apache/qpid/gentools/CppGenerator.java | 9 | ||||
| -rw-r--r-- | gentools/src/org/apache/qpid/gentools/JavaGenerator.java | 14 |
2 files changed, 17 insertions, 6 deletions
diff --git a/gentools/src/org/apache/qpid/gentools/CppGenerator.java b/gentools/src/org/apache/qpid/gentools/CppGenerator.java index 26a9950d8a..cf97e01877 100644 --- a/gentools/src/org/apache/qpid/gentools/CppGenerator.java +++ b/gentools/src/org/apache/qpid/gentools/CppGenerator.java @@ -176,9 +176,16 @@ public class CppGenerator extends Generator { String domainType = getDomainType(domainName, version); if (domainType == null) + { throw new AmqpTypeMappingException("Domain type \"" + domainName + "\" not found in C++ typemap."); - return typeMap.get(domainType).type; + } + DomainInfo info = typeMap.get(domainType); + if (info == null) + { + throw new AmqpTypeMappingException("Unknown domain: \"" + domainType + "\""); + } + return info.type; } // === Abstract methods from class Generator - C++-specific implementation === diff --git a/gentools/src/org/apache/qpid/gentools/JavaGenerator.java b/gentools/src/org/apache/qpid/gentools/JavaGenerator.java index bd83e85090..c465677bff 100644 --- a/gentools/src/org/apache/qpid/gentools/JavaGenerator.java +++ b/gentools/src/org/apache/qpid/gentools/JavaGenerator.java @@ -355,11 +355,15 @@ public class JavaGenerator extends Generator { String domainType = globalDomainMap.getDomainType(domainName, version); if (domainType == null) - throw new AmqpTypeMappingException("Domain type \"" + domainName + "\" not found in Java typemap."); - DomainInfo info = typeMap.get(domainType); - if (info == null) { - throw new AmqpTypeMappingException("Unknown type: \"" + domainType + "\""); - } + { + throw new AmqpTypeMappingException("Domain type \"" + domainName + + "\" not found in Java typemap."); + } + DomainInfo info = typeMap.get(domainType); + if (info == null) + { + throw new AmqpTypeMappingException("Unknown domain: \"" + domainType + "\""); + } return info.type; } |
