Skip to content

Move off deprecated API #3307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.x-GH-3305-SNAPSHOT</version>

<name>Spring Data Core</name>
<description>Core Spring concepts underpinning every Spring Data module.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ static class BeanFactoryAwarePropertyValueConverterFactory implements PropertyVa
PropertyValueConverter<DV, SV, C> converter = beanFactory.getBeanProvider(converterType).getIfAvailable();

if (converter == null && beanFactory instanceof AutowireCapableBeanFactory) {
return (PropertyValueConverter<DV, SV, C>) ((AutowireCapableBeanFactory) beanFactory).createBean(converterType,
AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR, false);
return (PropertyValueConverter<DV, SV, C>) ((AutowireCapableBeanFactory) beanFactory).createBean(converterType);
}

return converter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)

//
hints.reflection().registerType(Throwable.class,
builder -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS));
builder -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.ACCESS_DECLARED_FIELDS));

// SpEL support
hints.reflection().registerType(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,7 @@ private void contributeRepositoryInfo(AotRepositoryContext repositoryContext, Ge

// Kotlin
if (isKotlinCoroutineRepository(repositoryContext, repositoryInformation)) {
contribution.getRuntimeHints().reflection().registerTypes(kotlinRepositoryReflectionTypeReferences(),
hint -> hint.withMembers(MemberCategory.INTROSPECT_PUBLIC_METHODS));
contribution.getRuntimeHints().reflection().registerTypes(kotlinRepositoryReflectionTypeReferences(), hint -> {});
}

// Repository query methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.function.Predicate;
import java.util.stream.Stream;

import org.jspecify.annotations.Nullable;
import org.springframework.data.domain.Limit;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
Expand All @@ -41,7 +42,6 @@
import org.springframework.data.util.ReactiveWrappers;
import org.springframework.data.util.ReflectionUtils;
import org.springframework.data.util.TypeInformation;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import java.lang.annotation.ElementType;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

Expand Down Expand Up @@ -245,8 +246,8 @@ public boolean equals(@Nullable Object o) {
@Override
public int hashCode() {
int result = (nullableReturn ? 1 : 0);
result = (31 * result) + ObjectUtils.nullSafeHashCode(nullableParameters);
result = (31 * result) + ObjectUtils.nullSafeHashCode(methodParameters);
result = (31 * result) + Arrays.hashCode(nullableParameters);
result = (31 * result) + Arrays.hashCode(methodParameters);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static void contributeEntityPath(Class<?> type, GenerationContext context
logger.debug("Registering Q type %s for %s.");
context.getRuntimeHints().reflection().registerType(TypeReference.of(queryClassName),
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
MemberCategory.INTROSPECT_DECLARED_METHODS, MemberCategory.DECLARED_FIELDS);
MemberCategory.ACCESS_DECLARED_FIELDS);
} else {
logger.debug("Skipping Q type %s. Not an EntityPath.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static void contribute(Class<?> type, Predicate<Class<? extends Annotatio
if (type.isAnnotation() && filter.test((Class<? extends Annotation>) type)) {

contribution.getRuntimeHints().reflection().registerType(type,
hint -> hint.withMembers(MemberCategory.INTROSPECT_PUBLIC_METHODS));
hint -> {});

return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.function.Consumer;

import org.jspecify.annotations.Nullable;

import org.springframework.core.MethodParameter;
import org.springframework.core.annotation.MergedAnnotation;
import org.springframework.core.annotation.MergedAnnotations;
Expand Down Expand Up @@ -126,7 +125,7 @@ public void setFallbackSort(Sort fallbackSort) {
protected Sort getDefaultFromAnnotationOrFallback(MethodParameter parameter) {

MergedAnnotations mergedAnnotations = MergedAnnotations.from(parameter, parameter.getParameterAnnotations(),
RepeatableContainers.of(SortDefault.class, SortDefaults.class));
RepeatableContainers.explicitRepeatable(SortDefault.class, SortDefaults.class));

List<MergedAnnotation<SortDefault>> annotations = mergedAnnotations.stream(SortDefault.class).toList();

Expand Down