mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
18.18.2015 2f6d798e90520dd1b83ac30e53838ae6fd41a150
AutoRefactor'ed use multi-catch
16 files modified
141 ■■■■ changed files
opendj-server-legacy/src/main/java/org/forgerock/opendj/adapter/server3x/Converters.java 3 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/admin/ads/util/ConnectionUtils.java 19 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/ControlPanelInfo.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AddToGroupPanel.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewGroupPanel.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/uninstaller/UninstallCliHelper.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/uninstaller/ui/LoginDialog.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/BuildInformation.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/InstallerHelper.java 16 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/util/ServerController.java 9 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/AggregationPropertyDefinition.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/ClassPropertyDefinition.java 5 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/DNPropertyDefinition.java 4 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/client/cli/SecureConnectionCliArgs.java 23 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/server/ServerManagementContext.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/forgerock/opendj/adapter/server3x/Converters.java
@@ -43,7 +43,6 @@
import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.opendj.ldap.ByteStringBuilder;
import org.forgerock.opendj.ldap.DN;
import org.forgerock.opendj.ldap.DecodeException;
import org.forgerock.opendj.ldap.LdapException;
import org.forgerock.opendj.ldap.LinkedAttribute;
import org.forgerock.opendj.ldap.LinkedHashMapEntry;
@@ -477,8 +476,6 @@
                value = sdkReaderASN1.readOctetString();
            }
            sdkReaderASN1.readEndSequence();
        } catch (DecodeException e) {
            // Nothing to do.
        } catch (IOException e) {
            // Nothing to do.
        }
opendj-server-legacy/src/main/java/org/opends/admin/ads/util/ConnectionUtils.java
@@ -226,12 +226,8 @@
          TrustedSocketFactory.setCurrentThreadTrustManager(fTrustManager,
              fKeyManager);
          pair[0] = new InitialLdapContext(fEnv, null);
        } catch (NamingException ne) {
        } catch (NamingException | RuntimeException ne) {
          pair[1] = ne;
        } catch (RuntimeException re) {
          pair[1] = re;
        }
      }
    });
@@ -279,12 +275,8 @@
                fKeyManager);
          }
          pair[0] = new InitialLdapContext(fEnv, fNewCtls);
        } catch (NamingException ne) {
        } catch (NamingException | RuntimeException ne) {
          pair[1] = ne;
        } catch (RuntimeException re) {
          pair[1] = re;
        }
      }
    });
@@ -399,14 +391,9 @@
            result.reconnect(null);
          }
          pair[0] = result;
        } catch (NamingException ne)
        } catch (NamingException | RuntimeException ne)
        {
          pair[1] = ne;
        } catch (RuntimeException re)
        {
          pair[1] = re;
        }
      }
    });
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/ControlPanelInfo.java
@@ -543,11 +543,7 @@
                getTrustManager(), null);
          }
        }
        catch (ConfigReadException cre)
        {
//        Ignore: we will ask the user for credentials.
        }
        catch (NamingException ne)
        catch (ConfigReadException | NamingException cre)
        {
          // Ignore: we will ask the user for credentials.
        }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AddToGroupPanel.java
@@ -289,11 +289,7 @@
          e.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
          e.getDropTargetContext().dropComplete(true);
        }
        catch (IOException io)
        {
          e.rejectDrop();
        }
        catch (UnsupportedFlavorException ufe)
        catch (IOException | UnsupportedFlavorException io)
        {
          e.rejectDrop();
        }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewGroupPanel.java
@@ -596,11 +596,7 @@
          e.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
          e.getDropTargetContext().dropComplete(true);
        }
        catch (IOException io)
        {
          e.rejectDrop();
        }
        catch (UnsupportedFlavorException ufe)
        catch (IOException | UnsupportedFlavorException io)
        {
          e.rejectDrop();
        }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java
@@ -347,11 +347,7 @@
          e.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
          e.getDropTargetContext().dropComplete(true);
        }
        catch (IOException io)
        {
          e.rejectDrop();
        }
        catch (UnsupportedFlavorException ufe)
        catch (IOException | UnsupportedFlavorException io)
        {
          e.rejectDrop();
        }
opendj-server-legacy/src/main/java/org/opends/guitools/uninstaller/UninstallCliHelper.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.guitools.uninstaller;
@@ -888,11 +888,7 @@
        userData.setLocalServerUrl(adminConnectorUrl);
        couldConnect = true;
      }
      catch (ArgumentException e) {
        printErrorMessage(e.getMessageObject());
        println();
      }
      catch (ClientException e) {
      catch (ArgumentException | ClientException e) {
        printErrorMessage(e.getMessageObject());
        println();
      }
opendj-server-legacy/src/main/java/org/opends/guitools/uninstaller/ui/LoginDialog.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.guitools.uninstaller.ui;
@@ -419,13 +419,9 @@
            throw ne;
          }
          isServerRunning = Boolean.FALSE;
        } catch (ApplicationException e)
        } catch (ApplicationException | IllegalStateException e)
        {
          throw e;
        } catch (IllegalStateException ise)
        {
          throw ise;
        } catch (Throwable t)
        {
          throw new IllegalStateException("Unexpected throwable.", t);
opendj-server-legacy/src/main/java/org/opends/quicksetup/BuildInformation.java
@@ -157,15 +157,11 @@
          }
        }
      }
    } catch (IOException e) {
    } catch (IOException | InterruptedException e) {
      throw new ApplicationException(
          ReturnCode.START_ERROR,
          INFO_ERROR_CREATING_BUILD_INFO.get(), e);
    } catch (InterruptedException ie) {
      throw new ApplicationException(
          ReturnCode.START_ERROR,
          INFO_ERROR_CREATING_BUILD_INFO.get(), ie);
    } finally {
      done[0] = true;
      StaticUtils.close(is, out);
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/InstallerHelper.java
@@ -298,18 +298,10 @@
      writer.writeEntry(entry);
      writer.close();
    } catch (DirectoryException de) {
    } catch (DirectoryException | LDIFException | IOException de) {
      throw new ApplicationException(
          ReturnCode.CONFIGURATION_ERROR,
              getThrowableMsg(INFO_ERROR_IMPORTING_LDIF.get(), de), de);
    } catch (LDIFException le) {
      throw new ApplicationException(
          ReturnCode.CONFIGURATION_ERROR,
              getThrowableMsg(INFO_ERROR_IMPORTING_LDIF.get(), le), le);
    } catch (IOException ioe) {
      throw new ApplicationException(
          ReturnCode.CONFIGURATION_ERROR,
              getThrowableMsg(INFO_ERROR_IMPORTING_LDIF.get(), ioe), ioe);
    } catch (Throwable t) {
      throw new ApplicationException(
          ReturnCode.BUG, getThrowableMsg(
@@ -361,15 +353,11 @@
      Utilities.deleteConfigSubtree(
          DirectoryServer.getConfigHandler(), DN.valueOf(dn));
    }
    catch (OpenDsException ode)
    catch (OpenDsException | ConfigException ode)
    {
      throw new ApplicationException(
          ReturnCode.CONFIGURATION_ERROR, ode.getMessageObject(), ode);
    }
    catch(ConfigException ce)
    {
      throw new ApplicationException(ReturnCode.CONFIGURATION_ERROR, ce.getMessageObject(), ce);
    }
  }
opendj-server-legacy/src/main/java/org/opends/quicksetup/util/ServerController.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2011-2014 ForgeRock AS
 *      Portions Copyright 2011-2015 ForgeRock AS
 */
package org.opends.quicksetup.util;
@@ -509,16 +509,11 @@
            throw new ApplicationException(ReturnCode.START_ERROR, msg, null);
          }
        }
      } catch (IOException ioe)
      } catch (IOException | InterruptedException ioe)
      {
        throw new ApplicationException(
            ReturnCode.START_ERROR,
            getThrowableMsg(INFO_ERROR_STARTING_SERVER.get(), ioe), ioe);
      } catch (InterruptedException ie)
      {
        throw new ApplicationException(
            ReturnCode.START_ERROR,
            getThrowableMsg(INFO_ERROR_STARTING_SERVER.get(), ie), ie);
      }
    } finally {
      if (suppressOutput)
opendj-server-legacy/src/main/java/org/opends/server/admin/AggregationPropertyDefinition.java
@@ -575,13 +575,7 @@
        ManagedObject<?> ref;
        try {
          ref = context.getManagedObject(path);
        } catch (DefinitionDecodingException e) {
          LocalizableMessage msg = ERR_CLIENT_REFINT_TARGET_INVALID.get(ufn, name,
              getName(), e.getMessageObject());
          unacceptableReasons.add(msg);
          isAcceptable = false;
          continue;
        } catch (ManagedObjectDecodingException e) {
        } catch (DefinitionDecodingException | ManagedObjectDecodingException e) {
          LocalizableMessage msg = ERR_CLIENT_REFINT_TARGET_INVALID.get(ufn, name,
              getName(), e.getMessageObject());
          unacceptableReasons.add(msg);
opendj-server-legacy/src/main/java/org/opends/server/admin/ClassPropertyDefinition.java
@@ -353,12 +353,9 @@
      String classToBeLoaded, boolean initialize) {
    try {
      return loadClass(classToBeLoaded.trim(), initialize);
    } catch (ClassNotFoundException e) {
    } catch (ClassNotFoundException | LinkageError e) {
      // If the class cannot be loaded then it is an invalid value.
      throw illegalPropertyValueException(this, componentClassName, e);
    } catch (LinkageError e) {
      // If the class cannot be initialized then it is an invalid value.
      throw illegalPropertyValueException(this, componentClassName, e);
    }
  }
opendj-server-legacy/src/main/java/org/opends/server/admin/DNPropertyDefinition.java
@@ -199,9 +199,7 @@
      DN dn = DN.valueOf(value);
      validateValue(dn);
      return dn;
    } catch (DirectoryException e) {
      throw PropertyException.illegalPropertyValueException(this, value);
    } catch (PropertyException e) {
    } catch (DirectoryException | PropertyException e) {
      throw PropertyException.illegalPropertyValueException(this, value);
    }
  }
opendj-server-legacy/src/main/java/org/opends/server/admin/client/cli/SecureConnectionCliArgs.java
@@ -556,28 +556,7 @@
            truststore = KeyStore.getInstance(KeyStore.getDefaultType());
            truststore.load(fos, trustStorePasswordValue);
          }
          catch (KeyStoreException e)
          {
            // Nothing to do: if this occurs we will systematically refuse the
            // certificates.  Maybe we should avoid this and be strict, but we
            // are in a best effort mode.
            logger.warn(LocalizableMessage.raw("Error with the truststore"), e);
          }
          catch (NoSuchAlgorithmException e)
          {
            // Nothing to do: if this occurs we will systematically refuse the
            // certificates.  Maybe we should avoid this and be strict, but we
            // are in a best effort mode.
            logger.warn(LocalizableMessage.raw("Error with the truststore"), e);
          }
          catch (CertificateException e)
          {
            // Nothing to do: if this occurs we will systematically refuse the
            // certificates.  Maybe we should avoid this and be strict, but we
            // are in a best effort mode.
            logger.warn(LocalizableMessage.raw("Error with the truststore"), e);
          }
          catch (IOException e)
          catch (KeyStoreException | NoSuchAlgorithmException | CertificateException | IOException e)
          {
            // Nothing to do: if this occurs we will systematically refuse the
            // certificates.  Maybe we should avoid this and be strict, but we
opendj-server-legacy/src/main/java/org/opends/server/admin/server/ServerManagementContext.java
@@ -270,13 +270,7 @@
          }
          return pvalues;
        }
      } catch (DefinitionDecodingException e) {
        throw PropertyException.defaultBehaviorException(pd1, e);
      } catch (PropertyNotFoundException e) {
        throw PropertyException.defaultBehaviorException(pd1, e);
      } catch (PropertyException e) {
        throw PropertyException.defaultBehaviorException(pd1, e);
      } catch (ConfigException e) {
      } catch (DefinitionDecodingException | PropertyNotFoundException | PropertyException | ConfigException e) {
        throw PropertyException.defaultBehaviorException(pd1, e);
      }
    }