Skip to content

Commit

Permalink
clean up some generic typing
Browse files Browse the repository at this point in the history
along with some other compiler warnings
  • Loading branch information
gavinking committed Jan 24, 2025
1 parent 8d2c875 commit f83a721
Show file tree
Hide file tree
Showing 10 changed files with 291 additions and 271 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ public enum Kind {
private Map<String,String> explicitLocalTypeParams;

private Function<TypeConfiguration, JdbcType> explicitJdbcTypeAccess;
private Function<TypeConfiguration, BasicJavaType> explicitJavaTypeAccess;
private Function<TypeConfiguration, MutabilityPlan> explicitMutabilityAccess;
private Function<TypeConfiguration, BasicJavaType<?>> explicitJavaTypeAccess;
private Function<TypeConfiguration, MutabilityPlan<?>> explicitMutabilityAccess;
private Function<TypeConfiguration, java.lang.reflect.Type> implicitJavaTypeAccess;

private MemberDetails memberDetails;
Expand Down Expand Up @@ -749,8 +749,7 @@ private void prepareCollectionElement(
if ( elementCollectionAnn != null ) {
final Class<?> targetClassDetails = elementCollectionAnn.targetClass();
if ( targetClassDetails != void.class) {
//noinspection rawtypes
final Function<TypeConfiguration, BasicJavaType> original = explicitJavaTypeAccess;
final Function<TypeConfiguration, BasicJavaType<?>> original = explicitJavaTypeAccess;
explicitJavaTypeAccess = typeConfiguration -> {
final BasicJavaType<?> originalResult = original.apply( typeConfiguration );
if ( originalResult != null ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class InferredBasicValueResolution<J,T> implements BasicValue.Resolution<
private final JdbcMapping jdbcMapping;

private final BasicType<J> legacyType;
private BasicType<?> updatedType;
private BasicType<J> updatedType;

public InferredBasicValueResolution(
JdbcMapping jdbcMapping,
Expand All @@ -49,7 +49,7 @@ public JdbcMapping getJdbcMapping() {

@Override
public BasicType<J> getLegacyResolvedBasicType() {
return updatedType == null ? legacyType : (BasicType<J>) updatedType;
return updatedType == null ? legacyType : updatedType;
}

@Override
Expand All @@ -67,11 +67,10 @@ public JdbcType getJdbcType() {
return updatedType == null ? jdbcType : updatedType.getJdbcType();
}

@Override
@Override @SuppressWarnings("unchecked")
public BasicValueConverter<J,T> getValueConverter() {
//noinspection unchecked
return updatedType == null
? (BasicValueConverter<J, T>) jdbcMapping.getValueConverter()
? jdbcMapping.getValueConverter()
: (BasicValueConverter<J, T>) updatedType.getValueConverter();
}

Expand All @@ -80,8 +79,8 @@ public MutabilityPlan<J> getMutabilityPlan() {
return mutabilityPlan;
}

@Override
@Override @SuppressWarnings("unchecked")
public void updateResolution(BasicType<?> type) {
this.updatedType = type;
updatedType = (BasicType<J>) type;
}
}
Loading

0 comments on commit f83a721

Please sign in to comment.