diff --git a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerBiConsumer.java b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerBiConsumer.java index a12958a7d..6186c7d90 100644 --- a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerBiConsumer.java +++ b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerBiConsumer.java @@ -23,7 +23,7 @@ public interface SerBiConsumer extends BiConsumer, Serializable { * @return lambda */ @SafeVarargs - static SerBiConsumer multi(SerBiConsumer... consumers) { + static SerBiConsumer multi(final SerBiConsumer... consumers) { return Stream.of(consumers).reduce(SerBiConsumer::andThen).orElseGet(() -> (o, q) -> {}); } @@ -32,9 +32,8 @@ public interface SerBiConsumer extends BiConsumer, Serializable { * * @param t the first input argument * @param u the second input argument - * @throws Exception wrappered checked exceptions for easy using + * @throws Exception wrapped checked exceptions for easy using */ - @SuppressWarnings("all") void accepting(T t, U u) throws Exception; /** @@ -44,10 +43,10 @@ public interface SerBiConsumer extends BiConsumer, Serializable { * @param u the second input argument */ @Override - default void accept(T t, U u) { + default void accept(final T t, final U u) { try { accepting(t, u); - } catch (Exception e) { + } catch (final Exception e) { throw new UtilException(e); } } @@ -64,7 +63,7 @@ public interface SerBiConsumer extends BiConsumer, Serializable { * operation followed by the {@code after} operation * @throws NullPointerException if {@code after} is null */ - default SerBiConsumer andThen(SerBiConsumer after) { + default SerBiConsumer andThen(final SerBiConsumer after) { Objects.requireNonNull(after); return (l, r) -> { accepting(l, r); diff --git a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerBiFunction.java b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerBiFunction.java index fc903d90e..4b945959b 100644 --- a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerBiFunction.java +++ b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerBiFunction.java @@ -21,9 +21,8 @@ public interface SerBiFunction extends BiFunction, Serializabl * @param t the first function argument * @param u the second function argument * @return the function result - * @throws Exception wrappered checked exceptions + * @throws Exception wrapped checked exceptions */ - @SuppressWarnings("all") R applying(T t, U u) throws Exception; /** @@ -34,10 +33,10 @@ public interface SerBiFunction extends BiFunction, Serializabl * @return the function result */ @Override - default R apply(T t, U u) { + default R apply(final T t, final U u) { try { return this.applying(t, u); - } catch (Exception e) { + } catch (final Exception e) { throw new UtilException(e); } } @@ -55,7 +54,7 @@ public interface SerBiFunction extends BiFunction, Serializabl * applies the {@code after} function * @throws NullPointerException if after is null */ - default SerBiFunction andThen(SerFunction after) { + default SerBiFunction andThen(final SerFunction after) { Objects.requireNonNull(after); return (T t, U u) -> after.apply(this.apply(t, u)); } diff --git a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerBiPredicate.java b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerBiPredicate.java index 74f50a0e1..f98a0036a 100644 --- a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerBiPredicate.java +++ b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerBiPredicate.java @@ -23,9 +23,8 @@ public interface SerBiPredicate extends BiPredicate, Serializable { * @param u the second input argument * @return {@code true} if the input arguments match the predicate, * otherwise {@code false} - * @throws Exception wrappered checked exceptions + * @throws Exception wrapped checked exceptions */ - @SuppressWarnings("all") boolean testing(T t, U u) throws Exception; /** @@ -37,10 +36,10 @@ public interface SerBiPredicate extends BiPredicate, Serializable { * otherwise {@code false} */ @Override - default boolean test(T t, U u) { + default boolean test(final T t, final U u) { try { return testing(t, u); - } catch (Exception e) { + } catch (final Exception e) { throw new UtilException(e); } } @@ -62,7 +61,7 @@ public interface SerBiPredicate extends BiPredicate, Serializable { * AND of this predicate and the {@code other} predicate * @throws NullPointerException if other is null */ - default SerBiPredicate and(SerBiPredicate other) { + default SerBiPredicate and(final SerBiPredicate other) { Objects.requireNonNull(other); return (T t, U u) -> test(t, u) && other.test(t, u); } @@ -95,7 +94,7 @@ public interface SerBiPredicate extends BiPredicate, Serializable { * OR of this predicate and the {@code other} predicate * @throws NullPointerException if other is null */ - default SerBiPredicate or(SerBiPredicate other) { + default SerBiPredicate or(final SerBiPredicate other) { Objects.requireNonNull(other); return (T t, U u) -> test(t, u) || other.test(t, u); } diff --git a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerBinaryOperator.java b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerBinaryOperator.java index c8d9e1aa0..a416e3337 100644 --- a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerBinaryOperator.java +++ b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerBinaryOperator.java @@ -22,9 +22,8 @@ public interface SerBinaryOperator extends BinaryOperator, Serializable { * @param t the first function argument * @param u the second function argument * @return the function result - * @throws Exception wrappered checked exceptions + * @throws Exception wrapped checked exceptions */ - @SuppressWarnings("all") T applying(T t, T u) throws Exception; /** @@ -35,10 +34,10 @@ public interface SerBinaryOperator extends BinaryOperator, Serializable { * @return the function result */ @Override - default T apply(T t, T u) { + default T apply(final T t, final T u) { try { return this.applying(t, u); - } catch (Exception e) { + } catch (final Exception e) { throw new UtilException(e); } } @@ -53,7 +52,7 @@ public interface SerBinaryOperator extends BinaryOperator, Serializable { * according to the supplied {@code Comparator} * @throws NullPointerException if the argument is null */ - static SerBinaryOperator minBy(Comparator comparator) { + static SerBinaryOperator minBy(final Comparator comparator) { Objects.requireNonNull(comparator); return (a, b) -> comparator.compare(a, b) <= 0 ? a : b; } @@ -68,7 +67,7 @@ public interface SerBinaryOperator extends BinaryOperator, Serializable { * according to the supplied {@code Comparator} * @throws NullPointerException if the argument is null */ - static SerBinaryOperator maxBy(Comparator comparator) { + static SerBinaryOperator maxBy(final Comparator comparator) { Objects.requireNonNull(comparator); return (a, b) -> comparator.compare(a, b) >= 0 ? a : b; } diff --git a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerConsumer.java b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerConsumer.java index 9a7312143..21a5464da 100644 --- a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerConsumer.java +++ b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerConsumer.java @@ -20,9 +20,8 @@ public interface SerConsumer extends Consumer, Serializable { * Performs this operation on the given argument. * * @param t the input argument - * @throws Exception wrappered checked exceptions + * @throws Exception wrapped checked exceptions */ - @SuppressWarnings("all") void accepting(T t) throws Exception; /** @@ -31,10 +30,10 @@ public interface SerConsumer extends Consumer, Serializable { * @param t the input argument */ @Override - default void accept(T t) { + default void accept(final T t) { try { accepting(t); - } catch (Exception e) { + } catch (final Exception e) { throw new UtilException(e); } } @@ -47,7 +46,7 @@ public interface SerConsumer extends Consumer, Serializable { * @return lambda */ @SafeVarargs - static SerConsumer multi(SerConsumer... consumers) { + static SerConsumer multi(final SerConsumer... consumers) { return Stream.of(consumers).reduce(SerConsumer::andThen).orElseGet(() -> o -> {}); } @@ -63,7 +62,7 @@ public interface SerConsumer extends Consumer, Serializable { * operation followed by the {@code after} operation * @throws NullPointerException if {@code after} is null */ - default SerConsumer andThen(SerConsumer after) { + default SerConsumer andThen(final SerConsumer after) { Objects.requireNonNull(after); return (T t) -> { accept(t); diff --git a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerConsumer3.java b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerConsumer3.java index 8997dd432..888d503d1 100644 --- a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerConsumer3.java +++ b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerConsumer3.java @@ -23,9 +23,8 @@ public interface SerConsumer3 extends Serializable { * @param p1 参数一 * @param p2 参数二 * @param p3 参数三 - * @throws Exception wrappered checked exceptions + * @throws Exception wrapped checked exceptions */ - @SuppressWarnings("all") void accepting(P1 p1, P2 p2, P3 p3) throws Exception; /** diff --git a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerFunction.java b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerFunction.java index 5a0f98f3d..2e2c5b395 100644 --- a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerFunction.java +++ b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerFunction.java @@ -19,9 +19,8 @@ public interface SerFunction extends Function, Serializable { * * @param t the function argument * @return the function result - * @throws Exception wrappered checked exceptions + * @throws Exception wrapped checked exceptions */ - @SuppressWarnings("all") R applying(T t) throws Exception; /** diff --git a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerPredicate.java b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerPredicate.java index 11479caff..85457df29 100644 --- a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerPredicate.java +++ b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerPredicate.java @@ -22,7 +22,7 @@ public interface SerPredicate extends Predicate, Serializable { * @param t the input argument * @return {@code true} if the input argument matches the predicate, * otherwise {@code false} - * @throws Exception wrappered checked exceptions + * @throws Exception wrapped checked exceptions */ boolean testing(T t) throws Exception; @@ -34,10 +34,10 @@ public interface SerPredicate extends Predicate, Serializable { * otherwise {@code false} */ @Override - default boolean test(T t) { + default boolean test(final T t) { try { return testing(t); - } catch (Exception e) { + } catch (final Exception e) { throw new UtilException(e); } } @@ -50,7 +50,7 @@ public interface SerPredicate extends Predicate, Serializable { * @return lambda */ @SafeVarargs - static SerPredicate multiAnd(SerPredicate... predicates) { + static SerPredicate multiAnd(final SerPredicate... predicates) { return Stream.of(predicates).reduce(SerPredicate::and).orElseGet(() -> o -> true); } @@ -62,7 +62,7 @@ public interface SerPredicate extends Predicate, Serializable { * @return lambda */ @SafeVarargs - static SerPredicate multiOr(SerPredicate... predicates) { + static SerPredicate multiOr(final SerPredicate... predicates) { return Stream.of(predicates).reduce(SerPredicate::or).orElseGet(() -> o -> false); } @@ -76,7 +76,7 @@ public interface SerPredicate extends Predicate, Serializable { * @return a predicate that tests if two arguments are equal according * to {@link Objects#equals(Object, Object)} */ - static SerPredicate isEqual(Object... targetRef) { + static SerPredicate isEqual(final Object... targetRef) { return (null == targetRef) ? Objects::isNull : object -> Stream.of(targetRef).allMatch(target -> target.equals(object)); @@ -98,7 +98,7 @@ public interface SerPredicate extends Predicate, Serializable { * AND of this predicate and the {@code other} predicate * @throws NullPointerException if other is null */ - default SerPredicate and(SerPredicate other) { + default SerPredicate and(final SerPredicate other) { Objects.requireNonNull(other); return t -> test(t) && other.test(t); } @@ -131,7 +131,7 @@ public interface SerPredicate extends Predicate, Serializable { * OR of this predicate and the {@code other} predicate * @throws NullPointerException if other is null */ - default SerPredicate or(SerPredicate other) { + default SerPredicate or(final SerPredicate other) { Objects.requireNonNull(other); return t -> test(t) || other.test(t); } diff --git a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerRunnable.java b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerRunnable.java index 17c8776c4..f9c3f9ed9 100644 --- a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerRunnable.java +++ b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerRunnable.java @@ -24,10 +24,9 @@ public interface SerRunnable extends Runnable, Serializable { * The general contract of the method run is that it may * take any action whatsoever. * - * @throws Exception wrappered checked exceptions + * @throws Exception wrapped checked exceptions * @see Thread#run() */ - @SuppressWarnings("all") void running() throws Exception; /** @@ -45,7 +44,7 @@ public interface SerRunnable extends Runnable, Serializable { default void run() { try { running(); - } catch (Exception e) { + } catch (final Exception e) { throw new UtilException(e); } } @@ -56,7 +55,7 @@ public interface SerRunnable extends Runnable, Serializable { * @param serRunnableArray lambda * @return lambda */ - static SerRunnable multi(SerRunnable... serRunnableArray) { + static SerRunnable multi(final SerRunnable... serRunnableArray) { return () -> Stream.of(serRunnableArray).forEach(SerRunnable::run); } diff --git a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerSupplier.java b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerSupplier.java index 09005e7a1..94d156b8b 100644 --- a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerSupplier.java +++ b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerSupplier.java @@ -19,9 +19,8 @@ public interface SerSupplier extends Supplier, Serializable { * Gets a result. * * @return a result - * @throws Exception wrappered checked exceptions + * @throws Exception wrapped checked exceptions */ - @SuppressWarnings("all") T getting() throws Exception; /** @@ -33,7 +32,7 @@ public interface SerSupplier extends Supplier, Serializable { default T get() { try { return getting(); - } catch (Exception e) { + } catch (final Exception e) { throw new UtilException(e); } } @@ -46,7 +45,7 @@ public interface SerSupplier extends Supplier, Serializable { * @return lambda */ @SafeVarargs - static SerSupplier last(SerSupplier... serSups) { + static SerSupplier last(final SerSupplier... serSups) { return Stream.of(serSups).reduce((l, r) -> r).orElseGet(() -> () -> null); } diff --git a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerUnaryOperator.java b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerUnaryOperator.java index 2b3c27ecd..bf6295228 100644 --- a/hutool-core/src/main/java/cn/hutool/core/lang/func/SerUnaryOperator.java +++ b/hutool-core/src/main/java/cn/hutool/core/lang/func/SerUnaryOperator.java @@ -20,9 +20,8 @@ public interface SerUnaryOperator extends UnaryOperator, Serializable { * * @param t the function argument * @return the function result - * @throws Exception wrappered checked exceptions + * @throws Exception wrapped checked exceptions */ - @SuppressWarnings("all") T applying(T t) throws Exception; /** @@ -32,10 +31,10 @@ public interface SerUnaryOperator extends UnaryOperator, Serializable { * @return the function result */ @Override - default T apply(T t) { + default T apply(final T t) { try { return applying(t); - } catch (Exception e) { + } catch (final Exception e) { throw new UtilException(e); } } @@ -61,7 +60,7 @@ public interface SerUnaryOperator extends UnaryOperator, Serializable { * @return identity after casting */ @SuppressWarnings("unchecked") - static > SerUnaryOperator casting(F function) { + static > SerUnaryOperator casting(final F function) { return t -> (T) function.apply(t); }