Skip to content
Permalink
Browse files
Collapse multiple identical catch clauses into one.
  • Loading branch information
garydgregory committed Jan 8, 2021
1 parent 81115e4 commit f5dd55da1fefd41c97aaf0ddcbbcd609c8b04d77
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 25 deletions.
@@ -421,11 +421,7 @@ static Object clone(final Object obj) throws CloneNotSupportedException
"No clone() method found for class"
+ obj.getClass().getName());
}
catch (final IllegalAccessException iaex)
{
throw new ConfigurationRuntimeException(iaex);
}
catch (final InvocationTargetException itex)
catch (final IllegalAccessException | InvocationTargetException itex)
{
throw new ConfigurationRuntimeException(itex);
}
@@ -413,12 +413,7 @@ protected Object getPropertyInternal(String key)
key = key.replaceAll("\\.", "/");
return getBaseContext().lookup(key);
}
catch (final NameNotFoundException e)
{
// expected exception, no need to log it
return null;
}
catch (final NotContextException nctxex)
catch (final NameNotFoundException | NotContextException nctxex)
{
// expected exception, no need to log it
return null;
@@ -1084,15 +1084,7 @@ public void validate() throws ConfigurationException
final DocumentBuilder builder = createDocumentBuilder();
builder.parse(new InputSource(reader));
}
catch (final SAXException e)
{
throw new ConfigurationException("Validation failed", e);
}
catch (final IOException e)
{
throw new ConfigurationException("Validation failed", e);
}
catch (final ParserConfigurationException pce)
catch (final SAXException | IOException | ParserConfigurationException pce)
{
throw new ConfigurationException("Validation failed", pce);
}
@@ -365,11 +365,7 @@ private static void initProperty(final Object bean, final String propName, final
{
BEAN_UTILS_BEAN.setProperty(bean, propName, value);
}
catch (final IllegalAccessException iaex)
{
throw new ConfigurationRuntimeException(iaex);
}
catch (final InvocationTargetException itex)
catch (final IllegalAccessException | InvocationTargetException itex)
{
throw new ConfigurationRuntimeException(itex);
}

0 comments on commit f5dd55d

Please sign in to comment.