Skip to content

Commit

Permalink
HHH-16091 Make AbstractStandardBasicType#getMutabilityPlan return a c…
Browse files Browse the repository at this point in the history
…onstant too
  • Loading branch information
Sanne committed Jan 25, 2023
1 parent b77bbf0 commit 12c7252
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public abstract class AbstractStandardBasicType<T>
private final JdbcLiteralFormatter<T> jdbcLiteralFormatter;
private final AbstractClassJavaType<T> javaTypeAsAbstractClassJavaType;
private final Class javaTypeClass;
private final MutabilityPlan<T> mutabilityPlan;

public AbstractStandardBasicType(JdbcType jdbcType, JavaType<T> javaType) {
this.jdbcType = jdbcType;
Expand All @@ -60,8 +61,9 @@ public AbstractStandardBasicType(JdbcType jdbcType, JavaType<T> javaType) {
this.jdbcValueExtractor = jdbcType.getExtractor( javaType );
this.jdbcLiteralFormatter = jdbcType.getJdbcLiteralFormatter( javaType );

//A very simple dispatch optimisation, make this a constant:
//A very simple dispatch optimisation, make these a constant:
this.javaTypeClass = javaType.getJavaTypeClass();
this.mutabilityPlan = javaType.getMutabilityPlan();
//This is a dispatch optimisation to avoid megamorphic invocations on the most common type:
if ( javaType instanceof AbstractClassJavaType ) {
this.javaTypeAsAbstractClassJavaType = (AbstractClassJavaType) javaType;
Expand Down Expand Up @@ -96,7 +98,7 @@ public T fromString(CharSequence string) {
}

protected MutabilityPlan<T> getMutabilityPlan() {
return javaType.getMutabilityPlan();
return this.mutabilityPlan;
}

@Override
Expand Down

0 comments on commit 12c7252

Please sign in to comment.