incubator-odf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From devin...@apache.org
Subject svn commit: r1172463 - /incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFValidator.java
Date Mon, 19 Sep 2011 05:40:12 GMT
Author: devinhan
Date: Mon Sep 19 05:40:12 2011
New Revision: 1172463

URL: http://svn.apache.org/viewvc?rev=1172463&view=rev
Log:
changeset:   32:a7f1e41db40e
user:        michael.brauer
date:        Fri Mar 25 10:40:41 2011 +0100
- bug fix: MSV validator instances overlook some errors if used multiple times.

Modified:
    incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFValidator.java

Modified: incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFValidator.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFValidator.java?rev=1172463&r1=1172462&r2=1172463&view=diff
==============================================================================
--- incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFValidator.java (original)
+++ incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFValidator.java Mon Sep
19 05:40:12 2011
@@ -59,7 +59,7 @@ public class ODFValidator implements ODF
     protected boolean m_bUseMathDTD = false;
 
     // Validatore and configuration cache
-    private HashMap<String,Validator> m_aValidatorMap = null;
+    private HashMap<String,Schema> m_aSchemaMap = null;
     private HashMap<OdfVersion,Configuration> m_aConfigurationMap = null;
 
     // Generator from last validateFile or validateStream call
@@ -222,7 +222,7 @@ public class ODFValidator implements ODF
     {
         m_aRNGSchemaFactory = null;
         m_aXSDSchemaFactory = null;
-        m_aValidatorMap = null;
+        m_aSchemaMap = null;
     }
 
     private String getSchemaFileName( String aConfigName, OdfVersion aVersion) throws ODFValidatorException
@@ -278,20 +278,20 @@ public class ODFValidator implements ODF
     
     private Validator getValidatorForSchema( PrintStream aOut, String aSchemaFileName ) throws
ODFValidatorException
     {
-        if( m_aValidatorMap == null )
-            m_aValidatorMap = new HashMap<String,Validator>();
+        if( m_aSchemaMap == null )
+            m_aSchemaMap = new HashMap<String,Schema>();
 
-        Validator aValidator = m_aValidatorMap.get(aSchemaFileName);
-        if( aValidator == null )
+        Schema aSchema = m_aSchemaMap.get(aSchemaFileName);
+        if( aSchema == null )
         {
-            aValidator = createValidator( aOut, aSchemaFileName );
-            m_aValidatorMap.put( aSchemaFileName, aValidator);
+            aSchema = createSchema( aOut, aSchemaFileName );
+            m_aSchemaMap.put( aSchemaFileName, aSchema);
         }
 
-        return aValidator;
+        return aSchema.newValidator();
     }
     
-    private Validator createValidator(PrintStream aOut, String aSchemaFileName ) throws ODFValidatorException

+    private Schema createSchema(PrintStream aOut, String aSchemaFileName ) throws ODFValidatorException
     {
         Logger aLogger = new Logger(aSchemaFileName, "", aOut, m_nLogLevel);
         
@@ -347,7 +347,7 @@ public class ODFValidator implements ODF
         }
 
         aLogger.logInfo( "parsed." , false);
-        return aSchema.newValidator();
+        return aSchema;
     }
 
     private SchemaFactory getSchemaFactory( String aSchemaLanguage ) throws ODFValidatorException



Mime
View raw message