Skip to content

Commit a32fe16

Browse files
committed
Polishing.
Handle warnings. Remove redundant code in DefaultReactiveEntityCallbacks. Original pull request: #3053 See #3055
1 parent dec7f74 commit a32fe16

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

src/main/java/org/springframework/data/mapping/callback/DefaultEntityCallbacks.java

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class DefaultEntityCallbacks implements EntityCallbacks {
6363
}
6464

6565
@Override
66+
@SuppressWarnings({ "unchecked", "rawtypes" })
6667
public <T> T callback(Class<? extends EntityCallback> callbackType, T entity, Object... args) {
6768

6869
Assert.notNull(entity, "Entity must not be null");

src/main/java/org/springframework/data/mapping/callback/DefaultReactiveEntityCallbacks.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,12 @@ class DefaultReactiveEntityCallbacks implements ReactiveEntityCallbacks {
6363
}
6464

6565
@Override
66-
@SuppressWarnings("unchecked")
66+
@SuppressWarnings({ "unchecked", "rawtypes" })
6767
public <T> Mono<T> callback(Class<? extends EntityCallback> callbackType, T entity, Object... args) {
6868

6969
Assert.notNull(entity, "Entity must not be null");
7070

71-
Class<T> entityType = (Class<T>) (entity != null
72-
? ClassUtils.getUserClass(entity.getClass())
73-
: callbackDiscoverer.resolveDeclaredEntityType(callbackType).getRawClass());
71+
Class<T> entityType = (Class<T>) ClassUtils.getUserClass(entity.getClass());
7472

7573
Method callbackMethod = callbackMethodCache.computeIfAbsent(callbackType, it -> {
7674

src/main/java/org/springframework/data/mapping/callback/EntityCallbacks.java

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public interface EntityCallbacks {
4747
* @return never {@literal null}.
4848
* @throws IllegalArgumentException if a required argument is {@literal null}.
4949
*/
50+
@SuppressWarnings("rawtypes")
5051
<T> T callback(Class<? extends EntityCallback> callbackType, T entity, Object... args);
5152

5253
/**

src/main/java/org/springframework/data/mapping/callback/ReactiveEntityCallbacks.java

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public interface ReactiveEntityCallbacks {
5050
* @return a {@link Mono} emitting the result after invoking the callbacks.
5151
* @throws IllegalArgumentException if a required argument is {@literal null}.
5252
*/
53+
@SuppressWarnings("rawtypes")
5354
<T> Mono<T> callback(Class<? extends EntityCallback> callbackType, T entity, Object... args);
5455

5556
/**

0 commit comments

Comments
 (0)