[jbosstools-commits] JBoss Tools SVN: r24446 - branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Aug 25 14:53:28 EDT 2010


Author: dgolovin
Date: 2010-08-25 14:53:28 -0400 (Wed, 25 Aug 2010)
New Revision: 24446

Modified:
   branches/jbosstools-3.2.0.M2/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: branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java
===================================================================
--- branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java	2010-08-25 18:51:56 UTC (rev 24445)
+++ branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java	2010-08-25 18:53:28 UTC (rev 24446)
@@ -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);



More information about the jbosstools-commits mailing list