directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1694439 [1/4] - in /directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui: ./ actions/ dialogs/ dnd/ preferences/ properties/ widgets/ wizards/
Date Thu, 06 Aug 2015 10:03:43 GMT
Author: elecharny
Date: Thu Aug  6 10:03:42 2015
New Revision: 1694439

URL: http://svn.apache.org/r1694439
Log:
Many PMD violations fixed.

Modified:
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/AbstractConnectionParameterPage.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPage.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageManager.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageModifyListener.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUICertificateHandler.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIConstants.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIPlugin.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIReferralHandler.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ExceptionHandler.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/Messages.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/PasswordsKeyStoreManagerUtils.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/RunnableContextRunner.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/UIAuthHandler.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/UiThreadEventRunner.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/ActionHandlerManager.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CloseConnectionAction.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CollapseAllAction.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CopyAction.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/DeleteAction.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/ExpandAllAction.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/Messages.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/NewConnectionAction.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/NewConnectionFolderAction.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/OpenConnectionAction.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PasteAction.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PropertiesAction.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/RenameAction.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/SelectionUtils.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioAction.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioActionProxy.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/CertificateInfoDialog.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/CertificateTrustDialog.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/ConnectionFolderDialog.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/Messages.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/PasswordDialog.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/ResetPasswordDialog.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/SelectReferralConnectionDialog.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/SetupPasswordDialog.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/ConnectionTransfer.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/DragConnectionListener.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/DropConnectionListener.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/preferences/CertificateValidationPreferencePage.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/preferences/ConnectionsPreferencePage.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/preferences/Messages.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/preferences/PasswordsKeystorePreferencePage.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/properties/Messages.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/AuthenticationParameterPage.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/CertificateInfoComposite.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionActionGroup.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionConfiguration.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionContentProvider.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionLabelProvider.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionSorter.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionUniversalListener.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionWidget.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ExtendedContentAssistCommandAdapter.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/Messages.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/NetworkParameterPage.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/wizards/ExportCertificateWizard.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/wizards/ExportCertificateWizardPage.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/wizards/Messages.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/wizards/NewConnectionWizard.java
    directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/wizards/NewConnectionWizardPage.java

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/AbstractConnectionParameterPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/AbstractConnectionParameterPage.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/AbstractConnectionParameterPage.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/AbstractConnectionParameterPage.java Thu Aug  6 10:03:42 2015
@@ -32,7 +32,6 @@ import org.eclipse.swt.widgets.Composite
  */
 public abstract class AbstractConnectionParameterPage implements ConnectionParameterPage
 {
-
     /** The page id. */
     protected String pageId;
 
@@ -65,14 +64,6 @@ public abstract class AbstractConnection
 
 
     /**
-     * Creates a new instance of AbstractConnectionParameterPage.
-     */
-    protected AbstractConnectionParameterPage()
-    {
-    }
-
-
-    /**
      * Sets the connection parameter page modify listener.
      * 
      * @param listener the connection parameter page modify listener
@@ -80,7 +71,6 @@ public abstract class AbstractConnection
     public void setConnectionParameterPageModifyListener( ConnectionParameterPageModifyListener listener )
     {
         this.connectionParameterPageModifyListener = listener;
-
     }
 
 
@@ -212,18 +202,24 @@ public abstract class AbstractConnection
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public final void init( Composite parent, ConnectionParameterPageModifyListener listener,
         ConnectionParameter parameter )
     {
         createComposite( parent );
+        
         if ( listener != null )
         {
             setConnectionParameterPageModifyListener( listener );
         }
+        
         if ( parameter != null )
         {
             loadParameters( parameter );
         }
+        
         initListeners();
         connectionPageModified();
     }
@@ -265,5 +261,4 @@ public abstract class AbstractConnection
      * Initializes the listeners.
      */
     protected abstract void initListeners();
-
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPage.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPage.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPage.java Thu Aug  6 10:03:42 2015
@@ -40,7 +40,7 @@ public interface ConnectionParameterPage
      * 
      * @param parameter the connection parameter
      */
-    public void saveParameters( ConnectionParameter parameter );
+    void saveParameters( ConnectionParameter parameter );
 
 
     /**
@@ -48,7 +48,7 @@ public interface ConnectionParameterPage
      * 
      * @return true, if is valid
      */
-    public boolean isValid();
+    boolean isValid();
 
 
     /**
@@ -58,7 +58,7 @@ public interface ConnectionParameterPage
      * 
      * @return the error message
      */
-    public String getErrorMessage();
+    String getErrorMessage();
 
 
     /**
@@ -68,7 +68,7 @@ public interface ConnectionParameterPage
      * 
      * @return the message
      */
-    public String getMessage();
+    String getMessage();
 
 
     /**
@@ -78,7 +78,7 @@ public interface ConnectionParameterPage
      * 
      * @return the info message
      */
-    public String getInfoMessage();
+    String getInfoMessage();
 
 
     /**
@@ -88,13 +88,13 @@ public interface ConnectionParameterPage
      * @param listener the connection parameter page modify listener
      * @param parameter the initial connection parameter
      */
-    public void init( Composite parent, ConnectionParameterPageModifyListener listener, ConnectionParameter parameter );
+    void init( Composite parent, ConnectionParameterPageModifyListener listener, ConnectionParameter parameter );
 
 
     /**
      * Saves the dialog settings.
      */
-    public void saveDialogSettings();
+    void saveDialogSettings();
 
 
     /**
@@ -102,7 +102,7 @@ public interface ConnectionParameterPage
      * 
      * @param runnableContext the runnable context
      */
-    public void setRunnableContext( IRunnableContext runnableContext );
+    void setRunnableContext( IRunnableContext runnableContext );
 
 
     /**
@@ -110,7 +110,7 @@ public interface ConnectionParameterPage
      * 
      * @param pageId the page id
      */
-    public void setPageId( String pageId );
+    void setPageId( String pageId );
 
 
     /**
@@ -118,7 +118,7 @@ public interface ConnectionParameterPage
      * 
      * @return the page id
      */
-    public String getPageId();
+    String getPageId();
 
 
     /**
@@ -126,7 +126,7 @@ public interface ConnectionParameterPage
      * 
      * @param pageName the page name
      */
-    public void setPageName( String pageName );
+    void setPageName( String pageName );
 
 
     /**
@@ -134,7 +134,7 @@ public interface ConnectionParameterPage
      * 
      * @return the page name
      */
-    public String getPageName();
+    String getPageName();
 
 
     /**
@@ -142,7 +142,7 @@ public interface ConnectionParameterPage
      * 
      * @param pageDescription the page description
      */
-    public void setPageDescription( String pageDescription );
+    void setPageDescription( String pageDescription );
 
 
     /**
@@ -150,7 +150,7 @@ public interface ConnectionParameterPage
      * 
      * @return the page description
      */
-    public String getPageDescription();
+    String getPageDescription();
 
 
     /**
@@ -158,7 +158,7 @@ public interface ConnectionParameterPage
      * 
      * @param pageDependsOnId the page id this page depends on
      */
-    public void setPageDependsOnId( String pageDependsOnId );
+    void setPageDependsOnId( String pageDependsOnId );
 
 
     /**
@@ -166,13 +166,13 @@ public interface ConnectionParameterPage
      * 
      * @return the page id this page depends on
      */
-    public String getPageDependsOnId();
+    String getPageDependsOnId();
 
 
     /**
      * Sets the focus.
      */
-    public void setFocus();
+    void setFocus();
 
 
     /**
@@ -182,7 +182,7 @@ public interface ConnectionParameterPage
      *
      * @return true if a reconnection if required
      */
-    public boolean isReconnectionRequired();
+    boolean isReconnectionRequired();
 
 
     /**
@@ -191,7 +191,7 @@ public interface ConnectionParameterPage
      * 
      * @return true, if parameters were modified
      */
-    public boolean areParametersModifed();
+    boolean areParametersModifed();
 
 
     /**
@@ -200,7 +200,7 @@ public interface ConnectionParameterPage
      * @param parameter the source connection parameter
      * @param ldapUrl the target LDAP URL
      */
-    public void mergeParametersToLdapURL( ConnectionParameter parameter, LdapUrl ldapUrl );
+    void mergeParametersToLdapURL( ConnectionParameter parameter, LdapUrl ldapUrl );
 
 
     /**
@@ -209,5 +209,5 @@ public interface ConnectionParameterPage
      * @param ldapUrl the source LDAP URL
      * @param parameter the target connection parameter
      */
-    public void mergeLdapUrlToParameters( LdapUrl ldapUrl, ConnectionParameter parameter );
+    void mergeLdapUrlToParameters( LdapUrl ldapUrl, ConnectionParameter parameter );
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageManager.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageManager.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageManager.java Thu Aug  6 10:03:42 2015
@@ -23,8 +23,8 @@ package org.apache.directory.studio.conn
 
 import java.util.Arrays;
 import java.util.Comparator;
-import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.eclipse.core.runtime.IConfigurationElement;
 import org.eclipse.core.runtime.IExtensionPoint;
@@ -39,9 +39,16 @@ import org.eclipse.core.runtime.Status;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ConnectionParameterPageManager
+public final class ConnectionParameterPageManager
 {
-
+    /**
+     * A private constructor to make this class an uitlity class
+     */
+    private ConnectionParameterPageManager()
+    {
+    }
+    
+    
     /**
      * Gets the connection parameter pages by searching for connection parameter page
      * extensions.
@@ -54,12 +61,13 @@ public class ConnectionParameterPageMana
         IExtensionPoint extensionPoint = registry.getExtensionPoint( ConnectionUIPlugin.getDefault()
             .getPluginProperties().getString( "ExtensionPoint_ConnectionParameterPages_id" ) ); //$NON-NLS-1$
         IConfigurationElement[] members = extensionPoint.getConfigurationElements();
-        final Map<String, ConnectionParameterPage> pageMap = new HashMap<String, ConnectionParameterPage>();
+        final Map<String, ConnectionParameterPage> pageMap = new ConcurrentHashMap<String, ConnectionParameterPage>();
 
         // For each extension: instantiate the page
         for ( int m = 0; m < members.length; m++ )
         {
             IConfigurationElement member = members[m];
+            
             try
             {
                 ConnectionParameterPage page = ( ConnectionParameterPage ) member.createExecutableExtension( "class" ); //$NON-NLS-1$
@@ -84,33 +92,39 @@ public class ConnectionParameterPageMana
         }
 
         final ConnectionParameterPage[] pages = pageMap.values().toArray( new ConnectionParameterPage[0] );
+        
         Comparator<? super ConnectionParameterPage> pageComparator = new Comparator<ConnectionParameterPage>()
         {
-            public int compare( ConnectionParameterPage p1, ConnectionParameterPage p2 )
+            /**
+             * {@inheritDoc}
+             */
+            public int compare( ConnectionParameterPage page1, ConnectionParameterPage page2 )
             {
-                String dependsOnId1 = p1.getPageDependsOnId();
-                String dependsOnId2 = p2.getPageDependsOnId();
+                String dependsOnId1 = page1.getPageDependsOnId();
+                String dependsOnId2 = page2.getPageDependsOnId();
+                
                 do
                 {
-                    if ( dependsOnId1 == null && dependsOnId2 != null )
+                    if ( ( dependsOnId1 == null ) && ( dependsOnId2 != null ) )
                     {
                         return -1;
                     }
-                    else if ( dependsOnId2 == null && dependsOnId1 != null )
+                    else if ( ( dependsOnId2 == null ) && ( dependsOnId1 != null ) )
                     {
                         return 1;
                     }
-                    else if ( dependsOnId1 != null && dependsOnId1.equals( p2.getPageId() ) )
+                    else if ( ( dependsOnId1 != null ) && dependsOnId1.equals( page2.getPageId() ) )
                     {
                         return 1;
                     }
-                    else if ( dependsOnId2 != null && dependsOnId2.equals( p1.getPageId() ) )
+                    else if ( ( dependsOnId2 != null ) && dependsOnId2.equals( page1.getPageId() ) )
                     {
                         return -1;
                     }
 
                     ConnectionParameterPage page = pageMap.get( dependsOnId1 );
-                    if ( page != null && !page.getPageDependsOnId().equals( dependsOnId1 ) )
+                    
+                    if ( ( page != null ) && !page.getPageDependsOnId().equals( dependsOnId1 ) )
                     {
                         dependsOnId1 = page.getPageDependsOnId();
                     }
@@ -119,44 +133,47 @@ public class ConnectionParameterPageMana
                         dependsOnId1 = null;
                     }
                 }
-                while ( dependsOnId1 != null && !dependsOnId1.equals( p1.getPageId() ) );
+                while ( ( dependsOnId1 != null ) && !dependsOnId1.equals( page1.getPageId() ) );
 
-                dependsOnId1 = p1.getPageDependsOnId();
-                dependsOnId2 = p2.getPageDependsOnId();
+                dependsOnId1 = page1.getPageDependsOnId();
+                dependsOnId2 = page2.getPageDependsOnId();
+                
                 do
                 {
-                    if ( dependsOnId1 == null && dependsOnId2 != null )
+                    if ( ( dependsOnId1 == null ) && ( dependsOnId2 != null ) )
                     {
                         return -1;
                     }
-                    else if ( dependsOnId2 == null && dependsOnId1 != null )
+                    else if ( ( dependsOnId2 == null ) && ( dependsOnId1 != null ) )
                     {
                         return 1;
                     }
-                    else if ( dependsOnId1 != null && dependsOnId1.equals( p2.getPageId() ) )
+                    else if ( ( dependsOnId1 != null ) && dependsOnId1.equals( page2.getPageId() ) )
                     {
                         return 1;
                     }
-                    else if ( dependsOnId2 != null && dependsOnId2.equals( p1.getPageId() ) )
+                    else if ( ( dependsOnId2 != null ) && dependsOnId2.equals( page1.getPageId() ) )
                     {
                         return -1;
                     }
 
                     ConnectionParameterPage page = pageMap.get( dependsOnId2 );
-                    if ( page != null )
+
+                    if ( page == null )
                     {
-                        dependsOnId2 = page.getPageDependsOnId();
+                        dependsOnId2 = null;
                     }
                     else
                     {
-                        dependsOnId2 = null;
+                        dependsOnId2 = page.getPageDependsOnId();
                     }
                 }
-                while ( dependsOnId2 != null && !dependsOnId2.equals( p2.getPageId() ) );
+                while ( ( dependsOnId2 != null ) && !dependsOnId2.equals( page2.getPageId() ) );
 
                 return 0;
             }
         };
+        
         Arrays.sort( pages, pageComparator );
 
         return pages;

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageModifyListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageModifyListener.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageModifyListener.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageModifyListener.java Thu Aug  6 10:03:42 2015
@@ -32,11 +32,10 @@ import org.apache.directory.studio.conne
  */
 public interface ConnectionParameterPageModifyListener
 {
-
     /**
      * Indicates that the connection parameter page was modified.
      */
-    public void connectionParameterPageModified();
+    void connectionParameterPageModified();
 
 
     /**
@@ -44,5 +43,5 @@ public interface ConnectionParameterPage
      * 
      * @return the test connection parameters
      */
-    public ConnectionParameter getTestConnectionParameters();
+    ConnectionParameter getTestConnectionParameters();
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUICertificateHandler.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUICertificateHandler.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUICertificateHandler.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUICertificateHandler.java Thu Aug  6 10:03:42 2015
@@ -36,7 +36,6 @@ import org.eclipse.ui.PlatformUI;
  */
 public class ConnectionUICertificateHandler implements ICertificateHandler
 {
-
     /**
      * {@inheritDoc}
      */
@@ -47,6 +46,9 @@ public class ConnectionUICertificateHand
         final TrustLevel[] trustLevel = new TrustLevel[1];
         PlatformUI.getWorkbench().getDisplay().syncExec( new Runnable()
         {
+            /**
+             * {@inheritDoc}
+             */
             public void run()
             {
                 CertificateTrustDialog dialog = new CertificateTrustDialog( PlatformUI.getWorkbench().getDisplay()
@@ -58,5 +60,4 @@ public class ConnectionUICertificateHand
 
         return trustLevel[0];
     }
-
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIConstants.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIConstants.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIConstants.java Thu Aug  6 10:03:42 2015
@@ -29,15 +29,6 @@ package org.apache.directory.studio.conn
  */
 public final class ConnectionUIConstants
 {
-    /**
-     *  Ensures no construction of this class, also ensures there is no need for final keyword above
-     *  (Implicit super constructor is not visible for default constructor),
-     *  but is still self documenting.
-     */
-    private ConnectionUIConstants()
-    {
-    }
-
     /** The plug-in ID */
     public static final String PLUGIN_ID = ConnectionUIPlugin.getDefault().getPluginProperties()
         .getString( "Plugin_id" ); //$NON-NLS-1$
@@ -96,21 +87,36 @@ public final class ConnectionUIConstants
     /** The export certificate wizard image */
     public static final String IMG_CERTIFICATE_EXPORT_WIZARD = "resources/icons/certificate_export_wizard.gif"; //$NON-NLS-1$
 
+    /** The connection transfer typename */
     public static final String TYPENAME = ConnectionUIPlugin.getDefault().getPluginProperties()
         .getString( "ConnectionTransfert_Typename" ); //$NON-NLS-1$
 
+    /** The COPY command */
     public static final String CMD_COPY = ConnectionUIPlugin.getDefault().getPluginProperties()
         .getString( "Cmd_Copy_id" ); //$NON-NLS-1$
 
+    /** The PASTE command */
     public static final String CMD_PASTE = ConnectionUIPlugin.getDefault().getPluginProperties()
         .getString( "Cmd_Paste_id" ); //$NON-NLS-1$
 
+    /** The DELETE command */
     public static final String CMD_DELETE = ConnectionUIPlugin.getDefault().getPluginProperties()
         .getString( "Cmd_Delete_id" ); //$NON-NLS-1$
 
+    /** The PROPERTIES command */
     public static final String CMD_PROPERTIES = ConnectionUIPlugin.getDefault().getPluginProperties()
         .getString( "Cmd_Properties_id" ); //$NON-NLS-1$
 
+    /** The new wizard/new connection connection */
     public static final String NEW_WIZARD_NEW_CONNECTION = ConnectionUIPlugin.getDefault().getPluginProperties()
         .getString( "NewWizards_NewConnectionWizard_id" ); //$NON-NLS-1$
+
+    /**
+     *  Ensures no construction of this class, also ensures there is no need for final keyword above
+     *  (Implicit super constructor is not visible for default constructor),
+     *  but is still self documenting.
+     */
+    private ConnectionUIConstants()
+    {
+    }
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIPlugin.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIPlugin.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIPlugin.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIPlugin.java Thu Aug  6 10:03:42 2015
@@ -38,6 +38,8 @@ import org.osgi.framework.BundleContext;
 
 /**
  * The activator class controls the plug-in life cycle
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class ConnectionUIPlugin extends AbstractUIPlugin
 {
@@ -59,6 +61,7 @@ public class ConnectionUIPlugin extends
      */
     public ConnectionUIPlugin()
     {
+        super();
         plugin = this;
     }
 
@@ -80,9 +83,10 @@ public class ConnectionUIPlugin extends
             eventRunner = new UiThreadEventRunner();
         }
 
-        ConnectionCorePlugin.getDefault().setAuthHandler( new UIAuthHandler() );
-        ConnectionCorePlugin.getDefault().setReferralHandler( new ConnectionUIReferralHandler() );
-        ConnectionCorePlugin.getDefault().setCertificateHandler( new ConnectionUICertificateHandler() );
+        ConnectionCorePlugin defaultPlugin = ConnectionCorePlugin.getDefault();
+        defaultPlugin.setAuthHandler( new UIAuthHandler() );
+        defaultPlugin.setReferralHandler( new ConnectionUIReferralHandler() );
+        defaultPlugin.setCertificateHandler( new ConnectionUICertificateHandler() );
     }
 
 
@@ -132,8 +136,7 @@ public class ConnectionUIPlugin extends
      * Use this method to get SWT images. Use the IMG_ constants from
      * BrowserWidgetsConstants for the key.
      *
-     * @param key
-     *                The key (relative path to the image in filesystem)
+     * @param key The key (relative path to the image in filesystem)
      * @return The image descriptor or null
      */
     public ImageDescriptor getImageDescriptor( String key )
@@ -141,15 +144,14 @@ public class ConnectionUIPlugin extends
         if ( key != null )
         {
             URL url = FileLocator.find( getBundle(), new Path( key ), null );
+            
             if ( url != null )
+            {
                 return ImageDescriptor.createFromURL( url );
-            else
-                return null;
-        }
-        else
-        {
-            return null;
+            }
         }
+
+        return null;
     }
 
 
@@ -161,22 +163,24 @@ public class ConnectionUIPlugin extends
      * Note: Don't dispose the returned SWT Image. It is disposed
      * automatically when the plugin is stopped.
      *
-     * @param key
-     *                The key (relative path to the image in filesystem)
+     * @param key he key (relative path to the image in filesystem)
      * @return The SWT Image or null
      */
     public Image getImage( String key )
     {
         Image image = getImageRegistry().get( key );
+        
         if ( image == null )
         {
-            ImageDescriptor id = getImageDescriptor( key );
-            if ( id != null )
+            ImageDescriptor imageDescriptor = getImageDescriptor( key );
+            
+            if ( imageDescriptor != null )
             {
-                image = id.createImage();
+                image = imageDescriptor.createImage();
                 getImageRegistry().put( key, image );
             }
         }
+        
         return image;
     }
 
@@ -195,8 +199,7 @@ public class ConnectionUIPlugin extends
     /**
      * Gets the plugin properties.
      *
-     * @return
-     *      the plugin properties
+     * @return the plugin properties
      */
     public PropertyResourceBundle getPluginProperties()
     {

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIReferralHandler.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIReferralHandler.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIReferralHandler.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIReferralHandler.java Thu Aug  6 10:03:42 2015
@@ -21,9 +21,9 @@
 package org.apache.directory.studio.connection.ui;
 
 
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.directory.api.ldap.model.exception.LdapURLEncodingException;
 import org.apache.directory.api.ldap.model.url.LdapUrl;
@@ -44,17 +44,23 @@ import org.eclipse.ui.PlatformUI;
  */
 public class ConnectionUIReferralHandler extends ConnectionUpdateAdapter implements IReferralHandler
 {
-
     /** The referral URL to referral connection cache. */
-    private Map<String, Connection> referralUrlToReferralConnectionCache = new HashMap<String, Connection>();
+    private Map<String, Connection> referralUrlToReferralConnectionCache = new ConcurrentHashMap<String, Connection>();
 
 
+    /**
+     * The constructor
+     */
     public ConnectionUIReferralHandler()
     {
+        super();
         ConnectionEventRegistry.addConnectionUpdateListener( this, ConnectionCorePlugin.getDefault().getEventRunner() );
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public void connectionClosed( Connection connection )
     {
@@ -68,6 +74,7 @@ public class ConnectionUIReferralHandler
     public Connection getReferralConnection( final List<String> referralUrls )
     {
         final Connection[] referralConnections = new Connection[1];
+        
         try
         {
             // check cache
@@ -81,10 +88,10 @@ public class ConnectionUIReferralHandler
                     Connection referralConnection = referralUrlToReferralConnectionCache.get( normalizedUrl );
                     Connection[] connections = ConnectionCorePlugin.getDefault().getConnectionManager()
                         .getConnections();
-                    for ( int i = 0; i < connections.length; i++ )
+                    
+                    for ( Connection connection : connections )
                     {
-                        Connection connection = connections[i];
-                        if ( referralConnection == connection )
+                        if ( connection.equals( referralConnection ) )
                         {
                             return referralConnection;
                         }
@@ -98,11 +105,15 @@ public class ConnectionUIReferralHandler
             // open dialog
             PlatformUI.getWorkbench().getDisplay().syncExec( new Runnable()
             {
+                /**
+                 * {@inheritDoc}
+                 */
                 public void run()
                 {
                     SelectReferralConnectionDialog dialog = new SelectReferralConnectionDialog( PlatformUI
                         .getWorkbench()
                         .getDisplay().getActiveShell(), referralUrls );
+                    
                     if ( dialog.open() == SelectReferralConnectionDialog.OK )
                     {
                         Connection connection = dialog.getReferralConnection();
@@ -121,12 +132,11 @@ public class ConnectionUIReferralHandler
                 }
             }
         }
-        catch ( LdapURLEncodingException e )
+        catch ( LdapURLEncodingException luee )
         {
             // Will never occur
         }
 
         return referralConnections[0];
     }
-
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ExceptionHandler.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ExceptionHandler.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ExceptionHandler.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ExceptionHandler.java Thu Aug  6 10:03:42 2015
@@ -65,6 +65,9 @@ public class ExceptionHandler
         {
             Runnable runnable = new Runnable()
             {
+                /**
+                 * {@inheritDoc}
+                 */
                 public void run()
                 {
                     ErrorDialog.openError( Display.getDefault().getActiveShell(), Messages

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/Messages.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/Messages.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/Messages.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/Messages.java Thu Aug  6 10:03:42 2015
@@ -29,13 +29,21 @@ import java.util.ResourceBundle;
  *  
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class Messages
+public final class Messages
 {
     /** The resource name */
     private static final ResourceBundle RESOURCE_BUNDLE = 
         ResourceBundle.getBundle( Messages.class.getPackage().getName() + ".messages" );
     
     /**
+     * A private constructor : this is an utility class
+     */
+    private Messages()
+    {
+    }
+
+    
+    /**
      * Get back a message from the resource file given a key
      * 
      * @param key The key associated with the message

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/PasswordsKeyStoreManagerUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/PasswordsKeyStoreManagerUtils.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/PasswordsKeyStoreManagerUtils.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/PasswordsKeyStoreManagerUtils.java Thu Aug  6 10:03:42 2015
@@ -36,9 +36,17 @@ import org.eclipse.ui.PlatformUI;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class PasswordsKeyStoreManagerUtils
+public final class PasswordsKeyStoreManagerUtils
 {
     /**
+     * A private constructor : this is an utility class
+     */
+    private PasswordsKeyStoreManagerUtils()
+    {
+    }
+    
+    
+    /**
      * Checks if the passwords keystore is enabled.
      *
      * @return <code>true</code> if the passwords keystore is enabled,
@@ -64,6 +72,9 @@ public class PasswordsKeyStoreManagerUti
 
         PlatformUI.getWorkbench().getDisplay().syncExec( new Runnable()
         {
+            /**
+             * {@inheritDoc}
+             */
             public void run()
             {
                 while ( true )
@@ -105,15 +116,15 @@ public class PasswordsKeyStoreManagerUti
                     // Creating the message
                     String message = null;
 
-                    if ( checkPasswordException != null )
+                    if ( checkPasswordException == null )
                     {
-                        message = Messages
-                            .getString( "PasswordsKeyStoreManagerUtils.MasterPasswordVerificationFailedWithException" ) //$NON-NLS-1$
-                            + checkPasswordException.getMessage();
+                        message = Messages.getString( "PasswordsKeyStoreManagerUtils.MasterPasswordVerificationFailed" ); //$NON-NLS-1$
                     }
                     else
                     {
-                        message = Messages.getString( "PasswordsKeyStoreManagerUtils.MasterPasswordVerificationFailed" ); //$NON-NLS-1$
+                        message = Messages
+                            .getString( "PasswordsKeyStoreManagerUtils.MasterPasswordVerificationFailedWithException" ) //$NON-NLS-1$
+                            + checkPasswordException.getMessage();
                     }
 
                     // We ask the user if he wants to retry to unlock the passwords keystore

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/RunnableContextRunner.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/RunnableContextRunner.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/RunnableContextRunner.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/RunnableContextRunner.java Thu Aug  6 10:03:42 2015
@@ -21,6 +21,7 @@
 package org.apache.directory.studio.connection.ui;
 
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.directory.studio.common.core.jobs.StudioProgressMonitor;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionCorePlugin;
@@ -45,7 +46,6 @@ import org.eclipse.ui.PlatformUI;
  */
 public class RunnableContextRunner
 {
-
     /**
      * Executes the given job within the given runnable context.
      * 
@@ -70,17 +70,19 @@ public class RunnableContextRunner
 
                 // ensure that connections are opened
                 Connection[] connections = runnable.getConnections();
+                
                 if ( connections != null )
                 {
                     for ( Connection connection : connections )
                     {
-                        if ( connection != null && !connection.getConnectionWrapper().isConnected() )
+                        if ( ( connection != null ) && !connection.getConnectionWrapper().isConnected() )
                         {
                             spm[0].setTaskName( Messages.bind( Messages.jobs__open_connections_task, new String[]
                                 { connection.getName() } ) );
                             spm[0].worked( 1 );
 
                             connection.getConnectionWrapper().connect( spm[0] );
+                            
                             if ( connection.getConnectionWrapper().isConnected() )
                             {
                                 connection.getConnectionWrapper().bind( spm[0] );
@@ -93,6 +95,7 @@ public class RunnableContextRunner
                                 {
                                     listener.connectionOpened( connection, spm[0] );
                                 }
+                                
                                 ConnectionEventRegistry.fireConnectionOpened( connection, this );
                             }
                         }
@@ -107,6 +110,7 @@ public class RunnableContextRunner
                         {
                             StudioConnectionBulkRunnableWithProgress bulkRunnable = ( StudioConnectionBulkRunnableWithProgress ) runnable;
                             ConnectionEventRegistry.suspendEventFiringInCurrentThread();
+                            
                             try
                             {
                                 bulkRunnable.run( spm[0] );
@@ -115,6 +119,7 @@ public class RunnableContextRunner
                             {
                                 ConnectionEventRegistry.resumeEventFiringInCurrentThread();
                             }
+                            
                             bulkRunnable.runNotification( spm[0] );
                         }
                         else
@@ -146,16 +151,16 @@ public class RunnableContextRunner
                 .getExceptionHandler()
                 .handleException(
                     new Status( IStatus.ERROR, ConnectionUIConstants.PLUGIN_ID, IStatus.ERROR,
-                        ex.getMessage() != null ? ex.getMessage() : "", ex ) ); //$NON-NLS-1$
+                        ex.getMessage() != null ? ex.getMessage() : StringUtils.EMPTY, ex ) ); //$NON-NLS-1$
         }
 
         IStatus status = spm[0].getErrorStatus( runnable.getErrorMessage() );
-        if ( handleError && !spm[0].isCanceled() && !status.isOK() )
+        
+        if ( ( handleError && !spm[0].isCanceled() ) && !status.isOK() )
         {
             ConnectionUIPlugin.getDefault().getExceptionHandler().handleException( status );
         }
 
         return status;
     }
-
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/UIAuthHandler.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/UIAuthHandler.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/UIAuthHandler.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/UIAuthHandler.java Thu Aug  6 10:03:42 2015
@@ -21,6 +21,8 @@
 package org.apache.directory.studio.connection.ui;
 
 
+import org.apache.commons.lang.StringUtils;
+import org.apache.directory.api.util.Strings;
 import org.apache.directory.studio.connection.core.ConnectionCorePlugin;
 import org.apache.directory.studio.connection.core.ConnectionParameter;
 import org.apache.directory.studio.connection.core.Credentials;
@@ -40,16 +42,15 @@ import org.eclipse.ui.PlatformUI;
  */
 public class UIAuthHandler implements IAuthHandler
 {
-
     /**
      * {@inheritDoc}
      */
     public ICredentials getCredentials( final ConnectionParameter connectionParameter )
     {
         // Checking if the bind principal is null or empty (no authentication)
-        if ( connectionParameter.getBindPrincipal() == null || "".equals( connectionParameter.getBindPrincipal() ) ) //$NON-NLS-1$
+        if ( Strings.isEmpty( connectionParameter.getBindPrincipal() ) ) //$NON-NLS-1$
         {
-            return new Credentials( "", "", connectionParameter ); //$NON-NLS-1$ //$NON-NLS-2$
+            return new Credentials( StringUtils.EMPTY, StringUtils.EMPTY, connectionParameter ); //$NON-NLS-1$ //$NON-NLS-2$
         }
         else
         {
@@ -61,22 +62,18 @@ public class UIAuthHandler implements IA
                     .getPasswordsKeyStoreManager();
 
                 // Checking if the keystore is not loaded 
-                if ( !passwordsKeyStoreManager.isLoaded() )
+                // and asking the user to load the keystore
+                if ( !passwordsKeyStoreManager.isLoaded() && !PasswordsKeyStoreManagerUtils.askUserToLoadKeystore() )
                 {
-                    // Asking the user to load the keystore
-                    if ( !PasswordsKeyStoreManagerUtils.askUserToLoadKeystore() )
-                    {
-                        // The user failed to load the keystore and cancelled
-                        return null;
-                    }
+                    // The user failed to load the keystore and cancelled
+                    return null;
                 }
 
                 // Getting the password
                 String password = passwordsKeyStoreManager.getConnectionPassword( connectionParameter.getId() );
 
                 // Checking if the bind password is available (the user chose to store the password)
-                if ( password != null
-                    && !"".equals( password ) ) //$NON-NLS-1$
+                if ( Strings.isEmpty( password ) ) //$NON-NLS-1$
                 {
                     return new Credentials( connectionParameter.getBindPrincipal(),
                         password, connectionParameter );
@@ -91,8 +88,7 @@ public class UIAuthHandler implements IA
             else
             {
                 // Checking if the bind password is available (the user chose to store the password)
-                if ( connectionParameter.getBindPassword() != null
-                    && !"".equals( connectionParameter.getBindPassword() ) ) //$NON-NLS-1$
+                if ( !Strings.isEmpty( connectionParameter.getBindPassword() ) )
                 {
                     return new Credentials( connectionParameter.getBindPrincipal(),
                         connectionParameter.getBindPassword(), connectionParameter );
@@ -126,7 +122,8 @@ public class UIAuthHandler implements IA
                     NLS.bind(
                         Messages.getString( "UIAuthHandler.EnterPasswordFor" ), new String[] { connectionParameter.getName() } ), //$NON-NLS-1$
                     NLS.bind(
-                        Messages.getString( "UIAuthHandler.PleaseEnterPasswordOfUser" ), connectionParameter.getBindPrincipal() ), "" ); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+                        Messages.getString( "UIAuthHandler.PleaseEnterPasswordOfUser" ), connectionParameter.getBindPrincipal() ), 
+                                    StringUtils.EMPTY ); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
 
                 if ( dialog.open() == PasswordDialog.OK )
                 {

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/UiThreadEventRunner.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/UiThreadEventRunner.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/UiThreadEventRunner.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/UiThreadEventRunner.java Thu Aug  6 10:03:42 2015
@@ -33,7 +33,6 @@ import org.eclipse.swt.widgets.Display;
  */
 public class UiThreadEventRunner implements EventRunner
 {
-
     /**
      * {@inheritDoc}
      *
@@ -44,5 +43,4 @@ public class UiThreadEventRunner impleme
     {
         Display.getDefault().asyncExec( runnable );
     }
-
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/ActionHandlerManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/ActionHandlerManager.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/ActionHandlerManager.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/ActionHandlerManager.java Thu Aug  6 10:03:42 2015
@@ -31,12 +31,12 @@ public interface ActionHandlerManager
     /**
      * Deactivates global action handlers.
      */
-    public void deactivateGlobalActionHandlers();
+    void deactivateGlobalActionHandlers();
 
 
     /**
      * Activates global action handlers.
      */
-    public void activateGlobalActionHandlers();
+    void activateGlobalActionHandlers();
 
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CloseConnectionAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CloseConnectionAction.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CloseConnectionAction.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CloseConnectionAction.java Thu Aug  6 10:03:42 2015
@@ -21,6 +21,7 @@
 package org.apache.directory.studio.connection.ui.actions;
 
 
+import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.jobs.CloseConnectionsRunnable;
 import org.apache.directory.studio.connection.core.jobs.StudioConnectionJob;
 import org.apache.directory.studio.connection.ui.ConnectionUIConstants;
@@ -37,15 +38,6 @@ public class CloseConnectionAction exten
 {
 
     /**
-     * Creates a new instance of CloseConnectionAction.
-     */
-    public CloseConnectionAction()
-    {
-        super();
-    }
-
-
-    /**
      * @see org.apache.directory.studio.connection.ui.actions.StudioAction#run()
      */
     public void run()
@@ -59,7 +51,14 @@ public class CloseConnectionAction exten
      */
     public String getText()
     {
-        return getSelectedConnections().length > 1 ? Messages.getString( "CloseConnectionAction.CloseConnections" ) : Messages.getString( "CloseConnectionAction.CloseConnection" ); //$NON-NLS-1$ //$NON-NLS-2$
+        if ( getSelectedConnections().length > 1 )
+        {
+            return Messages.getString( "CloseConnectionAction.CloseConnections" );
+        }
+        else
+        {
+            return Messages.getString( "CloseConnectionAction.CloseConnection" ); //$NON-NLS-1$ //$NON-NLS-2$
+        }
     }
 
 
@@ -87,14 +86,16 @@ public class CloseConnectionAction exten
     public boolean isEnabled()
     {
         boolean canClose = false;
-        for ( int i = 0; i < getSelectedConnections().length; i++ )
+        
+        for ( Connection connection : getSelectedConnections() )
         {
-            if ( getSelectedConnections()[i].getConnectionWrapper().isConnected() )
+            if ( connection.getConnectionWrapper().isConnected() )
             {
                 canClose = true;
                 break;
             }
         }
+        
         return getSelectedConnections().length > 0 && canClose;
     }
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CollapseAllAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CollapseAllAction.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CollapseAllAction.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CollapseAllAction.java Thu Aug  6 10:03:42 2015
@@ -34,6 +34,7 @@ import org.eclipse.jface.viewers.TreeVie
  */
 public class CollapseAllAction extends Action
 {
+    /** The Tree viewer */
     protected TreeViewer viewer;
 
 
@@ -46,7 +47,8 @@ public class CollapseAllAction extends A
     public CollapseAllAction( TreeViewer viewer )
     {
         super(
-            Messages.getString( "CollapseAllAction.CollapseAll" ), ConnectionUIPlugin.getDefault().getImageDescriptor( ConnectionUIConstants.IMG_COLLAPSEALL ) ); //$NON-NLS-1$
+            Messages.getString( "CollapseAllAction.CollapseAll" ), 
+                ConnectionUIPlugin.getDefault().getImageDescriptor( ConnectionUIConstants.IMG_COLLAPSEALL ) ); //$NON-NLS-1$
         super.setToolTipText( getText() );
         super.setEnabled( true );
 

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CopyAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CopyAction.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CopyAction.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CopyAction.java Thu Aug  6 10:03:42 2015
@@ -40,8 +40,8 @@ import org.eclipse.swt.dnd.TextTransfer;
 import org.eclipse.swt.dnd.Transfer;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchCommandConstants;
 import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
 
 
 /**
@@ -51,6 +51,7 @@ import org.eclipse.ui.texteditor.IWorkbe
  */
 public class CopyAction extends StudioAction
 {
+    /** The Paste action proxy */
     private StudioActionProxy pasteActionProxy;
 
 
@@ -74,13 +75,28 @@ public class CopyAction extends StudioAc
     {
         Connection[] connections = getSelectedConnections();
         ConnectionFolder[] connectionFolders = getSelectedConnectionFolders();
-        if ( connections.length > 0 && connectionFolders.length == 0 )
+        
+        if ( ( connections.length ) > 0 && ( connectionFolders.length == 0 ) )
         {
-            return connections.length > 1 ? Messages.getString( "CopyAction.CopyConnections" ) : Messages.getString( "CopyAction.CopyConnection" ); //$NON-NLS-1$ //$NON-NLS-2$
+            if ( connections.length > 1 )
+            {
+                return Messages.getString( "CopyAction.CopyConnections" );
+            }
+            else
+            {
+                return Messages.getString( "CopyAction.CopyConnection" );
+            }
         }
-        else if ( connectionFolders.length > 0 && connections.length == 0 )
+        else if ( ( connectionFolders.length > 0 ) && ( connections.length == 0 ) )
         {
-            return connectionFolders.length > 1 ? Messages.getString( "CopyAction.CopyFolders" ) : Messages.getString( "CopyAction.CopyFolder" ); //$NON-NLS-1$ //$NON-NLS-2$
+            if ( connectionFolders.length > 1 )
+            {
+                return Messages.getString( "CopyAction.CopyFolders" );
+            }
+            else
+            {
+                return Messages.getString( "CopyAction.CopyFolder" );
+            }
         }
         else
         {
@@ -103,7 +119,7 @@ public class CopyAction extends StudioAc
      */
     public String getCommandId()
     {
-        return IWorkbenchActionDefinitionIds.COPY;
+        return IWorkbenchCommandConstants.EDIT_COPY;
     }
 
 
@@ -147,15 +163,14 @@ public class CopyAction extends StudioAc
     /**
      * Copies data to Clipboard
      *
-     * @param data
-     *      the data to be set in the clipboard
-     * @param dataTypes
-     *      the transfer agents that will convert the data to its platform specific format; 
+     * @param data the data to be set in the clipboard
+     * @param dataTypes the transfer agents that will convert the data to its platform specific format; 
      *      each entry in the data array must have a corresponding dataType
      */
     public static void copyToClipboard( Object[] data, Transfer[] dataTypes )
     {
         Clipboard clipboard = null;
+        
         try
         {
             clipboard = new Clipboard( Display.getCurrent() );
@@ -164,7 +179,9 @@ public class CopyAction extends StudioAc
         finally
         {
             if ( clipboard != null )
+            {
                 clipboard.dispose();
+            }
         }
     }
 
@@ -186,24 +203,27 @@ public class CopyAction extends StudioAc
      */
     private String getSelectedConnectionUrls()
     {
-        StringBuilder sb = new StringBuilder();
+        StringBuilder buffer = new StringBuilder();
 
         Connection[] connections = getSelectedConnections();
         ConnectionParameterPage[] connectionParameterPages = ConnectionParameterPageManager
             .getConnectionParameterPages();
+        
         for ( Connection connection : connections )
         {
             ConnectionParameter parameter = connection.getConnectionParameter();
             LdapUrl ldapUrl = new LdapUrl();
             ldapUrl.setDn( Dn.EMPTY_DN );
+            
             for ( ConnectionParameterPage connectionParameterPage : connectionParameterPages )
             {
                 connectionParameterPage.mergeParametersToLdapURL( parameter, ldapUrl );
             }
-            sb.append( ldapUrl.toString() );
-            sb.append( ConnectionCoreConstants.LINE_SEPARATOR );
+            
+            buffer.append( ldapUrl.toString() );
+            buffer.append( ConnectionCoreConstants.LINE_SEPARATOR );
         }
-        return sb.toString();
+        
+        return buffer.toString();
     }
-
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/DeleteAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/DeleteAction.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/DeleteAction.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/DeleteAction.java Thu Aug  6 10:03:42 2015
@@ -34,8 +34,8 @@ import org.apache.directory.studio.conne
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchCommandConstants;
 import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
 
 
 /**
@@ -52,13 +52,28 @@ public class DeleteAction extends Studio
     {
         Connection[] connections = getSelectedConnections();
         ConnectionFolder[] connectionFolders = getSelectedConnectionFolders();
-        if ( connections.length > 0 && connectionFolders.length == 0 )
+        
+        if ( ( connections.length > 0 ) && ( connectionFolders.length == 0 ) )
         {
-            return connections.length > 1 ? Messages.getString( "DeleteAction.DeleteConnections" ) : Messages.getString( "DeleteAction.DeleteConnection" ); //$NON-NLS-1$ //$NON-NLS-2$
+            if ( connections.length > 1 )
+            {
+                return Messages.getString( "DeleteAction.DeleteConnections" );
+            }
+            else
+            {
+                return Messages.getString( "DeleteAction.DeleteConnection" ); //$NON-NLS-1$ //$NON-NLS-2$
+            }
         }
-        else if ( connectionFolders.length > 0 && connections.length == 0 )
+        else if ( ( connectionFolders.length > 0 ) && ( connections.length == 0 ) )
         {
-            return connectionFolders.length > 1 ? Messages.getString( "DeleteAction.DeleteConnectionFolders" ) : Messages.getString( "DeleteAction.DeleteConnectionFolder" ); //$NON-NLS-1$ //$NON-NLS-2$
+            if ( connectionFolders.length > 1 )
+            {
+                return Messages.getString( "DeleteAction.DeleteConnectionFolders" );
+            }
+            else
+            {
+                return Messages.getString( "DeleteAction.DeleteConnectionFolder" ); //$NON-NLS-1$ //$NON-NLS-2$
+            }
         }
         else
         {
@@ -81,7 +96,7 @@ public class DeleteAction extends Studio
      */
     public String getCommandId()
     {
-        return IWorkbenchActionDefinitionIds.DELETE;
+        return IWorkbenchCommandConstants.EDIT_DELETE;
     }
 
 
@@ -93,26 +108,33 @@ public class DeleteAction extends Studio
         Connection[] connections = getSelectedConnections();
         ConnectionFolder[] connectionFolders = getSelectedConnectionFolders();
 
-        StringBuffer message = new StringBuffer();
+        StringBuilder message = new StringBuilder();
 
         if ( connections.length > 0 )
         {
             if ( connections.length <= 5 )
             {
-                message.append( connections.length == 1 ? Messages
-                    .getString( "DeleteAction.SureDeleteFollowingConnection" ) //$NON-NLS-1$
-                    : Messages.getString( "DeleteAction.SureDeleteFollowingConnections" ) ); //$NON-NLS-1$
-                for ( int i = 0; i < connections.length; i++ )
+                if ( connections.length == 1 )
+                {
+                    message.append( Messages.getString( "DeleteAction.SureDeleteFollowingConnection" ) ); //$NON-NLS-1$
+                }
+                else
+                {
+                    message.append( Messages.getString( "DeleteAction.SureDeleteFollowingConnections" ) ); //$NON-NLS-1$
+                }
+                
+                for ( Connection connection : connections )
                 {
                     message.append( ConnectionCoreConstants.LINE_SEPARATOR );
                     message.append( "  - " ); //$NON-NLS-1$
-                    message.append( connections[i].getName() );
+                    message.append( connection.getName() );
                 }
             }
             else
             {
                 message.append( Messages.getString( "DeleteAction.SureDeleteSelectedConnections" ) ); //$NON-NLS-1$
             }
+            
             message.append( ConnectionCoreConstants.LINE_SEPARATOR );
             message.append( ConnectionCoreConstants.LINE_SEPARATOR );
         }
@@ -121,25 +143,32 @@ public class DeleteAction extends Studio
         {
             if ( connectionFolders.length <= 5 )
             {
-                message.append( connectionFolders.length == 1 ? Messages
-                    .getString( "DeleteAction.SureDeleteFollowingFolder" ) //$NON-NLS-1$
-                    : Messages.getString( "DeleteAction.SureDeleteFollowingFolders" ) ); //$NON-NLS-1$
-                for ( int i = 0; i < connectionFolders.length; i++ )
+                if ( connectionFolders.length == 1 )
+                {
+                    message.append( Messages.getString( "DeleteAction.SureDeleteFollowingFolder" ) ); //$NON-NLS-1$
+                }
+                else
+                {
+                    message.append( Messages.getString( "DeleteAction.SureDeleteFollowingFolders" ) ); //$NON-NLS-1$
+                }
+
+                for ( ConnectionFolder connectionFolder : connectionFolders )
                 {
                     message.append( ConnectionCoreConstants.LINE_SEPARATOR );
                     message.append( "  - " ); //$NON-NLS-1$
-                    message.append( connectionFolders[i].getName() );
+                    message.append( connectionFolder.getName() );
                 }
             }
             else
             {
                 message.append( Messages.getString( "DeleteAction.SureDeleteSelectedConnectionFolders" ) ); //$NON-NLS-1$
             }
+            
             message.append( ConnectionCoreConstants.LINE_SEPARATOR );
             message.append( ConnectionCoreConstants.LINE_SEPARATOR );
         }
 
-        if ( message.length() == 0 || MessageDialog.openConfirm( getShell(), getText(), message.toString() ) )
+        if ( ( message.length() == 0 ) || MessageDialog.openConfirm( getShell(), getText(), message.toString() ) )
         {
             List<Connection> connectionsToDelete = getConnectionsToDelete();
             List<ConnectionFolder> connectionsFoldersToDelete = getConnectionsFoldersToDelete();
@@ -148,6 +177,7 @@ public class DeleteAction extends Studio
             {
                 deleteConnections( connectionsToDelete );
             }
+            
             if ( !connectionsFoldersToDelete.isEmpty() )
             {
                 deleteConnectionFolders( connectionsFoldersToDelete );
@@ -161,15 +191,18 @@ public class DeleteAction extends Studio
         List<ConnectionFolder> selectedFolders = new ArrayList<ConnectionFolder>( Arrays
             .asList( getSelectedConnectionFolders() ) );
         List<ConnectionFolder> foldersToDelete = new ArrayList<ConnectionFolder>();
+        
         while ( !selectedFolders.isEmpty() )
         {
             ConnectionFolder folder = selectedFolders.get( 0 );
 
             List<String> subFolderIds = folder.getSubFolderIds();
+            
             for ( String subFolderId : subFolderIds )
             {
                 ConnectionFolder subFolder = ConnectionCorePlugin.getDefault().getConnectionFolderManager()
                     .getConnectionFolderById( subFolderId );
+                
                 if ( subFolder != null )
                 {
                     selectedFolders.add( subFolder );
@@ -183,6 +216,7 @@ public class DeleteAction extends Studio
 
             selectedFolders.remove( folder );
         }
+        
         return foldersToDelete;
     }
 
@@ -193,15 +227,18 @@ public class DeleteAction extends Studio
             .asList( getSelectedConnectionFolders() ) );
         List<Connection> selectedConnections = new ArrayList<Connection>( Arrays.asList( getSelectedConnections() ) );
         List<Connection> connectionsToDelete = new ArrayList<Connection>( selectedConnections );
+        
         while ( !selectedFolders.isEmpty() )
         {
             ConnectionFolder folder = selectedFolders.get( 0 );
 
             List<String> subFolderIds = folder.getSubFolderIds();
+            
             for ( String subFolderId : subFolderIds )
             {
                 ConnectionFolder subFolder = ConnectionCorePlugin.getDefault().getConnectionFolderManager()
                     .getConnectionFolderById( subFolderId );
+                
                 if ( subFolder != null )
                 {
                     selectedFolders.add( subFolder );
@@ -209,11 +246,13 @@ public class DeleteAction extends Studio
             }
 
             List<String> connectionIds = folder.getConnectionIds();
+            
             for ( String connectionId : connectionIds )
             {
                 Connection connection = ConnectionCorePlugin.getDefault().getConnectionManager().getConnectionById(
                     connectionId );
-                if ( connection != null && !connectionsToDelete.contains( connection ) )
+                
+                if ( ( connection != null ) && !connectionsToDelete.contains( connection ) )
                 {
                     connectionsToDelete.add( connection );
                 }
@@ -221,6 +260,7 @@ public class DeleteAction extends Studio
 
             selectedFolders.remove( folder );
         }
+        
         return connectionsToDelete;
     }
 
@@ -243,6 +283,7 @@ public class DeleteAction extends Studio
     private void deleteConnections( List<Connection> connectionsToDelete )
     {
         new StudioConnectionJob( new CloseConnectionsRunnable( connectionsToDelete ) ).execute();
+        
         for ( Connection connection : connectionsToDelete )
         {
             ConnectionCorePlugin.getDefault().getConnectionManager().removeConnection( connection );
@@ -263,5 +304,4 @@ public class DeleteAction extends Studio
             ConnectionCorePlugin.getDefault().getConnectionFolderManager().removeConnectionFolder( connectionFolder );
         }
     }
-
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/ExpandAllAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/ExpandAllAction.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/ExpandAllAction.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/ExpandAllAction.java Thu Aug  6 10:03:42 2015
@@ -34,21 +34,22 @@ import org.eclipse.jface.viewers.TreeVie
  */
 public class ExpandAllAction extends Action
 {
+    /** The Tree viewer */
     protected TreeViewer viewer;
 
 
     /**
      * Creates a new instance of ExpandAllAction.
      *
-     * @param viewer
-     *      the attached Viewer
+     * @param viewer the attached Viewer
      */
     public ExpandAllAction( TreeViewer viewer )
     {
         super(
-            Messages.getString( "ExpandAllAction.ExpandAll" ), ConnectionUIPlugin.getDefault().getImageDescriptor( ConnectionUIConstants.IMG_EXPANDALL ) ); //$NON-NLS-1$
-        super.setToolTipText( getText() );
-        super.setEnabled( true );
+            Messages.getString( "ExpandAllAction.ExpandAll" ), 
+            ConnectionUIPlugin.getDefault().getImageDescriptor( ConnectionUIConstants.IMG_EXPANDALL ) ); //$NON-NLS-1$
+        setToolTipText( getText() );
+        setEnabled( true );
 
         this.viewer = viewer;
     }
@@ -59,7 +60,7 @@ public class ExpandAllAction extends Act
      */
     public void run()
     {
-        this.viewer.expandAll();
+        viewer.expandAll();
     }
 
 
@@ -68,6 +69,6 @@ public class ExpandAllAction extends Act
      */
     public void dispose()
     {
-        this.viewer = null;
+        viewer = null;
     }
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/Messages.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/Messages.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/Messages.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/Messages.java Thu Aug  6 10:03:42 2015
@@ -29,13 +29,20 @@ import java.util.ResourceBundle;
  *  
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class Messages
+public final class Messages
 {
     /** The resource name */
     private static final ResourceBundle RESOURCE_BUNDLE = 
         ResourceBundle.getBundle( Messages.class.getPackage().getName() + ".messages" );
     
     /**
+     * A private constructor : this is an utility class
+     */
+    private Messages()
+    {
+    }
+
+    /**
      * Get back a message from the resource file given a key
      * 
      * @param key The key associated with the message

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/NewConnectionAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/NewConnectionAction.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/NewConnectionAction.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/NewConnectionAction.java Thu Aug  6 10:03:42 2015
@@ -42,15 +42,6 @@ import org.eclipse.ui.PlatformUI;
 public class NewConnectionAction extends StudioAction
 {
     /**
-     * Creates a new instance of NewConnectionAction.
-     */
-    public NewConnectionAction()
-    {
-        super();
-    }
-
-
-    /**
      * {@inheritDoc}
      */
     public void run()

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/NewConnectionFolderAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/NewConnectionFolderAction.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/NewConnectionFolderAction.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/NewConnectionFolderAction.java Thu Aug  6 10:03:42 2015
@@ -21,6 +21,7 @@
 package org.apache.directory.studio.connection.ui.actions;
 
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.directory.studio.connection.core.ConnectionCorePlugin;
 import org.apache.directory.studio.connection.core.ConnectionFolder;
 import org.apache.directory.studio.connection.ui.ConnectionUIConstants;
@@ -38,22 +39,15 @@ import org.eclipse.ui.PlatformUI;
 public class NewConnectionFolderAction extends StudioAction
 {
     /**
-     * Creates a new instance of NewConnectionFolderAction.
-     */
-    public NewConnectionFolderAction()
-    {
-        super();
-    }
-
-
-    /**
      * {@inheritDoc}
      */
     public void run()
     {
         ConnectionFolderDialog dialog = new ConnectionFolderDialog(
             PlatformUI.getWorkbench().getDisplay().getActiveShell(),
-            Messages.getString( "NewConnectionFolderAction.NewConnectionFolder" ), Messages.getString( "NewConnectionFolderAction.NeterNameNewFolder" ), "", null ); //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$
+            Messages.getString( "NewConnectionFolderAction.NewConnectionFolder" ), 
+                Messages.getString( "NewConnectionFolderAction.NeterNameNewFolder" ), StringUtils.EMPTY, null ); //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$
+        
         if ( dialog.open() == ConnectionFolderDialog.OK )
         {
             String name = dialog.getValue();
@@ -61,7 +55,8 @@ public class NewConnectionFolderAction e
             ConnectionCorePlugin.getDefault().getConnectionFolderManager().addConnectionFolder( folder );
 
             ConnectionFolder[] folders = getSelectedConnectionFolders();
-            if ( folders != null && folders.length > 0 )
+            
+            if ( ( folders != null ) && ( folders.length > 0 ) )
             {
                 folders[0].addSubFolderId( folder.getId() );
             }
@@ -71,7 +66,6 @@ public class NewConnectionFolderAction e
                     .addSubFolderId( folder.getId() );
             }
         }
-
     }
 
 

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/OpenConnectionAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/OpenConnectionAction.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/OpenConnectionAction.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/OpenConnectionAction.java Thu Aug  6 10:03:42 2015
@@ -21,6 +21,7 @@
 package org.apache.directory.studio.connection.ui.actions;
 
 
+import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.jobs.OpenConnectionsRunnable;
 import org.apache.directory.studio.connection.core.jobs.StudioConnectionJob;
 import org.apache.directory.studio.connection.ui.ConnectionUIConstants;
@@ -36,15 +37,6 @@ import org.eclipse.jface.resource.ImageD
 public class OpenConnectionAction extends StudioAction
 {
     /**
-     * Creates a new instance of OpenConnectionAction.
-     */
-    public OpenConnectionAction()
-    {
-        super();
-    }
-
-
-    /**
      * {@inheritDoc}
      */
     public void run()
@@ -58,7 +50,14 @@ public class OpenConnectionAction extend
      */
     public String getText()
     {
-        return getSelectedConnections().length > 1 ? Messages.getString( "OpenConnectionAction.OpenConnections" ) : Messages.getString( "OpenConnectionAction.OpenConnection" ); //$NON-NLS-1$ //$NON-NLS-2$
+        if ( getSelectedConnections().length > 1 )
+        {
+            return Messages.getString( "OpenConnectionAction.OpenConnections" );
+        }
+        else
+        {
+            return Messages.getString( "OpenConnectionAction.OpenConnection" ); //$NON-NLS-1$ //$NON-NLS-2$
+        }
     }
 
 
@@ -86,14 +85,16 @@ public class OpenConnectionAction extend
     public boolean isEnabled()
     {
         boolean canOpen = false;
-        for ( int i = 0; i < getSelectedConnections().length; i++ )
+        
+        for ( Connection connection : getSelectedConnections() )
         {
-            if ( !getSelectedConnections()[i].getConnectionWrapper().isConnected() )
+            if ( !connection.getConnectionWrapper().isConnected() )
             {
                 canOpen = true;
                 break;
             }
         }
+        
         return getSelectedConnections().length > 0 && canOpen;
     }
 }



Mime
View raw message