Author: dgolovin
Date: 2010-08-25 14:51:56 -0400 (Wed, 25 Aug 2010)
New Revision: 24445
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java
Log:
https://jira.jboss.org/browse/JBIDE-6722 Code Generation -> Generic Exporter -> NPE
fix for NPE in code generation, I guess it expects some exporter properties to be defined
for each code generation, but they actually don't. I've added check for nulls and
that should fix NPE issues but some logical issues might still be here
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java 2010-08-25
18:31:32 UTC (rev 24444)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java 2010-08-25
18:51:56 UTC (rev 24445)
@@ -321,8 +321,10 @@
Map<String, AttributeDescription> attributesDescrGui =
exportersDescr.get(expName);
// construct new mapping: name -> AttributeDescription
Map<String, AttributeDescription> attributesDescrAnt = new TreeMap<String,
AttributeDescription>();
- for (AttributeDescription ad : attributesDescrGui.values()) {
- attributesDescrAnt.put(ad.name, ad);
+ if(attributesDescrGui!=null) {
+ for (AttributeDescription ad : attributesDescrGui.values()) {
+ attributesDescrAnt.put(ad.name, ad);
+ }
}
//
Element exporter = hibernatetool.addElement(expName);