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

2006/unicorn/src/org/w3c/unicorn/output SimpleOutputFormater.java,1.6,1.7

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Thu, 24 Sep 2009 15:29:37 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1MqqGH-0007B3-MT@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/output
In directory hutz:/tmp/cvs-serv27573/src/org/w3c/unicorn/output

Modified Files:
	SimpleOutputFormater.java 
Log Message:
produce errors populates its context with all objects all mapOfString objects and not just the messages

Index: SimpleOutputFormater.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/output/SimpleOutputFormater.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- SimpleOutputFormater.java	23 Sep 2009 09:19:00 -0000	1.6
+++ SimpleOutputFormater.java	24 Sep 2009 15:29:35 -0000	1.7
@@ -6,7 +6,6 @@
 
 import java.io.IOException;
 import java.io.Writer;
-import java.util.ArrayList;
 import java.util.Map;
 
 import org.apache.velocity.VelocityContext;
@@ -62,13 +61,12 @@
 		this.format = outputFormat;
 	}
 	
-	public void produceOutput(final Map<String, Object> mapOfStringObject, final Writer output) {
-
+	public void produceOutput(Map<String, Object> mapOfStringObject, Writer output) {
 		logger.trace("produceOutput");
 		logger.debug("Map of String -> Object : " + mapOfStringObject + ".");
 		logger.debug("Writer : " + output + ".");
 		
-		for (final String sObjectName : mapOfStringObject.keySet())
+		for (String sObjectName : mapOfStringObject.keySet())
 			aVelocityContext.put(sObjectName, mapOfStringObject.get(sObjectName));
 		
 		Templates.write(format + ".vm", aVelocityContext, output);
@@ -79,13 +77,12 @@
 		}
 	}
 
-	public void produceError(Map<String, Object> mapOfStringObject, final Writer output) {
-		
+	public void produceError(Map<String, Object> mapOfStringObject, Writer output) {
 		logger.trace("produceError");
 		logger.debug("Writer : " + output + ".");
 		
-		ArrayList<?> messages = (ArrayList<?>) mapOfStringObject.get("messages");
-		aVelocityContext.put("messages", messages);
+		for (String sObjectName : mapOfStringObject.keySet())
+			aVelocityContext.put(sObjectName, mapOfStringObject.get(sObjectName));
 		
 		Templates.write(format + ".error.vm", aVelocityContext, output);
 		try {
Received on Thursday, 24 September 2009 15:29:50 GMT

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