[jbosstools-commits] JBoss Tools SVN: r43608 - trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Tue Sep 11 19:11:58 EDT 2012


Author: scabanovich
Date: 2012-09-11 19:11:58 -0400 (Tue, 11 Sep 2012)
New Revision: 43608

Modified:
   trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/CDIProjectGenerator.java
Log:
JBIDE-12446
https://issues.jboss.org/browse/JBIDE-12446


Modified: trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/CDIProjectGenerator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/CDIProjectGenerator.java	2012-09-11 19:32:53 UTC (rev 43607)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/CDIProjectGenerator.java	2012-09-11 23:11:58 UTC (rev 43608)
@@ -56,6 +56,7 @@
 	int fieldInjectionsPerClassCount = 20;
 	int initMethodsPerClass = 3;
 	int paramsPerInitMethod = 2;
+	int elInstancesPerClass = 20;
 	
 	public CDIProjectGenerator() {}
 
@@ -223,6 +224,12 @@
 			nameProperty.setReturnType(string);
 			nameProperty.setName("getName");
 			classes[i].addMethod(nameProperty);
+
+			// getSelf();
+			GenMethod selfProperty = new GenMethod();
+			selfProperty.setReturnType(classes[i]);
+			selfProperty.setName("getSelf");
+			classes[i].addMethod(selfProperty);
 			
 			//initializers
 			for (int j = 0; j < initMethodsPerClass; j++) {
@@ -248,12 +255,14 @@
 	
 		//EL
 		for (int i = 0; i < classes.length; i++) {
-			GenField f = new GenField();
-			f.setName("el");
-			f.setType(string);
-			String beanName = beanNames.get(seed.nextInt(beanNames.size()));
-			f.setInitValue("\"#{" + beanName + ".name}\"");
-			classes[i].addField(f);
+			for (int k = 0; k < elInstancesPerClass; k++) {
+				GenField f = new GenField();
+				f.setName("el" + k);
+				f.setType(string);
+				String beanName = beanNames.get(seed.nextInt(beanNames.size()));
+				f.setInitValue("\"#{" + beanName + ".self.self.name}\"");
+				classes[i].addField(f);
+			}
 		}
 	}
 



More information about the jbosstools-commits mailing list