directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1027927 - /directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/CursorStudioNamingEnumeration.java
Date Wed, 27 Oct 2010 11:55:49 GMT
Author: pamarcelot
Date: Wed Oct 27 11:55:49 2010
New Revision: 1027927

URL: http://svn.apache.org/viewvc?rev=1027927&view=rev
Log:
Better handling of the IOException.

Modified:
    directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/CursorStudioNamingEnumeration.java

Modified: directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/CursorStudioNamingEnumeration.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/CursorStudioNamingEnumeration.java?rev=1027927&r1=1027926&r2=1027927&view=diff
==============================================================================
--- directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/CursorStudioNamingEnumeration.java
(original)
+++ directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/CursorStudioNamingEnumeration.java
Wed Oct 27 11:55:49 2010
@@ -35,7 +35,6 @@ import javax.naming.ldap.Control;
 import javax.naming.ldap.PagedResultsResponseControl;
 
 import org.apache.directory.ldap.client.api.SearchCursor;
-import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsControl;
 import org.apache.directory.shared.ldap.cursor.Cursor;
 import org.apache.directory.shared.ldap.message.Referral;
 import org.apache.directory.shared.ldap.message.Response;
@@ -367,29 +366,30 @@ public class CursorStudioNamingEnumerati
 
             for ( org.apache.directory.shared.ldap.message.control.Control control : controls
)
             {
+                Control convertedControl = null;
+
                 if ( PagedResultsResponseControl.OID.equals( control.getOid() ) )
                 {
                     // Special case for the PagedResultsResponseControl
                     try
                     {
-                        PagedResultsResponseControl convertedControl = new PagedResultsResponseControl(
-                            control.getOid(),
-                            control.isCritical(), control.getValue() );
-                        convertedControls.add( convertedControl );
+                        convertedControl = new PagedResultsResponseControl( control.getOid(),
control.isCritical(),
+                            control.getValue() );
                     }
                     catch ( IOException e )
                     {
-                        // TODO Auto-generated catch block
-                        e.printStackTrace();
+                        convertedControl = new BasicControl( control.getOid(), control.isCritical(),
+                            control.getValue() );
                     }
                 }
                 else
                 {
                     // Default case
-                    Control convertedControl = new BasicControl( control.getOid(), control.isCritical(),
+                    convertedControl = new BasicControl( control.getOid(), control.isCritical(),
                         control.getValue() );
-                    convertedControls.add( convertedControl );
                 }
+
+                convertedControls.add( convertedControl );
             }
 
             return convertedControls.toArray( new Control[0] );



Mime
View raw message