Fixed potential race condition in Html.validate().
authorFredrik Tolf <fredrik@dolda2000.com>
Mon, 14 Dec 2009 02:55:40 +0000 (03:55 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Mon, 14 Dec 2009 02:55:40 +0000 (03:55 +0100)
src/dolda/jsvc/next/Html.java

index 4c5b417..978cad2 100644 (file)
@@ -45,7 +45,10 @@ public class Html extends DocBuffer {
     }
     
     public void validate() {
-       Validator val = schema.newValidator();
+       Validator val;
+       synchronized(schema) {
+           val = schema.newValidator();
+       }
        try {
            val.validate(new javax.xml.transform.dom.DOMSource(doc));
        } catch(org.xml.sax.SAXException e) {