Nullability refinements (based on IntelliJ IDEA 2018.1 introspection)

Issue: SPR-15756
This commit is contained in:
Juergen Hoeller
2018-03-29 23:50:17 +02:00
parent 1cc513d7db
commit d553ddc5b3
17 changed files with 84 additions and 107 deletions

View File

@@ -209,14 +209,6 @@ public abstract class ClassUtils {
}
}
/**
* Determine if the supplied class is an <em>inner class</em>.
* @return {@code true} if the supplied class is an inner class
*/
public static boolean isInnerClass(Class<?> clazz) {
return clazz != null && clazz.isMemberClass() && !Modifier.isStatic(clazz.getModifiers());
}
/**
* Replacement for {@code Class.forName()} that also returns Class instances
* for primitives (e.g. "int") and array class names (e.g. "String[]").
@@ -383,6 +375,17 @@ public abstract class ClassUtils {
return clazz;
}
/**
* Determine if the supplied class is an <em>inner class</em>,
* i.e. a non-static member of an enclosing class.
* @return {@code true} if the supplied class is an inner class
* @since 5.0.5
* @see Class#isMemberClass()
*/
public static boolean isInnerClass(Class<?> clazz) {
return (clazz.isMemberClass() && !Modifier.isStatic(clazz.getModifiers()));
}
/**
* Check whether the given class is cache-safe in the given context,
* i.e. whether it is loaded by the given ClassLoader or a parent of it.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -136,8 +136,9 @@ public class ListenableFutureCallbackRegistry<T> {
synchronized (this.mutex) {
this.state = State.SUCCESS;
this.result = result;
while (!this.successCallbacks.isEmpty()) {
notifySuccess(this.successCallbacks.poll());
SuccessCallback<? super T> callback;
while ((callback = this.successCallbacks.poll()) != null) {
notifySuccess(callback);
}
}
}
@@ -151,8 +152,9 @@ public class ListenableFutureCallbackRegistry<T> {
synchronized (this.mutex) {
this.state = State.FAILURE;
this.result = ex;
while (!this.failureCallbacks.isEmpty()) {
notifyFailure(this.failureCallbacks.poll());
FailureCallback callback;
while ((callback = this.failureCallbacks.poll()) != null) {
notifyFailure(callback);
}
}
}