Extends clauses are redundant as java.lang.Object is a supertype for all classes. (#937)

This commit is contained in:
Arturo Bernal 2022-08-20 20:21:55 +02:00 committed by GitHub
parent ceb7fbb033
commit 1d66289a50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -73,7 +73,7 @@ public class Streams {
* @deprecated Use {@link org.apache.commons.lang3.stream.Streams.FailableStream}.
*/
@Deprecated
public static class FailableStream<O extends Object> {
public static class FailableStream<O> {
private Stream<O> stream;
private boolean terminated;
@ -545,7 +545,7 @@ public class Streams {
* @return a {@link Collector} which collects all the input elements into an
* array, in encounter order
*/
public static <O extends Object> Collector<O, ?, O[]> toArray(final Class<O> pElementType) {
public static <O> Collector<O, ?, O[]> toArray(final Class<O> pElementType) {
return new ArrayCollector<>(pElementType);
}
}

View File

@ -329,7 +329,7 @@ public class MethodUtils {
Objects.requireNonNull(object, "object");
args = ArrayUtils.nullToEmpty(args);
parameterTypes = ArrayUtils.nullToEmpty(parameterTypes);
final Class<? extends Object> cls = object.getClass();
final Class<?> cls = object.getClass();
final Method method = getAccessibleMethod(cls, methodName, parameterTypes);
if (method == null) {
throw new NoSuchMethodException("No such accessible method: " + methodName + "() on object: " + cls.getName());

View File

@ -174,7 +174,7 @@ public class Streams {
*
* @param <T> The streams element type.
*/
public static class FailableStream<T extends Object> {
public static class FailableStream<T> {
private Stream<T> stream;
private boolean terminated;
@ -777,7 +777,7 @@ public class Streams {
* @param <T> the type of the input elements
* @return a {@link Collector} which collects all the input elements into an array, in encounter order
*/
public static <T extends Object> Collector<T, ?, T[]> toArray(final Class<T> pElementType) {
public static <T> Collector<T, ?, T[]> toArray(final Class<T> pElementType) {
return new ArrayCollector<>(pElementType);
}
}