removes unchecked exceptions declared in 'throws' clause

This commit is contained in:
Igor Curdvanovschi 2018-06-20 09:00:24 +03:00
parent 8e8b8e05e4
commit e767af7e7e
13 changed files with 16 additions and 17 deletions

View File

@ -85,7 +85,7 @@ public class ArchUtils {
* @param processor The {@link Processor} to add.
* @throws IllegalStateException If the key already exists.
*/
private static void addProcessor(final String key, final Processor processor) throws IllegalStateException {
private static void addProcessor(final String key, final Processor processor) {
if (!ARCH_TO_PROCESSOR.containsKey(key)) {
ARCH_TO_PROCESSOR.put(key, processor);
} else {
@ -101,7 +101,7 @@ public class ArchUtils {
* @param processor The {@link Processor} to add.
* @throws IllegalStateException If the key already exists.
*/
private static void addProcessors(final Processor processor, final String... keys) throws IllegalStateException {
private static void addProcessors(final Processor processor, final String... keys) {
for (final String key : keys) {
addProcessor(key, processor);
}

View File

@ -1084,7 +1084,7 @@ public class ClassUtils {
* or if the method doesn't conform with the requirements
*/
public static Method getPublicMethod(final Class<?> cls, final String methodName, final Class<?>... parameterTypes)
throws SecurityException, NoSuchMethodException {
throws NoSuchMethodException {
final Method declaredMethod = cls.getMethod(methodName, parameterTypes);
if (Modifier.isPublic(declaredMethod.getDeclaringClass().getModifiers())) {

View File

@ -867,7 +867,7 @@ public class ObjectUtils {
* @return the byte v, unchanged
* @since 3.2
*/
public static byte CONST_BYTE(final int v) throws IllegalArgumentException {
public static byte CONST_BYTE(final int v) {
if (v < Byte.MIN_VALUE || v > Byte.MAX_VALUE) {
throw new IllegalArgumentException("Supplied value must be a valid byte literal between -128 and 127: [" + v + "]");
}
@ -936,7 +936,7 @@ public class ObjectUtils {
* @return the byte v, unchanged
* @since 3.2
*/
public static short CONST_SHORT(final int v) throws IllegalArgumentException {
public static short CONST_SHORT(final int v) {
if (v < Short.MIN_VALUE || v > Short.MAX_VALUE) {
throw new IllegalArgumentException("Supplied value must be a valid byte literal between -32768 and 32767: [" + v + "]");
}

View File

@ -696,7 +696,7 @@ public class ReflectionToStringBuilder extends ToStringBuilder {
*
* @see java.lang.reflect.Field#get(Object)
*/
protected Object getValue(final Field field) throws IllegalArgumentException, IllegalAccessException {
protected Object getValue(final Field field) throws IllegalAccessException {
return field.get(this.getObject());
}

View File

@ -269,8 +269,7 @@ public class EventCountCircuitBreaker extends AbstractCircuitBreaker<Integer> {
* {@inheritDoc}
*/
@Override
public boolean incrementAndCheckState(final Integer increment)
throws CircuitBreakingException {
public boolean incrementAndCheckState(final Integer increment) {
return performStateCheck(increment);
}

View File

@ -91,7 +91,7 @@ public class ThresholdCircuitBreaker extends AbstractCircuitBreaker<Long> {
* {@inheritDoc}
*/
@Override
public boolean checkState() throws CircuitBreakingException {
public boolean checkState() {
return isOpen();
}
@ -112,7 +112,7 @@ public class ThresholdCircuitBreaker extends AbstractCircuitBreaker<Long> {
* <p>If the threshold is zero, the circuit breaker will be in a permanent <em>open</em> state.</p>
*/
@Override
public boolean incrementAndCheckState(final Long increment) throws CircuitBreakingException {
public boolean incrementAndCheckState(final Long increment) {
if (threshold == 0) {
open();
}

View File

@ -447,7 +447,7 @@ public class NumberUtils {
* @return Number created from the string (or null if the input is null)
* @throws NumberFormatException if the value cannot be converted
*/
public static Number createNumber(final String str) throws NumberFormatException {
public static Number createNumber(final String str) {
if (str == null) {
return null;
}

View File

@ -73,7 +73,7 @@ public class MutableByte extends Number implements Comparable<MutableByte>, Muta
* @throws NumberFormatException if the string cannot be parsed into a byte
* @since 2.5
*/
public MutableByte(final String value) throws NumberFormatException {
public MutableByte(final String value) {
super();
this.value = Byte.parseByte(value);
}

View File

@ -71,7 +71,7 @@ public class MutableDouble extends Number implements Comparable<MutableDouble>,
* @throws NumberFormatException if the string cannot be parsed into a double
* @since 2.5
*/
public MutableDouble(final String value) throws NumberFormatException {
public MutableDouble(final String value) {
super();
this.value = Double.parseDouble(value);
}

View File

@ -71,7 +71,7 @@ public class MutableFloat extends Number implements Comparable<MutableFloat>, Mu
* @throws NumberFormatException if the string cannot be parsed into a float
* @since 2.5
*/
public MutableFloat(final String value) throws NumberFormatException {
public MutableFloat(final String value) {
super();
this.value = Float.parseFloat(value);
}

View File

@ -73,7 +73,7 @@ public class MutableInt extends Number implements Comparable<MutableInt>, Mutabl
* @throws NumberFormatException if the string cannot be parsed into an int
* @since 2.5
*/
public MutableInt(final String value) throws NumberFormatException {
public MutableInt(final String value) {
super();
this.value = Integer.parseInt(value);
}

View File

@ -73,7 +73,7 @@ public class MutableLong extends Number implements Comparable<MutableLong>, Muta
* @throws NumberFormatException if the string cannot be parsed into a long
* @since 2.5
*/
public MutableLong(final String value) throws NumberFormatException {
public MutableLong(final String value) {
super();
this.value = Long.parseLong(value);
}

View File

@ -73,7 +73,7 @@ public class MutableShort extends Number implements Comparable<MutableShort>, Mu
* @throws NumberFormatException if the string cannot be parsed into a short
* @since 2.5
*/
public MutableShort(final String value) throws NumberFormatException {
public MutableShort(final String value) {
super();
this.value = Short.parseShort(value);
}