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

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 UTC