From: Eric P. <th...@us...> - 2010-11-04 16:53:04
|
Update of /cvsroot/sandev/sand/platform/tools/build/generate/org/sandev/generator In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv15800 Modified Files: XMLSerializerGenerator.java Log Message: If staticRead fails with the fast XML read, and then fails with XMLStandardReader, then log the original exception also since it provides some indication of the core problem. fastHTMLDecode now throws if it runs out of lookahead space trying to decode an escape sequence of the form "%xx". Index: XMLSerializerGenerator.java =================================================================== RCS file: /cvsroot/sandev/sand/platform/tools/build/generate/org/sandev/generator/XMLSerializerGenerator.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** XMLSerializerGenerator.java 1 Jun 2010 22:17:49 -0000 1.24 --- XMLSerializerGenerator.java 4 Nov 2010 16:52:55 -0000 1.25 *************** *** 296,299 **** --- 296,301 ---- out.println(" info(\"XMLSerializer.staticRead using XMLStandardReader failed: \" + e2);"); out.println(" e2.printStackTrace();"); + out.println(" info(\"XMLSerializer.staticRead original failure: \" + e);"); + out.println(" e.printStackTrace();"); out.println(" throw new IOException(\"Read failure: \" + e);"); out.println(" }"); *************** *** 1546,1550 **** out.println(" * will likely yield a similar performance boost."); out.println(" */"); ! out.println(" public static String htmlDecode(String html) {"); out.println(" //try {"); out.println(" // if(html==null) {"); --- 1548,1554 ---- out.println(" * will likely yield a similar performance boost."); out.println(" */"); ! out.println(" public static String htmlDecode(String html)"); ! out.println(" throws IOException"); ! out.println(" {"); out.println(" //try {"); out.println(" // if(html==null) {"); *************** *** 1565,1568 **** --- 1569,1573 ---- out.println(" */"); out.println(" public static String fastHTMLDecode(String text)"); + out.println(" throws IOException"); out.println(" {"); out.println(" int len=text.length();"); *************** *** 1575,1578 **** --- 1580,1586 ---- out.println(" buf.append(c); }"); out.println(" else { //escaped sequence of the form %xx..."); + out.println(" if((i+2)>=len) {"); + out.println(" throw new IOException(\"Illegal escape encoding \" +"); + out.println(" \"at end of text: \" + text); }"); out.println(" char uc=readUnicodeChar(text.charAt(i+1),"); out.println(" text.charAt(i+2));"); *************** *** 1627,1630 **** --- 1635,1639 ---- out.println(" */"); out.println(" public static void testEncodeDecode(String text)"); + out.println(" throws IOException"); out.println(" {"); out.println(" if(text!=null) {"); *************** *** 1641,1644 **** --- 1650,1654 ---- out.println(" */"); out.println(" public static void dumpEncodeDecode(String text)"); + out.println(" throws IOException"); out.println(" {"); out.println(" System.out.print(text);"); |