CloneUtils.java (httpcomponents-client-4.5.6-src) | : | CloneUtils.java (httpcomponents-client-4.5.7-src) | ||
---|---|---|---|---|
skipping to change at line 62 | skipping to change at line 62 | |||
throw new NoSuchMethodError(ex.getMessage()); | throw new NoSuchMethodError(ex.getMessage()); | |||
} | } | |||
try { | try { | |||
@SuppressWarnings("unchecked") // OK because clone() preserves t he class | @SuppressWarnings("unchecked") // OK because clone() preserves t he class | |||
final T result = (T) m.invoke(obj, (Object []) null); | final T result = (T) m.invoke(obj, (Object []) null); | |||
return result; | return result; | |||
} catch (final InvocationTargetException ex) { | } catch (final InvocationTargetException ex) { | |||
final Throwable cause = ex.getCause(); | final Throwable cause = ex.getCause(); | |||
if (cause instanceof CloneNotSupportedException) { | if (cause instanceof CloneNotSupportedException) { | |||
throw ((CloneNotSupportedException) cause); | throw ((CloneNotSupportedException) cause); | |||
} else { | ||||
throw new Error("Unexpected exception", cause); | ||||
} | } | |||
throw new Error("Unexpected exception", cause); | ||||
} catch (final IllegalAccessException ex) { | } catch (final IllegalAccessException ex) { | |||
throw new IllegalAccessError(ex.getMessage()); | throw new IllegalAccessError(ex.getMessage()); | |||
} | } | |||
} else { | ||||
throw new CloneNotSupportedException(); | ||||
} | } | |||
throw new CloneNotSupportedException(); | ||||
} | } | |||
public static Object clone(final Object obj) throws CloneNotSupportedExcepti on { | public static Object clone(final Object obj) throws CloneNotSupportedExcepti on { | |||
return cloneObject(obj); | return cloneObject(obj); | |||
} | } | |||
/** | /** | |||
* This class should not be instantiated. | * This class should not be instantiated. | |||
*/ | */ | |||
private CloneUtils() { | private CloneUtils() { | |||
End of changes. 4 change blocks. | ||||
4 lines changed or deleted | 2 lines changed or added |