AutoRefactor'ed use multi-catch
| | |
| | | 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); |
| | |
| | | private Class<?> loadClassForValidation(String componentClassName, String classToBeLoaded, boolean initialize) { |
| | | try { |
| | | return loadClass(classToBeLoaded.trim(), initialize); |
| | | } catch (ClassNotFoundException e) { |
| | | // If the class cannot be loaded then it is an invalid value. |
| | | throw PropertyException.illegalPropertyValueException(this, componentClassName, e); |
| | | } catch (LinkageError e) { |
| | | // If the class cannot be initialized then it is an invalid value. |
| | | } catch (ClassNotFoundException | LinkageError e) { |
| | | // If the class cannot be loaded / initialized then it is an invalid value. |
| | | throw PropertyException.illegalPropertyValueException(this, componentClassName, e); |
| | | } |
| | | } |
| | |
| | | // definition of the component being created. |
| | | PropertyDefinition<?> pdTmp = definition.getPropertyDefinition(propertyName); |
| | | pd2 = pd1.getClass().cast(pdTmp); |
| | | } catch (IllegalArgumentException e) { |
| | | throw new PropertyNotFoundException(propertyName); |
| | | } catch (ClassCastException e) { |
| | | // FIXME: would be nice to throw a better exception here. |
| | | } catch (IllegalArgumentException | ClassCastException e) { |
| | | throw new PropertyNotFoundException(propertyName); |
| | | } |
| | | |
| | |
| | | // inherits its defaults from the newly created managed object. |
| | | return getPropertyValues(target, pd2); |
| | | } |
| | | } catch (PropertyException e) { |
| | | // Wrap any errors due to recursion. |
| | | throw PropertyException.defaultBehaviorException(pd1, e); |
| | | } catch (DefinitionDecodingException e) { |
| | | throw PropertyException.defaultBehaviorException(pd1, e); |
| | | } catch (PropertyNotFoundException e) { |
| | | throw PropertyException.defaultBehaviorException(pd1, e); |
| | | } catch (LdapException e) { |
| | | throw PropertyException.defaultBehaviorException(pd1, e); |
| | | } catch (ManagedObjectNotFoundException e) { |
| | | } catch (PropertyException | DefinitionDecodingException | PropertyNotFoundException |
| | | | LdapException | ManagedObjectNotFoundException e) { |
| | | throw PropertyException.defaultBehaviorException(pd1, e); |
| | | } |
| | | } |
| | |
| | | LocalizableMessage msg = ERR_DSCFG_ERROR_CREATE_CE.get(irelation.getUserFriendlyName(), |
| | | e.getMessage()); |
| | | throw new ClientException(ReturnCode.APPLICATION_ERROR, msg); |
| | | } catch (DefinitionDecodingException e) { |
| | | // Do nothing. |
| | | } catch (ManagedObjectDecodingException e) { |
| | | } catch (DefinitionDecodingException | ManagedObjectDecodingException e) { |
| | | // Do nothing. |
| | | } catch (ManagedObjectNotFoundException e) { |
| | | // The child does not already exist so this name is ok. |
| | |
| | | try { |
| | | // Force retrieval of management context. |
| | | factory.getManagementContext(app); |
| | | } catch (ArgumentException e) { |
| | | app.errPrintln(e.getMessageObject()); |
| | | return ReturnCode.ERROR_UNEXPECTED.get(); |
| | | } catch (ClientException e) { |
| | | } catch (ArgumentException | ClientException e) { |
| | | app.errPrintln(e.getMessageObject()); |
| | | return ReturnCode.ERROR_UNEXPECTED.get(); |
| | | } |
| | |
| | | // For sets the RDN is the type string, the ufn is more friendly. |
| | | children.put(cd.getUserFriendlyName().toString(), childName); |
| | | } |
| | | } catch (DefinitionDecodingException e) { |
| | | // Add it anyway: maybe the user is trying to fix the problem. |
| | | children.put(childName, childName); |
| | | } catch (ManagedObjectDecodingException e) { |
| | | } catch (DefinitionDecodingException | ManagedObjectDecodingException | LdapException e) { |
| | | // Add it anyway: maybe the user is trying to fix the problem. |
| | | children.put(childName, childName); |
| | | } catch (ManagedObjectNotFoundException e) { |
| | | // Skip it - the managed object has been concurrently removed. |
| | | } catch (LdapException e) { |
| | | // Add it anyway: maybe the user is trying to fix the problem. |
| | | children.put(childName, childName); |
| | | } |
| | | } |
| | | |
| | |
| | | try { |
| | | PropertyDefinition<?> propDefTmp = mod.getPropertyDefinition(propertyName); |
| | | propDef2 = propDef1.getClass().cast(propDefTmp); |
| | | } catch (IllegalArgumentException e) { |
| | | throw new PropertyNotFoundException(propertyName); |
| | | } catch (ClassCastException e) { |
| | | // FIXME: would be nice to throw a better exception here. |
| | | } catch (IllegalArgumentException | ClassCastException e) { |
| | | throw new PropertyNotFoundException(propertyName); |
| | | } |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2012 ForgeRock AS. |
| | | * Portions copyright 2012-2015 ForgeRock AS. |
| | | */ |
| | | package org.forgerock.opendj.ldap.controls; |
| | | |
| | |
| | | |
| | | return new ServerSideSortResponseControl(control.isCritical(), result, |
| | | attributeDescription); |
| | | } catch (final IOException e) { |
| | | } catch (final IOException | LocalizedIllegalArgumentException e) { |
| | | final LocalizableMessage message = |
| | | INFO_SORTRES_CONTROL_CANNOT_DECODE_VALUE |
| | | .get(getExceptionMessage(e)); |
| | | throw DecodeException.error(message, e); |
| | | } catch (final LocalizedIllegalArgumentException e) { |
| | | final LocalizableMessage message = |
| | | INFO_SORTRES_CONTROL_CANNOT_DECODE_VALUE |
| | | .get(getExceptionMessage(e)); |
| | | INFO_SORTRES_CONTROL_CANNOT_DECODE_VALUE.get(getExceptionMessage(e)); |
| | | throw DecodeException.error(message, e); |
| | | } |
| | | } |
| | |
| | | attributes.toArray(new String[attributes.size()])).setTypesOnly( |
| | | typesOnly.isPresent()).setTimeLimit(timeLimit.getIntValue()) |
| | | .setSizeLimit(sizeLimit.getIntValue()); |
| | | } catch (final ArgumentException e) { |
| | | errPrintln(e.getMessageObject()); |
| | | return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue(); |
| | | } catch (final LocalizedIllegalArgumentException e) { |
| | | } catch (final ArgumentException | LocalizedIllegalArgumentException e) { |
| | | errPrintln(e.getMessageObject()); |
| | | return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue(); |
| | | } |
| | |
| | | } |
| | | options.setSSLContext(builder.getSSLContext()); |
| | | options.setUseStartTLS(connectionSecurity == ConnectionSecurity.STARTTLS); |
| | | } catch (GeneralSecurityException e) { |
| | | // Rethrow as unchecked exception. |
| | | throw new IllegalArgumentException(e); |
| | | } catch (IOException e) { |
| | | } catch (GeneralSecurityException | IOException e) { |
| | | // Rethrow as unchecked exception. |
| | | throw new IllegalArgumentException(e); |
| | | } |