directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1805443 [1/3] - in /directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio: connection/ui/ connection/ui/actions/ connection/ui/dialogs/ connection/ui/dnd/ connection/ui/preferences/ connecti...
Date Fri, 18 Aug 2017 16:24:32 GMT
Author: elecharny
Date: Fri Aug 18 16:24:32 2017
New Revision: 1805443

URL: http://svn.apache.org/viewvc?rev=1805443&view=rev
Log:
o Removed Sonar warnings

Modified:
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/AbstractConnectionParameterPage.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageManager.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUICertificateHandler.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIConstants.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIPlugin.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIReferralHandler.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ExceptionHandler.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/Messages.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/PasswordsKeyStoreManagerUtils.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/RunnableContextRunner.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/UIAuthHandler.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CloseConnectionAction.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CollapseAllAction.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/ConnectionViewActionProxy.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CopyAction.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/DeleteAction.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/ExpandAllAction.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/NewConnectionAction.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PasteAction.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PropertiesAction.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/RenameAction.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/SelectionUtils.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioAction.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioActionProxy.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/CertificateTrustDialog.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/ConnectionFolderDialog.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/PasswordDialog.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/ResetPasswordDialog.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/SelectReferralConnectionDialog.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/SetupPasswordDialog.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/ConnectionTransfer.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/DragConnectionListener.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/DropConnectionListener.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/preferences/CertificateValidationPreferencePage.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/preferences/ConnectionsPreferencePage.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/preferences/PasswordsKeystorePreferencePage.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/properties/ConnectionPropertyPage.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/AuthenticationParameterPage.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/CertificateInfoComposite.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/CertificateListComposite.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionActionGroup.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionConfiguration.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionContentProvider.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionLabelProvider.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionSorter.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionUniversalListener.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionWidget.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ExtendedContentAssistCommandAdapter.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/Messages.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/NetworkParameterPage.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/messages.properties
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/messages_de.properties
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/messages_fr.properties
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/wizards/ExportCertificateWizard.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/wizards/ExportCertificateWizardPage.java
    directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/utils/ActionUtils.java

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/AbstractConnectionParameterPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/AbstractConnectionParameterPage.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/AbstractConnectionParameterPage.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/AbstractConnectionParameterPage.java Fri Aug 18 16:24:32 2017
@@ -209,17 +209,17 @@ public abstract class AbstractConnection
         ConnectionParameter parameter )
     {
         createComposite( parent );
-        
+
         if ( listener != null )
         {
             setConnectionParameterPageModifyListener( listener );
         }
-        
+
         if ( parameter != null )
         {
             loadParameters( parameter );
         }
-        
+
         initListeners();
         connectionPageModified();
     }

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageManager.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageManager.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageManager.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageManager.java Fri Aug 18 16:24:32 2017
@@ -47,8 +47,8 @@ public final class ConnectionParameterPa
     private ConnectionParameterPageManager()
     {
     }
-    
-    
+
+
     /**
      * Gets the connection parameter pages by searching for connection parameter page
      * extensions.
@@ -61,13 +61,11 @@ public final class ConnectionParameterPa
         IExtensionPoint extensionPoint = registry.getExtensionPoint( ConnectionUIPlugin.getDefault()
             .getPluginProperties().getString( "ExtensionPoint_ConnectionParameterPages_id" ) ); //$NON-NLS-1$
         IConfigurationElement[] members = extensionPoint.getConfigurationElements();
-        final Map<String, ConnectionParameterPage> pageMap = new ConcurrentHashMap<String, ConnectionParameterPage>();
+        final Map<String, ConnectionParameterPage> pageMap = new ConcurrentHashMap<>();
 
         // For each extension: instantiate the page
-        for ( int m = 0; m < members.length; m++ )
+        for ( IConfigurationElement member : members )
         {
-            IConfigurationElement member = members[m];
-            
             try
             {
                 ConnectionParameterPage page = ( ConnectionParameterPage ) member.createExecutableExtension( "class" ); //$NON-NLS-1$
@@ -87,22 +85,20 @@ public final class ConnectionParameterPa
                             IStatus.ERROR,
                             ConnectionUIConstants.PLUGIN_ID,
                             1,
-                            Messages.getString( "ConnectionParameterPageManager.UnableCreateConnectionParamPage" ) + member.getAttribute( "class" ), e ) ); //$NON-NLS-1$//$NON-NLS-2$
+                            Messages.getString( "ConnectionParameterPageManager.UnableCreateConnectionParamPage" ) //$NON-NLS-1$
+                                + member.getAttribute( "class" ), //$NON-NLS-1$
+                            e ) );
             }
         }
 
         final ConnectionParameterPage[] pages = pageMap.values().toArray( new ConnectionParameterPage[0] );
-        
-        Comparator<? super ConnectionParameterPage> pageComparator = new Comparator<ConnectionParameterPage>()
-        {
-            /**
-             * {@inheritDoc}
-             */
-            public int compare( ConnectionParameterPage page1, ConnectionParameterPage page2 )
+
+        Comparator<? super ConnectionParameterPage> pageComparator = 
+            ( ConnectionParameterPage page1, ConnectionParameterPage page2 ) ->
             {
                 String dependsOnId1 = page1.getPageDependsOnId();
                 String dependsOnId2 = page2.getPageDependsOnId();
-                
+
                 do
                 {
                     if ( ( dependsOnId1 == null ) && ( dependsOnId2 != null ) )
@@ -123,7 +119,7 @@ public final class ConnectionParameterPa
                     }
 
                     ConnectionParameterPage page = pageMap.get( dependsOnId1 );
-                    
+
                     if ( ( page != null ) && !page.getPageDependsOnId().equals( dependsOnId1 ) )
                     {
                         dependsOnId1 = page.getPageDependsOnId();
@@ -137,7 +133,7 @@ public final class ConnectionParameterPa
 
                 dependsOnId1 = page1.getPageDependsOnId();
                 dependsOnId2 = page2.getPageDependsOnId();
-                
+
                 do
                 {
                     if ( ( dependsOnId1 == null ) && ( dependsOnId2 != null ) )
@@ -171,9 +167,8 @@ public final class ConnectionParameterPa
                 while ( ( dependsOnId2 != null ) && !dependsOnId2.equals( page2.getPageId() ) );
 
                 return 0;
-            }
-        };
-        
+            };
+
         Arrays.sort( pages, pageComparator );
 
         return pages;

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUICertificateHandler.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUICertificateHandler.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUICertificateHandler.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUICertificateHandler.java Fri Aug 18 16:24:32 2017
@@ -44,18 +44,12 @@ public class ConnectionUICertificateHand
     {
         // open dialog
         final TrustLevel[] trustLevel = new TrustLevel[1];
-        PlatformUI.getWorkbench().getDisplay().syncExec( new Runnable()
+        PlatformUI.getWorkbench().getDisplay().syncExec( () ->
         {
-            /**
-             * {@inheritDoc}
-             */
-            public void run()
-            {
-                CertificateTrustDialog dialog = new CertificateTrustDialog( PlatformUI.getWorkbench().getDisplay()
-                    .getActiveShell(), host, certChain, failCauses );
-                dialog.open();
-                trustLevel[0] = dialog.getTrustLevel();
-            }
+            CertificateTrustDialog dialog = new CertificateTrustDialog( PlatformUI.getWorkbench().getDisplay()
+                .getActiveShell(), host, certChain, failCauses );
+            dialog.open();
+            trustLevel[0] = dialog.getTrustLevel();
         } );
 
         return trustLevel[0];

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIConstants.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIConstants.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIConstants.java Fri Aug 18 16:24:32 2017
@@ -111,6 +111,7 @@ public final class ConnectionUIConstants
     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),

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIPlugin.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIPlugin.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIPlugin.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIPlugin.java Fri Aug 18 16:24:32 2017
@@ -69,6 +69,7 @@ public class ConnectionUIPlugin extends
     /**
      * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
      */
+    @Override
     public void start( BundleContext context ) throws Exception
     {
         super.start( context );
@@ -93,6 +94,7 @@ public class ConnectionUIPlugin extends
     /**
      * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
      */
+    @Override
     public void stop( BundleContext context ) throws Exception
     {
         plugin = null;
@@ -144,7 +146,7 @@ public class ConnectionUIPlugin extends
         if ( key != null )
         {
             URL url = FileLocator.find( getBundle(), new Path( key ), null );
-            
+
             if ( url != null )
             {
                 return ImageDescriptor.createFromURL( url );
@@ -169,18 +171,18 @@ public class ConnectionUIPlugin extends
     public Image getImage( String key )
     {
         Image image = getImageRegistry().get( key );
-        
+
         if ( image == null )
         {
             ImageDescriptor imageDescriptor = getImageDescriptor( key );
-            
+
             if ( imageDescriptor != null )
             {
                 image = imageDescriptor.createImage();
                 getImageRegistry().put( key, image );
             }
         }
-        
+
         return image;
     }
 

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIReferralHandler.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIReferralHandler.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIReferralHandler.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIReferralHandler.java Fri Aug 18 16:24:32 2017
@@ -45,7 +45,7 @@ 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 ConcurrentHashMap<String, Connection>();
+    private Map<String, Connection> referralUrlToReferralConnectionCache = new ConcurrentHashMap<>();
 
 
     /**
@@ -74,7 +74,7 @@ public class ConnectionUIReferralHandler
     public Connection getReferralConnection( final List<String> referralUrls )
     {
         final Connection[] referralConnections = new Connection[1];
-        
+
         try
         {
             // check cache
@@ -88,7 +88,7 @@ public class ConnectionUIReferralHandler
                     Connection referralConnection = referralUrlToReferralConnectionCache.get( normalizedUrl );
                     Connection[] connections = ConnectionCorePlugin.getDefault().getConnectionManager()
                         .getConnections();
-                    
+
                     for ( Connection connection : connections )
                     {
                         if ( connection.equals( referralConnection ) )
@@ -103,22 +103,16 @@ public class ConnectionUIReferralHandler
             }
 
             // open dialog
-            PlatformUI.getWorkbench().getDisplay().syncExec( new Runnable()
+            PlatformUI.getWorkbench().getDisplay().syncExec( () ->
             {
-                /**
-                 * {@inheritDoc}
-                 */
-                public void run()
+                SelectReferralConnectionDialog dialog = new SelectReferralConnectionDialog( PlatformUI
+                    .getWorkbench()
+                    .getDisplay().getActiveShell(), referralUrls );
+
+                if ( dialog.open() == SelectReferralConnectionDialog.OK )
                 {
-                    SelectReferralConnectionDialog dialog = new SelectReferralConnectionDialog( PlatformUI
-                        .getWorkbench()
-                        .getDisplay().getActiveShell(), referralUrls );
-                    
-                    if ( dialog.open() == SelectReferralConnectionDialog.OK )
-                    {
-                        Connection connection = dialog.getReferralConnection();
-                        referralConnections[0] = connection;
-                    }
+                    Connection connection = dialog.getReferralConnection();
+                    referralConnections[0] = connection;
                 }
             } );
 

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ExceptionHandler.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ExceptionHandler.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ExceptionHandler.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ExceptionHandler.java Fri Aug 18 16:24:32 2017
@@ -63,17 +63,10 @@ public class ExceptionHandler
         }
         else
         {
-            Runnable runnable = new Runnable()
-            {
-                /**
-                 * {@inheritDoc}
-                 */
-                public void run()
-                {
-                    ErrorDialog.openError( Display.getDefault().getActiveShell(), Messages
-                        .getString( "ExceptionHandler.Error" ), message, status ); //$NON-NLS-1$
-                }
-            };
+            Runnable runnable = () -> 
+                ErrorDialog.openError( Display.getDefault().getActiveShell(), Messages
+                    .getString( "ExceptionHandler.Error" ), message, status ); //$NON-NLS-1$
+            
             Display.getDefault().asyncExec( runnable );
         }
 

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/Messages.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/Messages.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/Messages.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/Messages.java Fri Aug 18 16:24:32 2017
@@ -32,9 +32,10 @@ import java.util.ResourceBundle;
 public final class Messages
 {
     /** The resource name */
-    private static final ResourceBundle RESOURCE_BUNDLE = 
-        ResourceBundle.getBundle( Messages.class.getPackage().getName() + ".messages" );
-    
+    private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+        .getBundle( Messages.class.getPackage().getName() + ".messages" );
+
+
     /**
      * A private constructor : this is an utility class
      */
@@ -42,7 +43,7 @@ public final class Messages
     {
     }
 
-    
+
     /**
      * Get back a message from the resource file given a key
      * 

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/PasswordsKeyStoreManagerUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/PasswordsKeyStoreManagerUtils.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/PasswordsKeyStoreManagerUtils.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/PasswordsKeyStoreManagerUtils.java Fri Aug 18 16:24:32 2017
@@ -44,8 +44,8 @@ public final class PasswordsKeyStoreMana
     private PasswordsKeyStoreManagerUtils()
     {
     }
-    
-    
+
+
     /**
      * Checks if the passwords keystore is enabled.
      *
@@ -55,7 +55,8 @@ public final class PasswordsKeyStoreMana
     public static boolean isPasswordsKeystoreEnabled()
     {
         return ConnectionCorePlugin.getDefault().getPluginPreferences()
-            .getInt( ConnectionCoreConstants.PREFERENCE_CONNECTIONS_PASSWORDS_KEYSTORE ) == ConnectionCoreConstants.PREFERENCE_CONNECTIONS_PASSWORDS_KEYSTORE_ON;
+            .getInt(
+                ConnectionCoreConstants.PREFERENCE_CONNECTIONS_PASSWORDS_KEYSTORE ) == ConnectionCoreConstants.PREFERENCE_CONNECTIONS_PASSWORDS_KEYSTORE_ON;
     }
 
 
@@ -67,79 +68,77 @@ public final class PasswordsKeyStoreMana
      */
     public static boolean askUserToLoadKeystore()
     {
-        final boolean keystoreLoaded[] = new boolean[1];
+        final boolean[] keystoreLoaded = new boolean[1];
         keystoreLoaded[0] = false;
 
-        PlatformUI.getWorkbench().getDisplay().syncExec( new Runnable()
+        PlatformUI.getWorkbench().getDisplay().syncExec( () ->
         {
-            /**
-             * {@inheritDoc}
-             */
-            public void run()
+            while ( true )
             {
-                while ( true )
-                {
-                    // Getting the shell
-                    Shell shell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
+                // Getting the shell
+                Shell shell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
 
-                    // We ask the user for the keystore password
-                    PasswordDialog passwordDialog = new PasswordDialog( shell, Messages
-                        .getString( "PasswordsKeyStoreManagerUtils.VerifyMasterPassword" ), //$NON-NLS-1$
-                        Messages.getString( "PasswordsKeyStoreManagerUtils.PleaseEnterMasterPassword" ), null ); //$NON-NLS-1$
+                // We ask the user for the keystore password
+                PasswordDialog passwordDialog = new PasswordDialog( shell, Messages
+                    .getString( "PasswordsKeyStoreManagerUtils.VerifyMasterPassword" ), //$NON-NLS-1$
+                    Messages.getString( "PasswordsKeyStoreManagerUtils.PleaseEnterMasterPassword" ), null ); //$NON-NLS-1$
 
-                    if ( passwordDialog.open() == PasswordDialog.CANCEL )
-                    {
-                        // The user cancelled the action
-                        keystoreLoaded[0] = false;
-                        return;
-                    }
+                if ( passwordDialog.open() == PasswordDialog.CANCEL )
+                {
+                    // The user cancelled the action
+                    keystoreLoaded[0] = false;
+                    return;
+                }
 
-                    // Getting the password
-                    String masterPassword = passwordDialog.getPassword();
+                // Getting the password
+                String masterPassword = passwordDialog.getPassword();
 
-                    // Checking the password
-                    Exception checkPasswordException = null;
-                    try
-                    {
-                        if ( ConnectionCorePlugin.getDefault().getPasswordsKeyStoreManager()
-                            .checkMasterPassword( masterPassword ) )
-                        {
-                            keystoreLoaded[0] = true;
-                            break;
-                        }
-                    }
-                    catch ( KeyStoreException e )
+                // Checking the password
+                Exception checkPasswordException = null;
+                try
+                {
+                    if ( ConnectionCorePlugin.getDefault().getPasswordsKeyStoreManager()
+                        .checkMasterPassword( masterPassword ) )
                     {
-                        checkPasswordException = e;
+                        keystoreLoaded[0] = true;
+                        break;
                     }
+                }
+                catch ( KeyStoreException e )
+                {
+                    checkPasswordException = e;
+                }
 
-                    // Creating the message
-                    String message = null;
+                // Creating the message
+                String message = null;
 
-                    if ( checkPasswordException == null )
-                    {
-                        message = Messages.getString( "PasswordsKeyStoreManagerUtils.MasterPasswordVerificationFailed" ); //$NON-NLS-1$
-                    }
-                    else
-                    {
-                        message = Messages
-                            .getString( "PasswordsKeyStoreManagerUtils.MasterPasswordVerificationFailedWithException" ) //$NON-NLS-1$
-                            + checkPasswordException.getMessage();
-                    }
+                if ( checkPasswordException == null )
+                {
+                    message = Messages
+                        .getString( "PasswordsKeyStoreManagerUtils.MasterPasswordVerificationFailed" ); //$NON-NLS-1$
+                }
+                else
+                {
+                    message = Messages
+                        .getString( "PasswordsKeyStoreManagerUtils.MasterPasswordVerificationFailedWithException" ) //$NON-NLS-1$
+                        + checkPasswordException.getMessage();
+                }
 
-                    // We ask the user if he wants to retry to unlock the passwords keystore
-                    MessageDialog errorDialog = new MessageDialog(
-                        shell,
-                        Messages.getString( "PasswordsKeyStoreManagerUtils.VerifyMasterPasswordFailed" ), null, message, MessageDialog.ERROR, new String[] //$NON-NLS-1$
-                            { IDialogConstants.RETRY_LABEL,
-                                IDialogConstants.CANCEL_LABEL }, 0 );
+                // We ask the user if he wants to retry to unlock the passwords keystore
+                MessageDialog errorDialog = new MessageDialog(
+                    shell,
+                    Messages.getString( "PasswordsKeyStoreManagerUtils.VerifyMasterPasswordFailed" ), null, message, //$NON-NLS-1$
+                    MessageDialog.ERROR, new String[]
+                    {
+                        IDialogConstants.RETRY_LABEL,
+                        IDialogConstants.CANCEL_LABEL },
+                    0 );
 
-                    if ( errorDialog.open() == MessageDialog.CANCEL )
-                    {
-                        // The user cancelled the action
-                        keystoreLoaded[0] = false;
-                        return;
-                    }
+                if ( errorDialog.open() == MessageDialog.CANCEL )
+                {
+                    // The user cancelled the action
+                    keystoreLoaded[0] = false;
+                    return;
                 }
             }
         } );

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/RunnableContextRunner.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/RunnableContextRunner.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/RunnableContextRunner.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/RunnableContextRunner.java Fri Aug 18 16:24:32 2017
@@ -46,6 +46,11 @@ import org.eclipse.ui.PlatformUI;
  */
 public class RunnableContextRunner
 {
+    private RunnableContextRunner()
+    {
+        // Nothing to do
+    }
+    
     /**
      * Executes the given job within the given runnable context.
      * 
@@ -70,7 +75,7 @@ public class RunnableContextRunner
 
                 // ensure that connections are opened
                 Connection[] connections = runnable.getConnections();
-                
+
                 if ( connections != null )
                 {
                     for ( Connection connection : connections )
@@ -82,7 +87,7 @@ public class RunnableContextRunner
                             spm[0].worked( 1 );
 
                             connection.getConnectionWrapper().connect( spm[0] );
-                            
+
                             if ( connection.getConnectionWrapper().isConnected() )
                             {
                                 connection.getConnectionWrapper().bind( spm[0] );
@@ -95,7 +100,7 @@ public class RunnableContextRunner
                                 {
                                     listener.connectionOpened( connection, spm[0] );
                                 }
-                                
+
                                 ConnectionEventRegistry.fireConnectionOpened( connection, this );
                             }
                         }
@@ -110,7 +115,7 @@ public class RunnableContextRunner
                         {
                             StudioConnectionBulkRunnableWithProgress bulkRunnable = ( StudioConnectionBulkRunnableWithProgress ) runnable;
                             ConnectionEventRegistry.suspendEventFiringInCurrentThread();
-                            
+
                             try
                             {
                                 bulkRunnable.run( spm[0] );
@@ -119,7 +124,7 @@ public class RunnableContextRunner
                             {
                                 ConnectionEventRegistry.resumeEventFiringInCurrentThread();
                             }
-                            
+
                             bulkRunnable.runNotification( spm[0] );
                         }
                         else
@@ -155,7 +160,7 @@ public class RunnableContextRunner
         }
 
         IStatus status = spm[0].getErrorStatus( runnable.getErrorMessage() );
-        
+
         if ( ( handleError && !spm[0].isCanceled() ) && !status.isOK() )
         {
             ConnectionUIPlugin.getDefault().getExceptionHandler().handleException( status );

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/UIAuthHandler.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/UIAuthHandler.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/UIAuthHandler.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/UIAuthHandler.java Fri Aug 18 16:24:32 2017
@@ -113,22 +113,21 @@ public class UIAuthHandler implements IA
     {
         final String[] password = new String[1];
 
-        PlatformUI.getWorkbench().getDisplay().syncExec( new Runnable()
+        PlatformUI.getWorkbench().getDisplay().syncExec( () -> 
         {
-            public void run()
-            {
-                PasswordDialog dialog = new PasswordDialog(
-                    PlatformUI.getWorkbench().getDisplay().getActiveShell(),
-                    NLS.bind(
-                        Messages.getString( "UIAuthHandler.EnterPasswordFor" ), new String[] { connectionParameter.getName() } ), //$NON-NLS-1$
-                    NLS.bind(
-                        Messages.getString( "UIAuthHandler.PleaseEnterPasswordOfUser" ), connectionParameter.getBindPrincipal() ), 
-                                    StringUtils.EMPTY ); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+            PasswordDialog dialog = new PasswordDialog(
+                PlatformUI.getWorkbench().getDisplay().getActiveShell(),
+                NLS.bind(
+                    Messages.getString( "UIAuthHandler.EnterPasswordFor" ), new String[] //$NON-NLS-1$
+                { connectionParameter.getName() } ),
+                NLS.bind(
+                    Messages.getString( "UIAuthHandler.PleaseEnterPasswordOfUser" ),
+                    connectionParameter.getBindPrincipal() ),
+                StringUtils.EMPTY ); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
 
-                if ( dialog.open() == PasswordDialog.OK )
-                {
-                    password[0] = dialog.getPassword();
-                }
+            if ( dialog.open() == PasswordDialog.OK )
+            {
+                password[0] = dialog.getPassword();
             }
         } );
 

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CloseConnectionAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CloseConnectionAction.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CloseConnectionAction.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CloseConnectionAction.java Fri Aug 18 16:24:32 2017
@@ -92,6 +92,7 @@ public class CloseConnectionAction exten
             if ( connection.getConnectionWrapper().isConnected() )
             {
                 canClose = true;
+                
                 break;
             }
         }

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CollapseAllAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CollapseAllAction.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CollapseAllAction.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CollapseAllAction.java Fri Aug 18 16:24:32 2017
@@ -41,16 +41,15 @@ public class CollapseAllAction extends A
     /**
      * Creates a new instance of CollapseAllAction.
      *
-     * @param viewer
-     *      the attached Viewer
+     * @param viewer the attached Viewer
      */
     public CollapseAllAction( TreeViewer viewer )
     {
         super(
             Messages.getString( "CollapseAllAction.CollapseAll" ), 
                 ConnectionUIPlugin.getDefault().getImageDescriptor( ConnectionUIConstants.IMG_COLLAPSEALL ) ); //$NON-NLS-1$
-        super.setToolTipText( getText() );
-        super.setEnabled( true );
+        setToolTipText( getText() );
+        setEnabled( true );
 
         this.viewer = viewer;
     }
@@ -59,6 +58,7 @@ public class CollapseAllAction extends A
     /**
      * {@inheritDoc}
      */
+    @Override
     public void run()
     {
         this.viewer.collapseAll();

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/ConnectionViewActionProxy.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/ConnectionViewActionProxy.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/ConnectionViewActionProxy.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/ConnectionViewActionProxy.java Fri Aug 18 16:24:32 2017
@@ -44,5 +44,4 @@ public class ConnectionViewActionProxy e
     {
         super( viewer, actionHandlerManager, action );
     }
-
 }

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CopyAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CopyAction.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CopyAction.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/CopyAction.java Fri Aug 18 16:24:32 2017
@@ -130,13 +130,13 @@ public class CopyAction extends StudioAc
     {
         Connection[] connections = getSelectedConnections();
         ConnectionFolder[] connectionFolders = getSelectedConnectionFolders();
-        List<Object> objects = new ArrayList<Object>();
+        List<Object> objects = new ArrayList<>();
         objects.addAll( Arrays.asList( connections ) );
         objects.addAll( Arrays.asList( connectionFolders ) );
         String urls = getSelectedConnectionUrls();
 
         // copy to clipboard
-        if ( objects != null )
+        if ( !objects.isEmpty() )
         {
             if ( urls != null && urls.length() > 0 )
             {
@@ -206,8 +206,7 @@ public class CopyAction extends StudioAc
         StringBuilder buffer = new StringBuilder();
 
         Connection[] connections = getSelectedConnections();
-        ConnectionParameterPage[] connectionParameterPages = ConnectionParameterPageManager
-            .getConnectionParameterPages();
+        ConnectionParameterPage[] connectionParameterPages = ConnectionParameterPageManager.getConnectionParameterPages();
         
         for ( Connection connection : connections )
         {

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/DeleteAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/DeleteAction.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/DeleteAction.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/DeleteAction.java Fri Aug 18 16:24:32 2017
@@ -188,9 +188,9 @@ public class DeleteAction extends Studio
 
     private List<ConnectionFolder> getConnectionsFoldersToDelete()
     {
-        List<ConnectionFolder> selectedFolders = new ArrayList<ConnectionFolder>( Arrays
+        List<ConnectionFolder> selectedFolders = new ArrayList<>( Arrays
             .asList( getSelectedConnectionFolders() ) );
-        List<ConnectionFolder> foldersToDelete = new ArrayList<ConnectionFolder>();
+        List<ConnectionFolder> foldersToDelete = new ArrayList<>();
         
         while ( !selectedFolders.isEmpty() )
         {
@@ -223,10 +223,10 @@ public class DeleteAction extends Studio
 
     private List<Connection> getConnectionsToDelete()
     {
-        List<ConnectionFolder> selectedFolders = new ArrayList<ConnectionFolder>( Arrays
+        List<ConnectionFolder> selectedFolders = new ArrayList<>( Arrays
             .asList( getSelectedConnectionFolders() ) );
-        List<Connection> selectedConnections = new ArrayList<Connection>( Arrays.asList( getSelectedConnections() ) );
-        List<Connection> connectionsToDelete = new ArrayList<Connection>( selectedConnections );
+        List<Connection> selectedConnections = new ArrayList<>( Arrays.asList( getSelectedConnections() ) );
+        List<Connection> connectionsToDelete = new ArrayList<>( selectedConnections );
         
         while ( !selectedFolders.isEmpty() )
         {
@@ -277,8 +277,7 @@ public class DeleteAction extends Studio
     /**
      * Deletes Connections
      *
-     * @param connectionsToDelete
-     *      the Connections to delete
+     * @param connectionsToDelete the Connections to delete
      */
     private void deleteConnections( List<Connection> connectionsToDelete )
     {
@@ -294,8 +293,7 @@ public class DeleteAction extends Studio
     /**
      * Deletes Connection Folders
      *
-     * @param connectionsFoldersToDelete
-     *      the Connection Folders to delete
+     * @param connectionsFoldersToDelete the Connection Folders to delete
      */
     private void deleteConnectionFolders( List<ConnectionFolder> connectionsFoldersToDelete )
     {

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/ExpandAllAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/ExpandAllAction.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/ExpandAllAction.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/ExpandAllAction.java Fri Aug 18 16:24:32 2017
@@ -58,6 +58,7 @@ public class ExpandAllAction extends Act
     /**
      * {@inheritDoc}
      */
+    @Override
     public void run()
     {
         viewer.expandAll();

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/NewConnectionAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/NewConnectionAction.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/NewConnectionAction.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/NewConnectionAction.java Fri Aug 18 16:24:32 2017
@@ -46,7 +46,7 @@ public class NewConnectionAction extends
      */
     public void run()
     {
-        List<Object> selectedObjects = new ArrayList<Object>();
+        List<Object> selectedObjects = new ArrayList<>();
         selectedObjects.addAll( Arrays.asList( getSelectedConnectionFolders() ) );
         selectedObjects.addAll( Arrays.asList( getSelectedConnections() ) );
 

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PasteAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PasteAction.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PasteAction.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PasteAction.java Fri Aug 18 16:24:32 2017
@@ -175,7 +175,7 @@ public class PasteAction extends StudioA
      */
     private List<Connection> getConnectionsToPaste()
     {
-        List<Connection> connections = new ArrayList<Connection>();
+        List<Connection> connections = new ArrayList<>();
 
         // first check for Connection objects in the clipboard
         Object content = getFromClipboard( ConnectionTransfer.getInstance() );
@@ -205,7 +205,7 @@ public class PasteAction extends StudioA
 
     private List<Connection> getConnectionsByLdapUrl()
     {
-        List<Connection> connections = new ArrayList<Connection>();
+        List<Connection> connections = new ArrayList<>();
 
         Object content = getFromClipboard( TextTransfer.getInstance() );
         
@@ -254,7 +254,7 @@ public class PasteAction extends StudioA
      */
     private List<ConnectionFolder> getConnectionFoldersToPaste()
     {
-        List<ConnectionFolder> folders = new ArrayList<ConnectionFolder>();
+        List<ConnectionFolder> folders = new ArrayList<>();
 
         Object content = this.getFromClipboard( ConnectionTransfer.getInstance() );
         

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PropertiesAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PropertiesAction.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PropertiesAction.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PropertiesAction.java Fri Aug 18 16:24:32 2017
@@ -86,24 +86,25 @@ public class PropertiesAction extends St
 
         if ( getSelectedConnections().length == 1 )
         {
-            element = ( IAdaptable ) getSelectedConnections()[0];
-            pageId = ConnectionUIPlugin.getDefault().getPluginProperties().getString( "Prop_ConnectionPropertyPage_id" ); //$NON-NLS-1$
+            element = getSelectedConnections()[0];
+            pageId = ConnectionUIPlugin.getDefault().getPluginProperties()
+                .getString( "Prop_ConnectionPropertyPage_id" ); //$NON-NLS-1$
             title = getSelectedConnections()[0].getName();
         }
 
         if ( element != null )
         {
             PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn( getShell(), element, pageId, null, null );
-            
+
             if ( dialog != null )
             {
                 title = Utils.shorten( title, 30 );
             }
-            
+
             dialog.getShell().setText(
-                NLS.bind( Messages.getString( "PropertiesAction.PropertiesFor" ), new String[] { title } ) ); //$NON-NLS-1$
+                NLS.bind( Messages.getString( "PropertiesAction.PropertiesFor" ), new String[] //$NON-NLS-1$
+                { title } ) );
             dialog.open();
-
         }
     }
 }

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/RenameAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/RenameAction.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/RenameAction.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/RenameAction.java Fri Aug 18 16:24:32 2017
@@ -114,12 +114,7 @@ public class RenameAction extends Studio
      */
     private void renameConnection( final Connection connection )
     {
-        IInputValidator validator = new IInputValidator()
-        {
-            /**
-             * {@inheritDoc}
-             */
-            public String isValid( String newName )
+        IInputValidator validator = newName ->
             {
                 if ( connection.getName().equals( newName ) )
                 {
@@ -133,8 +128,7 @@ public class RenameAction extends Studio
                 {
                     return Messages.getString( "RenameAction.ConnectionAlreadyExists" ); //$NON-NLS-1$
                 }
-            }
-        };
+            };
 
         InputDialog dialog = new InputDialog(
             getShell(),
@@ -154,17 +148,11 @@ public class RenameAction extends Studio
     /**
      * Renames a ConnectionFolder.
      *
-     * @param connectionFolder
-     *      the ConnectionFolder to rename
+     * @param connectionFolder the ConnectionFolder to rename
      */
     private void renameConnectionFolder( final ConnectionFolder connectionFolder )
     {
-        IInputValidator validator = new IInputValidator()
-        {
-            /**
-             * {@inheritDoc}
-             */
-            public String isValid( String newName )
+        IInputValidator validator = newName ->
             {
                 if ( connectionFolder.getName().equals( newName ) )
                 {
@@ -179,8 +167,7 @@ public class RenameAction extends Studio
                 {
                     return Messages.getString( "RenameAction.ConnectionFolderAlreadyExists" ); //$NON-NLS-1$
                 }
-            }
-        };
+            };
 
         InputDialog dialog = new InputDialog(
             getShell(),

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/SelectionUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/SelectionUtils.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/SelectionUtils.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/SelectionUtils.java Fri Aug 18 16:24:32 2017
@@ -22,7 +22,6 @@ package org.apache.directory.studio.conn
 
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.directory.studio.connection.core.Connection;
@@ -62,17 +61,14 @@ public class SelectionUtils
      */
     private static List<Object> getTypes( ISelection selection, Class<?> type )
     {
-        List<Object> list = new ArrayList<Object>();
+        List<Object> list = new ArrayList<>();
         
         if ( selection instanceof IStructuredSelection )
         {
             IStructuredSelection structuredSelection = ( IStructuredSelection ) selection;
-            Iterator<?> iterator = structuredSelection.iterator();
             
-            while ( iterator.hasNext() )
+            for ( Object object : structuredSelection.toList() )
             {
-                Object object = iterator.next();
-                
                 if ( type.isInstance( object ) )
                 {
                     list.add( object );

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioAction.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioAction.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioAction.java Fri Aug 18 16:24:32 2017
@@ -240,8 +240,7 @@ public abstract class StudioAction imple
     /**
      * Sets the selected connection folders.
      *
-     * @param selectedConnectionFolders
-     *      the selected connections folders to set
+     * @param selectedConnectionFolders the selected connections folders to set
      */
     public void setSelectedConnectionFolders( ConnectionFolder[] selectedConnectionFolders )
     {

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioActionProxy.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioActionProxy.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioActionProxy.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioActionProxy.java Fri Aug 18 16:24:32 2017
@@ -213,7 +213,6 @@ public abstract class StudioActionProxy
         {
             action.setInput( input );
             selectionChanged( new SelectionChangedEvent( this.selectionProvider, new StructuredSelection() ) );
-            // updateAction();
         }
     }
 
@@ -252,6 +251,7 @@ public abstract class StudioActionProxy
     /**
      * @see org.eclipse.jface.action.Action#run()
      */
+    @Override
     public void run()
     {
         if ( !isDisposed() )

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/CertificateTrustDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/CertificateTrustDialog.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/CertificateTrustDialog.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/CertificateTrustDialog.java Fri Aug 18 16:24:32 2017
@@ -140,7 +140,6 @@ public class CertificateTrustDialog exte
         
         for ( ICertificateHandler.FailCause failCause : failCauses )
         {
-            // BaseWidgetUtils.createRadioIndent( failedCauseContainer, 1 );
             switch ( failCause )
             {
                 case SelfSignedCertificate:
@@ -185,6 +184,7 @@ public class CertificateTrustDialog exte
             /**
              * {@inheritDoc}
              */
+            @Override
             public void widgetSelected( final SelectionEvent event )
             {
                 CertificateTrustDialog.this.trustLevel = ICertificateHandler.TrustLevel.Not;
@@ -200,6 +200,7 @@ public class CertificateTrustDialog exte
             /**
              * {@inheritDoc}
              */
+            @Override
             public void widgetSelected( final SelectionEvent event )
             {
                 CertificateTrustDialog.this.trustLevel = ICertificateHandler.TrustLevel.Session;
@@ -214,6 +215,7 @@ public class CertificateTrustDialog exte
             /**
              * {@inheritDoc}
              */
+            @Override
             public void widgetSelected( final SelectionEvent event )
             {
                 CertificateTrustDialog.this.trustLevel = ICertificateHandler.TrustLevel.Permanent;

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/ConnectionFolderDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/ConnectionFolderDialog.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/ConnectionFolderDialog.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/ConnectionFolderDialog.java Fri Aug 18 16:24:32 2017
@@ -54,9 +54,9 @@ public class ConnectionFolderDialog exte
     /**
      * @see org.eclipse.jface.dialogs.InputDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
      */
+    @Override
     protected Control createDialogArea( Composite parent )
     {
-        Composite composite = ( Composite ) super.createDialogArea( parent );
-        return composite;
+        return super.createDialogArea( parent );
     }
 }

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/PasswordDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/PasswordDialog.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/PasswordDialog.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/PasswordDialog.java Fri Aug 18 16:24:32 2017
@@ -43,6 +43,17 @@ import org.eclipse.swt.widgets.Text;
  * The PasswordDialog is used to ask the user for password (credentials).
  * <p>
  * It has a useful checkbox that can show/hide the typed password.
+ * <pre>
+ * .--------------------------------------------------.
+ * |            Enter password for "xxxxx"            |
+ * +--------------------------------------------------+
+ * | Please enter password of user "yyyyyyyyyyyyy"    |
+ * | [----------------------------------------------] |
+ * | [ ] Show password                                |
+ * |                                                  |
+ * |                                (Cancel) (  OK  ) |
+ * .__________________________________________________.
+ * </pre>
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -93,6 +104,7 @@ public class PasswordDialog extends Dial
     /**
      * {@inheritDoc}
      */
+    @Override
     protected void configureShell( Shell shell )
     {
         super.configureShell( shell );
@@ -104,6 +116,7 @@ public class PasswordDialog extends Dial
     /**
      * {@inheritDoc}
      */
+    @Override
     protected void buttonPressed( int buttonId )
     {
         if ( buttonId == IDialogConstants.OK_ID )
@@ -127,6 +140,7 @@ public class PasswordDialog extends Dial
         /**
          * {@inheritDoc}
          */
+        @Override
         public void widgetSelected( SelectionEvent event )
         {
             if ( showPasswordCheckbox.getSelection() )
@@ -143,6 +157,7 @@ public class PasswordDialog extends Dial
     /**
      * {@inheritDoc}
      */
+    @Override
     protected Control createDialogArea( Composite parent )
     {
         // Composite

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/ResetPasswordDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/ResetPasswordDialog.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/ResetPasswordDialog.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/ResetPasswordDialog.java Fri Aug 18 16:24:32 2017
@@ -28,8 +28,6 @@ import org.apache.directory.studio.commo
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.layout.GridData;
@@ -116,6 +114,7 @@ public class ResetPasswordDialog extends
     /**
      * {@inheritDoc}
      */
+    @Override
     protected void configureShell( Shell shell )
     {
         super.configureShell( shell );
@@ -127,6 +126,7 @@ public class ResetPasswordDialog extends
     /**
      * {@inheritDoc}
      */
+    @Override
     protected void createButtonsForButtonBar( Composite parent )
     {
         okButton = createButton( parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true );
@@ -139,6 +139,7 @@ public class ResetPasswordDialog extends
     /**
      * {@inheritDoc}
      */
+    @Override
     protected void buttonPressed( int buttonId )
     {
         if ( buttonId == IDialogConstants.OK_ID )
@@ -159,6 +160,7 @@ public class ResetPasswordDialog extends
     /**
      * {@inheritDoc}
      */
+    @Override
     protected Control createDialogArea( Composite parent )
     {
         // Composite
@@ -192,16 +194,7 @@ public class ResetPasswordDialog extends
             Messages.getString( "ResetPasswordDialog.CurrentPasswordColon" ), 1 ); //$NON-NLS-1$
         currentPasswordText = BaseWidgetUtils.createText( currentPasswordGroup, StringUtils.EMPTY, 1 ); //$NON-NLS-1$
         currentPasswordText.setEchoChar( '\u2022' );
-        currentPasswordText.addModifyListener( new ModifyListener()
-        {
-            /**
-             * {@inheritDoc}
-             */
-            public void modifyText( ModifyEvent event )
-            {
-                validate();
-            }
-        } );
+        currentPasswordText.addModifyListener( event -> validate() );
 
         // Show Current Password Checkbox
         BaseWidgetUtils.createLabel( currentPasswordGroup, StringUtils.EMPTY, 1 ); //$NON-NLS-1$
@@ -212,6 +205,7 @@ public class ResetPasswordDialog extends
             /**
              * {@inheritDoc}
              */
+            @Override
             public void widgetSelected( SelectionEvent event )
             {
                 if ( showCurrentPasswordCheckbox.getSelection() )
@@ -234,16 +228,7 @@ public class ResetPasswordDialog extends
         BaseWidgetUtils.createLabel( newPasswordGroup, Messages.getString( "ResetPasswordDialog.NewPasswordColon" ), 1 ); //$NON-NLS-1$
         newPasswordText = BaseWidgetUtils.createText( newPasswordGroup, StringUtils.EMPTY, 1 ); //$NON-NLS-1$
         newPasswordText.setEchoChar( '\u2022' );
-        newPasswordText.addModifyListener( new ModifyListener()
-        {
-            /**
-             * {@inheritDoc}
-             */
-            public void modifyText( ModifyEvent event )
-            {
-                validate();
-            }
-        } );
+        newPasswordText.addModifyListener( event -> validate() );
 
         // Show New Password Checkbox
         BaseWidgetUtils.createLabel( newPasswordGroup, StringUtils.EMPTY, 1 ); //$NON-NLS-1$
@@ -254,6 +239,7 @@ public class ResetPasswordDialog extends
             /**
              * {@inheritDoc}
              */
+            @Override
             public void widgetSelected( SelectionEvent event )
             {
                 if ( showNewPasswordCheckbox.getSelection() )
@@ -272,16 +258,7 @@ public class ResetPasswordDialog extends
             Messages.getString( "ResetPasswordDialog.VerifyNewPasswordColon" ), 1 ); //$NON-NLS-1$
         verifyNewPasswordText = BaseWidgetUtils.createText( newPasswordGroup, StringUtils.EMPTY, 1 ); //$NON-NLS-1$
         verifyNewPasswordText.setEchoChar( '\u2022' );
-        verifyNewPasswordText.addModifyListener( new ModifyListener()
-        {
-            /**
-             * {@inheritDoc}
-             */
-            public void modifyText( ModifyEvent event )
-            {
-                validate();
-            }
-        } );
+        verifyNewPasswordText.addModifyListener( event -> validate() );
 
         // Show Verify New Password Checkbox
         BaseWidgetUtils.createLabel( newPasswordGroup, StringUtils.EMPTY, 1 ); //$NON-NLS-1$
@@ -292,6 +269,7 @@ public class ResetPasswordDialog extends
             /**
              * {@inheritDoc}
              */
+            @Override
             public void widgetSelected( SelectionEvent event )
             {
                 if ( showVerifyNewPasswordCheckbox.getSelection() )
@@ -340,11 +318,11 @@ public class ResetPasswordDialog extends
      */
     private void validate()
     {
-        String currentPassword = currentPasswordText.getText();
-        String newPassword = newPasswordText.getText();
-        String verifyNewPassword = verifyNewPasswordText.getText();
+        String currentPwd = currentPasswordText.getText();
+        String newPwd = newPasswordText.getText();
+        String verifyNewPwd = verifyNewPasswordText.getText();
 
-        okButton.setEnabled( !Strings.isEmpty( currentPassword ) && !Strings.isEmpty( newPassword ) && 
-                newPassword.equals( verifyNewPassword ) && !currentPassword.equals( newPassword ) ); //$NON-NLS-1$ //$NON-NLS-2$
+        okButton.setEnabled( !Strings.isEmpty( currentPwd ) && !Strings.isEmpty( newPwd ) && 
+                newPwd.equals( verifyNewPwd ) && !currentPwd.equals( newPwd ) ); //$NON-NLS-1$ //$NON-NLS-2$
     }
 }

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/SelectReferralConnectionDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/SelectReferralConnectionDialog.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/SelectReferralConnectionDialog.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/SelectReferralConnectionDialog.java Fri Aug 18 16:24:32 2017
@@ -35,11 +35,7 @@ import org.apache.directory.studio.conne
 import org.apache.directory.studio.connection.ui.widgets.ConnectionWidget;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
@@ -98,6 +94,7 @@ public class SelectReferralConnectionDia
     /**
      * {@inheritDoc}
      */
+    @Override
     protected void configureShell( Shell shell )
     {
         super.configureShell( shell );
@@ -108,6 +105,7 @@ public class SelectReferralConnectionDia
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean close()
     {
         if ( mainWidget != null )
@@ -130,6 +128,7 @@ public class SelectReferralConnectionDia
     /**
      * {@inheritDoc}
      */
+    @Override
     protected void cancelPressed()
     {
         selectedConnection = null;
@@ -140,6 +139,7 @@ public class SelectReferralConnectionDia
     /**
      * {@inheritDoc}
      */
+    @Override
     protected void createButtonsForButtonBar( Composite parent )
     {
         Button okButton = createButton( parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true );
@@ -162,6 +162,7 @@ public class SelectReferralConnectionDia
     /**
      * {@inheritDoc}
      */
+    @Override
     protected Control createDialogArea( Composite parent )
     {
         Composite composite = ( Composite ) super.createDialogArea( parent );
@@ -198,12 +199,7 @@ public class SelectReferralConnectionDia
         // create the listener
         universalListener = new ConnectionUniversalListener( mainWidget.getViewer() );
 
-        mainWidget.getViewer().addSelectionChangedListener( new ISelectionChangedListener()
-        {
-            /**
-             * {@inheritDoc}
-             */
-            public void selectionChanged( SelectionChangedEvent event )
+        mainWidget.getViewer().addSelectionChangedListener( event ->
             {
                 selectedConnection = null;
                 
@@ -218,15 +214,9 @@ public class SelectReferralConnectionDia
                 }
                 
                 validate();
-            }
-        } );
+            } );
 
-        mainWidget.getViewer().addDoubleClickListener( new IDoubleClickListener()
-        {
-            /**
-             * {@inheritDoc}
-             */
-            public void doubleClick( DoubleClickEvent event )
+        mainWidget.getViewer().addDoubleClickListener( event ->
             {
                 selectedConnection = null;
                 
@@ -241,8 +231,7 @@ public class SelectReferralConnectionDia
                 }
                 
                 validate();
-            }
-        } );
+            } );
 
         if ( referralUrls != null )
         {

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/SetupPasswordDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/SetupPasswordDialog.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/SetupPasswordDialog.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/SetupPasswordDialog.java Fri Aug 18 16:24:32 2017
@@ -28,8 +28,6 @@ import org.apache.directory.studio.commo
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.layout.GridData;
@@ -107,6 +105,7 @@ public class SetupPasswordDialog extends
     /**
      * {@inheritDoc}
      */
+    @Override
     protected void configureShell( Shell shell )
     {
         super.configureShell( shell );
@@ -118,6 +117,7 @@ public class SetupPasswordDialog extends
     /**
      * {@inheritDoc}
      */
+    @Override
     protected void createButtonsForButtonBar( Composite parent )
     {
         okButton = createButton( parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true );
@@ -130,6 +130,7 @@ public class SetupPasswordDialog extends
     /**
      * {@inheritDoc}
      */
+    @Override
     protected void buttonPressed( int buttonId )
     {
         if ( buttonId == IDialogConstants.OK_ID )
@@ -147,6 +148,7 @@ public class SetupPasswordDialog extends
     /**
      * {@inheritDoc}
      */
+    @Override
     protected Control createDialogArea( Composite parent )
     {
         // Composite
@@ -179,16 +181,7 @@ public class SetupPasswordDialog extends
         BaseWidgetUtils.createLabel( passwordGroup, Messages.getString( "SetupPasswordDialog.PasswordColon" ), 1 ); //$NON-NLS-1$
         passwordText = BaseWidgetUtils.createText( passwordGroup, value, 1 );
         passwordText.setEchoChar( '\u2022' );
-        passwordText.addModifyListener( new ModifyListener()
-        {
-            /**
-             * {@inheritDoc}
-             */
-            public void modifyText( ModifyEvent event )
-            {
-                validate();
-            }
-        } );
+        passwordText.addModifyListener( event -> validate() );
 
         // Show Password Checkbox
         BaseWidgetUtils.createLabel( passwordGroup, StringUtils.EMPTY, 1 ); //$NON-NLS-1$
@@ -199,6 +192,7 @@ public class SetupPasswordDialog extends
             /**
              * {@inheritDoc}
              */
+            @Override
             public void widgetSelected( SelectionEvent event )
             {
                 if ( showPasswordCheckbox.getSelection() )
@@ -216,16 +210,7 @@ public class SetupPasswordDialog extends
         BaseWidgetUtils.createLabel( passwordGroup, Messages.getString( "SetupPasswordDialog.VerifyPasswordColon" ), 1 ); //$NON-NLS-1$
         verifyPasswordText = BaseWidgetUtils.createText( passwordGroup, value, 1 );
         verifyPasswordText.setEchoChar( '\u2022' );
-        verifyPasswordText.addModifyListener( new ModifyListener()
-        {
-            /**
-             * {@inheritDoc}
-             */
-            public void modifyText( ModifyEvent event )
-            {
-                validate();
-            }
-        } );
+        verifyPasswordText.addModifyListener( event -> validate() );
 
         // Show Verify Password Checkbox
         BaseWidgetUtils.createLabel( passwordGroup, StringUtils.EMPTY, 1 ); //$NON-NLS-1$
@@ -236,6 +221,7 @@ public class SetupPasswordDialog extends
             /**
              * {@inheritDoc}
              */
+            @Override
             public void widgetSelected( SelectionEvent event )
             {
                 if ( showVerifyPasswordCheckbox.getSelection() )

Modified: directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/ConnectionTransfer.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/ConnectionTransfer.java?rev=1805443&r1=1805442&r2=1805443&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/ConnectionTransfer.java (original)
+++ directory/studio/branches/studio-value/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/ConnectionTransfer.java Fri Aug 18 16:24:32 2017
@@ -87,6 +87,7 @@ public final class ConnectionTransfer ex
      * It just converts the id of the connection or connection folder to the platform 
      * specific representation.
      */
+    @Override
     public void javaToNative( Object object, TransferData transferData )
     {
         if ( !( object instanceof Object[] ) )
@@ -98,31 +99,29 @@ public final class ConnectionTransfer ex
         {
             Object[] objects = ( Object[] ) object;
             
-            try
+            try ( ByteArrayOutputStream out = new ByteArrayOutputStream() )
             {
-                ByteArrayOutputStream out = new ByteArrayOutputStream();
-                DataOutputStream writeOut = new DataOutputStream( out );
-
-                for ( int i = 0; i < objects.length; i++ )
+                try ( DataOutputStream writeOut = new DataOutputStream( out ) )
                 {
-                    if ( objects[i] instanceof Connection )
-                    {
-                        byte[] idBytes = ( ( Connection ) objects[i] ).getConnectionParameter().getId().getBytes();
-                        writeOut.writeInt( idBytes.length );
-                        writeOut.write( idBytes );
-                    }
-                    else if ( objects[i] instanceof ConnectionFolder )
+                    for ( int i = 0; i < objects.length; i++ )
                     {
-                        byte[] idBytes = ( ( ConnectionFolder ) objects[i] ).getId().getBytes();
-                        writeOut.writeInt( idBytes.length );
-                        writeOut.write( idBytes );
+                        if ( objects[i] instanceof Connection )
+                        {
+                            byte[] idBytes = ( ( Connection ) objects[i] ).getConnectionParameter().getId().getBytes();
+                            writeOut.writeInt( idBytes.length );
+                            writeOut.write( idBytes );
+                        }
+                        else if ( objects[i] instanceof ConnectionFolder )
+                        {
+                            byte[] idBytes = ( ( ConnectionFolder ) objects[i] ).getId().getBytes();
+                            writeOut.writeInt( idBytes.length );
+                            writeOut.write( idBytes );
+                        }
                     }
+        
+                    byte[] buffer = out.toByteArray();
+                    super.javaToNative( buffer, transferData );
                 }
-
-                byte[] buffer = out.toByteArray();
-                writeOut.close();
-
-                super.javaToNative( buffer, transferData );
             }
             catch ( IOException e )
             {
@@ -140,6 +139,7 @@ public final class ConnectionTransfer ex
      * {@link Connection} object or {@link ConnectionFolderManager#getConnectionFolderById(String)}
      * to get the {@link ConnectionFolder} object.
      */
+    @Override
     public Object nativeToJava( TransferData transferData )
     {
         if ( isSupportedType( transferData ) )
@@ -151,42 +151,46 @@ public final class ConnectionTransfer ex
                 return null;
             }
 
-            List<Object> objectList = new ArrayList<Object>();
+            List<Object> objectList = new ArrayList<>();
             
-            try
+            try ( ByteArrayInputStream in = new ByteArrayInputStream( buffer ) )
             {
-                ByteArrayInputStream in = new ByteArrayInputStream( buffer );
-                DataInputStream readIn = new DataInputStream( in );
-
-                do
+                try ( DataInputStream readIn = new DataInputStream( in ) )
                 {
-                    if ( readIn.available() > 1 )
+                    do
                     {
-                        int size = readIn.readInt();
-                        byte[] idBytes = new byte[size];
-                        readIn.read( idBytes );
-                        Connection connection = ConnectionCorePlugin.getDefault().getConnectionManager()
-                            .getConnectionById( new String( idBytes ) );
-                        
-                        if ( connection == null )
+                        if ( readIn.available() > 1 )
                         {
-                            ConnectionFolder folder = ConnectionCorePlugin.getDefault().getConnectionFolderManager()
-                                .getConnectionFolderById( new String( idBytes ) );
+                            int size = readIn.readInt();
+                            byte[] idBytes = new byte[size];
                             
-                            if ( folder != null )
+                            if ( readIn.read( idBytes ) != size )
                             {
-                                objectList.add( folder );
+                                // We werev'nt able to read the full data : there is something wrong...
+                                return null;
+                            }
+                            
+                            Connection connection = ConnectionCorePlugin.getDefault().getConnectionManager()
+                                .getConnectionById( new String( idBytes ) );
+                            
+                            if ( connection == null )
+                            {
+                                ConnectionFolder folder = ConnectionCorePlugin.getDefault().getConnectionFolderManager()
+                                    .getConnectionFolderById( new String( idBytes ) );
+                                
+                                if ( folder != null )
+                                {
+                                    objectList.add( folder );
+                                }
+                            }
+                            else
+                            {
+                                objectList.add( connection );
                             }
-                        }
-                        else
-                        {
-                            objectList.add( connection );
                         }
                     }
+                    while ( readIn.available() > 1 );
                 }
-                while ( readIn.available() > 1 );
-
-                readIn.close();
             }
             catch ( IOException ex )
             {



Mime
View raw message