AutoRefactor'ed use multi-catch
| | |
| | | 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; |
| | |
| | | value = sdkReaderASN1.readOctetString(); |
| | | } |
| | | sdkReaderASN1.readEndSequence(); |
| | | } catch (DecodeException e) { |
| | | // Nothing to do. |
| | | } catch (IOException e) { |
| | | // Nothing to do. |
| | | } |
| | |
| | | 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; |
| | | } |
| | | } |
| | | }); |
| | |
| | | fKeyManager); |
| | | } |
| | | pair[0] = new InitialLdapContext(fEnv, fNewCtls); |
| | | |
| | | } catch (NamingException ne) { |
| | | } catch (NamingException | RuntimeException ne) { |
| | | pair[1] = ne; |
| | | |
| | | } catch (RuntimeException re) { |
| | | pair[1] = re; |
| | | } |
| | | } |
| | | }); |
| | |
| | | result.reconnect(null); |
| | | } |
| | | pair[0] = result; |
| | | |
| | | } catch (NamingException ne) |
| | | } catch (NamingException | RuntimeException ne) |
| | | { |
| | | pair[1] = ne; |
| | | |
| | | } catch (RuntimeException re) |
| | | { |
| | | pair[1] = re; |
| | | } |
| | | } |
| | | }); |
| | |
| | | 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. |
| | | } |
| | |
| | | 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(); |
| | | } |
| | |
| | | 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(); |
| | | } |
| | |
| | | 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(); |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.guitools.uninstaller; |
| | | |
| | |
| | | userData.setLocalServerUrl(adminConnectorUrl); |
| | | couldConnect = true; |
| | | } |
| | | catch (ArgumentException e) { |
| | | printErrorMessage(e.getMessageObject()); |
| | | println(); |
| | | } |
| | | catch (ClientException e) { |
| | | catch (ArgumentException | ClientException e) { |
| | | printErrorMessage(e.getMessageObject()); |
| | | println(); |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.guitools.uninstaller.ui; |
| | |
| | | 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); |
| | |
| | | } |
| | | } |
| | | } |
| | | } 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); |
| | |
| | | |
| | | 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( |
| | |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.quicksetup.util; |
| | | |
| | |
| | | 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) |
| | |
| | | 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); |
| | |
| | | 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); |
| | | } |
| | | } |
| | | |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | 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 |
| | |
| | | } |
| | | 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); |
| | | } |
| | | } |