W3C home > Mailing lists > Public > www-validator-cvs@w3.org > July 2009

2006/unicorn/org/w3c/unicorn/index IndexGenerator.java,1.9,1.10

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 27 Jul 2009 11:18:10 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1MVODa-0007RG-Hb@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/org/w3c/unicorn/index
In directory hutz:/tmp/cvs-serv28553/org/w3c/unicorn/index

Modified Files:
	IndexGenerator.java 
Log Message:
Refactored some code

Index: IndexGenerator.java
===================================================================
RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/index/IndexGenerator.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- IndexGenerator.java	24 Jul 2009 14:13:16 -0000	1.9
+++ IndexGenerator.java	27 Jul 2009 11:18:08 -0000	1.10
@@ -131,23 +131,15 @@
 		aVelocityContext.put("languages", languages);
 		
 		
-		MergeProperties mergeProps = new MergeProperties();
+		//MergeProperties mergeProps = new MergeProperties();
 		
 		for (File langFile : langFiles) {
 			
 			String langCode = langFile.getName().split("\\.")[1];
 			aVelocityContext.put("lang", langCode);
 		    
-		    Properties props = mergeProps.getMergeProperties(defaultLangFile[0], langFile);
-		    
-		    // Iteration on the properties to add them to the Velocity context
-		    Set<Object> keys = props.keySet();
-		    Iterator<Object> itr = keys.iterator();
-		    String key;
-		    while (itr.hasNext()) {
-				key = itr.next().toString();
-				aVelocityContext.put(key, props.get(key));
-		    }
+		    Properties props = MergeProperties.getMergeProperties(defaultLangFile[0], langFile);
+		    MergeProperties.loadInVelocityContext(props, aVelocityContext);
 			
 		    if (langCode.equals(Property.get("DEFAULT_LANGUAGE"))) {
 		    	writeIndex("index.html");
Received on Monday, 27 July 2009 11:18:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:09 GMT