|
38 | 38 | import java.util.Set; |
39 | 39 | import java.util.concurrent.atomic.AtomicInteger; |
40 | 40 | import java.util.function.Function; |
41 | | -import java.util.stream.Collectors; |
42 | 41 |
|
43 | 42 | import org.jspecify.annotations.Nullable; |
44 | 43 |
|
|
57 | 56 | import org.springframework.data.mapping.SimplePropertyHandler; |
58 | 57 | import org.springframework.data.mapping.model.KotlinCopyMethod.KotlinCopyByProperty; |
59 | 58 | import org.springframework.data.mapping.model.KotlinValueUtils.ValueBoxing; |
60 | | -import org.springframework.data.util.Optionals; |
61 | 59 | import org.springframework.util.Assert; |
62 | 60 | import org.springframework.util.ClassUtils; |
63 | 61 | import org.springframework.util.ConcurrentLruCache; |
@@ -318,9 +316,9 @@ private Class<PersistentPropertyAccessor<?>> loadOrCreateAccessorClass(Persisten |
318 | 316 | * // … |
319 | 317 | * case 3357: |
320 | 318 | * return bean.field; |
321 | | - * // … |
322 | | - * throw new UnsupportedOperationException( |
323 | | - * String.format("No accessor to get property %s", new Object[] { property })); |
| 319 | + * // … |
| 320 | + * throw new UnsupportedOperationException( |
| 321 | + * String.format("No accessor to get property %s", new Object[] { property })); |
324 | 322 | * } |
325 | 323 | * } |
326 | 324 | * } |
@@ -611,27 +609,6 @@ static boolean requiresMethodHandleSetup(PersistentEntity<?, ?> entity, |
611 | 609 | return false; |
612 | 610 | } |
613 | 611 |
|
614 | | - /** |
615 | | - * Retrieve all classes which are involved in property/getter/setter declarations as these elements may be |
616 | | - * distributed across the type hierarchy. |
617 | | - */ |
618 | | - @SuppressWarnings("null") |
619 | | - private static List<Class<?>> getPropertyDeclaratingClasses(List<PersistentProperty<?>> persistentProperties) { |
620 | | - |
621 | | - return persistentProperties.stream().flatMap(property -> { |
622 | | - return Optionals |
623 | | - .toStream(Optional.ofNullable(property.getField()), Optional.ofNullable(property.getGetter()), |
624 | | - Optional.ofNullable(property.getSetter())) |
625 | | - |
626 | | - // keep it a lambda to infer the correct types, preventing |
627 | | - // LambdaConversionException: Invalid receiver type class java.lang.reflect.AccessibleObject; not a subtype |
628 | | - // of implementation type interface java.lang.reflect.Member |
629 | | - .map(Member::getDeclaringClass); |
630 | | - |
631 | | - }).collect(Collectors.collectingAndThen(Collectors.toSet(), ArrayList::new)); |
632 | | - |
633 | | - } |
634 | | - |
635 | 612 | /** |
636 | 613 | * Generate property getter initializer. |
637 | 614 | */ |
@@ -1281,8 +1258,8 @@ private static void visitSetField(PersistentEntity<?, ?> entity, PersistentPrope |
1281 | 1258 | * Creates the method signature containing parameter types (e.g. (Ljava/lang/Object)I for a method accepting |
1282 | 1259 | * {@link Object} and returning a primitive {@code int}). |
1283 | 1260 | * |
1284 | | - * @param method |
1285 | | - * @return |
| 1261 | + * @param method must not be {@literal null}. |
| 1262 | + * @return a string representation of the given method. |
1286 | 1263 | * @since 2.1 |
1287 | 1264 | */ |
1288 | 1265 | private static String getArgumentSignature(Method method) { |
@@ -1401,13 +1378,6 @@ private static boolean generateMethodHandle(PersistentEntity<?, ?> entity, @Null |
1401 | 1378 | return true; |
1402 | 1379 | } |
1403 | 1380 |
|
1404 | | - /** |
1405 | | - * Retrieves the class variable index with an offset of {@code 4}. |
1406 | | - */ |
1407 | | - private static int classVariableIndex5(List<Class<?>> list, Class<?> item) { |
1408 | | - return 5 + list.indexOf(item); |
1409 | | - } |
1410 | | - |
1411 | 1381 | static String generateClassName(PersistentEntity<?, ?> entity) { |
1412 | 1382 | return entity.getType().getName() + TAG + Integer.toString(Math.abs(entity.getType().getName().hashCode()), 36); |
1413 | 1383 | } |
@@ -1473,7 +1443,7 @@ public int compareTo(PropertyStackAddress o) { |
1473 | 1443 | } |
1474 | 1444 |
|
1475 | 1445 | /** |
1476 | | - * @param property |
| 1446 | + * @param property the persistent property to inspect. |
1477 | 1447 | * @return {@literal true} if object mutation is supported. |
1478 | 1448 | */ |
1479 | 1449 | static boolean supportsMutation(PersistentProperty<?> property) { |
|
0 commit comments