- From: Karl Dubost via cvs-syncmail <cvsmail@w3.org>
- Date: Thu, 14 Dec 2006 05:35:13 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/css In directory hutz:/tmp/cvs-serv9379 Modified Files: StyleSheetGeneratorHTML2.java Log Message: fixing the codecontext for errors Index: StyleSheetGeneratorHTML2.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/css/StyleSheetGeneratorHTML2.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- StyleSheetGeneratorHTML2.java 14 Dec 2006 05:10:50 -0000 1.39 +++ StyleSheetGeneratorHTML2.java 14 Dec 2006 05:35:10 -0000 1.40 @@ -181,44 +181,43 @@ public void produceParseException(CssParseException error, StringBuffer ret) { ret.append(' '); + ret.append("\n <td class='codeContext'>"); if (error.getContexts() != null && error.getContexts().size() != 0) { StringBuffer buf = new StringBuffer(); + // Loop on the list of contexts for errors for (Enumeration e = error.getContexts().elements(); e.hasMoreElements();) { Object t = e.nextElement(); - ret.append("\n <td class='codeContext'>"); + // if the list is not null, add a comma if (t != null) { buf.append(t); if (e.hasMoreElements()) buf.append(", "); - } - } - if (buf.length() != 0) { -// ret.append(ac.getMsg().getGeneratorString("context")); -// ret.append(" : <span class='error'>").append(buf); -// ret.append("</span> "); - ret.append(buf); - } - ret.append("</td>"); - ret.append("\n <td class='message'>"); - } + } + } + if (buf.length() != 0) { + ret.append(buf); + } + ret.append("</td>"); + ret.append("\n <td class='message'>"); + } String name = error.getProperty(); if ((name != null) && (getURLProperty(name) != null)) { - ret.append(ac.getMsg().getGeneratorString("property")); - ret.append(" : <a href=\""); - ret.append(getURLProperty("@url-base")); - ret.append(getURLProperty(name)).append("\">"); - ret.append(name).append("</a> "); + ret.append(ac.getMsg().getGeneratorString("property")); + ret.append(" : <a href=\""); + ret.append(getURLProperty("@url-base")); + ret.append(getURLProperty(name)).append("\">"); + ret.append(name).append("</a> "); } if ((error.getException() != null) && (error.getMessage() != null)) { if (error.isParseException()) { - ret.append(queryReplace(error.getMessage())); + ret.append(queryReplace(error.getMessage())); } else { - Exception ex = error.getException(); - if (ex instanceof NumberFormatException) { - ret.append(ac.getMsg().getGeneratorString("invalid-number")); - } else { - ret.append(queryReplace(ex.getMessage())); - } + Exception ex = error.getException(); + if (ex instanceof NumberFormatException) { + ret.append(ac.getMsg().getGeneratorString("invalid-number")); + } else { + ret.append(queryReplace(ex.getMessage())); + } } if (error.getSkippedString() != null) { ret.append("<span class='skippedString'>"); @@ -253,19 +252,21 @@ Exception ex = error[i].getException(); String file = error[i].getSourceFile(); if (!file.equals(oldSourceFile)) { - oldSourceFile = file; - if (open) { - ret.append("\n</table>\n<!--end of individual error section--></div>"); - } - ret.append("\n<div class='errors-section'><h3>URI : " + "<a href=\""); - ret.append(file).append("\">"); - ret.append(file).append("</a></h3><table>"); - open = true; + oldSourceFile = file; + if (open) { + ret.append("\n</table>\n<!--end of individual error section--></div>"); + } + ret.append("\n<div class='errors-section'>\n<h3>URI : " + "<a href=\""); + ret.append(file).append("\">"); + ret.append(file).append("</a></h3>\n<table>"); + open = true; } ret.append("\n<tr class='error'>\n <td class='linenumber'>"); // ret.append(ac.getMsg().getGeneratorString("line")); ret.append(error[i].getLine()); ret.append("</td>"); + + if (ex instanceof FileNotFoundException) { ret.append(ac.getMsg().getGeneratorString("not-found")); ret.append("<span class='notfound'> ");
Received on Thursday, 14 December 2006 05:35:21 UTC