Skip to content

Commit daa830f

Browse files
Remove unused method
Signed-off-by: Tran Ngoc Nhan <[email protected]>
1 parent 039ce57 commit daa830f

File tree

1 file changed

+6
-36
lines changed

1 file changed

+6
-36
lines changed

src/main/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactory.java

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import java.util.Set;
3939
import java.util.concurrent.atomic.AtomicInteger;
4040
import java.util.function.Function;
41-
import java.util.stream.Collectors;
4241

4342
import org.jspecify.annotations.Nullable;
4443

@@ -57,7 +56,6 @@
5756
import org.springframework.data.mapping.SimplePropertyHandler;
5857
import org.springframework.data.mapping.model.KotlinCopyMethod.KotlinCopyByProperty;
5958
import org.springframework.data.mapping.model.KotlinValueUtils.ValueBoxing;
60-
import org.springframework.data.util.Optionals;
6159
import org.springframework.util.Assert;
6260
import org.springframework.util.ClassUtils;
6361
import org.springframework.util.ConcurrentLruCache;
@@ -318,9 +316,9 @@ private Class<PersistentPropertyAccessor<?>> loadOrCreateAccessorClass(Persisten
318316
* // …
319317
* case 3357:
320318
* 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 }));
324322
* }
325323
* }
326324
* }
@@ -611,27 +609,6 @@ static boolean requiresMethodHandleSetup(PersistentEntity<?, ?> entity,
611609
return false;
612610
}
613611

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-
635612
/**
636613
* Generate property getter initializer.
637614
*/
@@ -1281,8 +1258,8 @@ private static void visitSetField(PersistentEntity<?, ?> entity, PersistentPrope
12811258
* Creates the method signature containing parameter types (e.g. (Ljava/lang/Object)I for a method accepting
12821259
* {@link Object} and returning a primitive {@code int}).
12831260
*
1284-
* @param method
1285-
* @return
1261+
* @param method must not be {@literal null}.
1262+
* @return a string representation of the given method.
12861263
* @since 2.1
12871264
*/
12881265
private static String getArgumentSignature(Method method) {
@@ -1401,13 +1378,6 @@ private static boolean generateMethodHandle(PersistentEntity<?, ?> entity, @Null
14011378
return true;
14021379
}
14031380

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-
14111381
static String generateClassName(PersistentEntity<?, ?> entity) {
14121382
return entity.getType().getName() + TAG + Integer.toString(Math.abs(entity.getType().getName().hashCode()), 36);
14131383
}
@@ -1473,7 +1443,7 @@ public int compareTo(PropertyStackAddress o) {
14731443
}
14741444

14751445
/**
1476-
* @param property
1446+
* @param property the persistent property to inspect.
14771447
* @return {@literal true} if object mutation is supported.
14781448
*/
14791449
static boolean supportsMutation(PersistentProperty<?> property) {

0 commit comments

Comments
 (0)