2006/unicorn/src/org/w3c/unicorn/response/parser DefaultParser.java,1.8,1.9

Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/response/parser
In directory hutz:/tmp/cvs-serv16822/src/org/w3c/unicorn/response/parser

Modified Files:
	DefaultParser.java 
Log Message:
trims contexts and messages

Index: DefaultParser.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/response/parser/DefaultParser.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- DefaultParser.java	18 Sep 2009 17:14:52 -0000	1.8
+++ DefaultParser.java	28 Sep 2009 15:09:43 -0000	1.9
@@ -162,7 +162,8 @@
 			// just don't set the column. Or set it to 0?
 		}
 		try {
-			y.setContext(x.getContext());
+			if (x.getContext() != null)
+				y.setContext(x.getContext().trim());
 		} catch(XmlValueOutOfRangeException e) {
 			// just don't set the context. Or set it to 0?
 		}
@@ -208,7 +209,8 @@
 			// just don't set the column. Or set it to 0?
 		}
 		try {
-			y.setContext(x.getContext());
+			if (x.getContext() != null)
+				y.setContext(x.getContext().trim());
 		} catch(XmlValueOutOfRangeException e) {
 			// just don't set the context. Or set it to 0?
 		}
@@ -245,7 +247,8 @@
 		Info y = new Info();
 		y.setLine(x.getLine());
 		y.setColumn(x.getColumn());
-		y.setContext(x.getContext());
+		if (x.getContext() != null)
+			y.setContext(x.getContext().trim());
 		y.setMessage(swapListMessage(x.getMessageList(), lang));
 		y.setLongmessage(swapListLongmessage(x.getLongmessageList(), lang));
 		return y;
@@ -264,7 +267,7 @@
 	private List<LocalizedString> swapListMessage(List<String> x, String lang) {
 		List<LocalizedString> y = new ArrayList<LocalizedString>();
 		for (Object ox : x) {
-			String cox = (String) ox;
+			String cox = ((String) ox).trim();
 			LocalizedString coy = new LocalizedString(cox, lang);
 			y.add(coy);
 		}

Received on Monday, 28 September 2009 15:09:53 UTC