directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r379345 - /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnParser.java
Date Tue, 21 Feb 2006 05:09:40 GMT
Author: akarasulu
Date: Mon Feb 20 21:09:38 2006
New Revision: 379345

URL: http://svn.apache.org/viewcvs?rev=379345&view=rev
Log:
fix for DIRSERVER-584 which reinitializes the parser after exceptions are encountered

Modified:
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnParser.java

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnParser.java
URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnParser.java?rev=379345&r1=379344&r2=379345&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnParser.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnParser.java
Mon Feb 20 21:09:38 2006
@@ -213,18 +213,41 @@
         {
             String msg = "Parser failure on name:\n\t" + name;
             msg += "\nAntlr exception trace:\n" + ExceptionUtils.getFullStackTrace( e );
-
+            try
+            {
+                init();
+            }
+            catch ( IOException e1 )
+            {
+                log.error( "cannot reinitialize the parser", e1 );
+            }
             throw new LdapInvalidNameException( msg, ResultCodeEnum.INVALIDDNSYNTAX );
         }
         catch ( TokenStreamException e2 )
         {
             String msg = "Parser failure on name:\n\t" + name;
             msg += "\nAntlr exception trace:\n" + ExceptionUtils.getFullStackTrace( e2 );
+            try
+            {
+                init();
+            }
+            catch ( IOException e1 )
+            {
+                log.error( "cannot reinitialize the parser", e1 );
+            }
             throw new LdapInvalidNameException( msg, ResultCodeEnum.INVALIDDNSYNTAX );
         }
         catch ( NestableRuntimeException e )
         {
             Throwable throwable = e.getCause();
+            try
+            {
+                init();
+            }
+            catch ( IOException e1 )
+            {
+                log.error( "cannot reinitialize the parser", e1 );
+            }
             if ( throwable instanceof NamingException )
             {
                 NamingException ne = ( NamingException ) throwable;



Mime
View raw message