summaryrefslogtreecommitdiff
path: root/gentools/src/org/apache/qpid/gentools/JavaGenerator.java
diff options
context:
space:
mode:
Diffstat (limited to 'gentools/src/org/apache/qpid/gentools/JavaGenerator.java')
-rw-r--r--gentools/src/org/apache/qpid/gentools/JavaGenerator.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/gentools/src/org/apache/qpid/gentools/JavaGenerator.java b/gentools/src/org/apache/qpid/gentools/JavaGenerator.java
index 4c168cd036..c465677bff 100644
--- a/gentools/src/org/apache/qpid/gentools/JavaGenerator.java
+++ b/gentools/src/org/apache/qpid/gentools/JavaGenerator.java
@@ -355,8 +355,16 @@ 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.");
- return typeMap.get(domainType).type;
+ {
+ 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;
}