Skip to content

Commit 464ad48

Browse files
quaffbeikov
authored andcommitted
Mark field INSTANCE as private or deprecated for removal if method instance() present
1 parent c181e19 commit 464ad48

19 files changed

+38
-21
lines changed

hibernate-core/src/main/java/org/hibernate/internal/util/compare/ComparableComparator.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
* @author Gavin King
1616
* @author Steve Ebersole
1717
*/
18+
@SuppressWarnings("rawtypes")
1819
public class ComparableComparator<T extends Comparable> implements Comparator<T>, Serializable {
20+
1921
public static final Comparator INSTANCE = new ComparableComparator();
2022

2123
@SuppressWarnings("unchecked")

hibernate-core/src/main/java/org/hibernate/internal/util/compare/RowVersionComparator.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@ private RowVersionComparator() {
1919
}
2020

2121
@Override
22-
@SuppressWarnings("unchecked")
2322
public int compare(byte[] o1, byte[] o2) {
2423
final int lengthToCheck = Math.min( o1.length, o2.length );
2524

2625
for ( int i = 0 ; i < lengthToCheck ; i++ ) {
2726
// must do an unsigned int comparison
28-
final int comparison = ComparableComparator.INSTANCE.compare(
27+
final int comparison = ComparableComparator.<Integer>instance().compare(
2928
Byte.toUnsignedInt( o1[i] ),
3029
Byte.toUnsignedInt( o2[i] )
3130
);

hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/AbstractEmbeddableMapping.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ public Object assemble(Serializable cached, SharedSessionContract session) {
836836
};
837837
}
838838
else {
839-
return ImmutableMutabilityPlan.INSTANCE;
839+
return ImmutableMutabilityPlan.instance();
840840
}
841841
}
842842
}

hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddableMappingTypeImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ public Object assemble(Serializable cached, SharedSessionContract session) {
695695
};
696696
}
697697
else {
698-
return ImmutableMutabilityPlan.INSTANCE;
698+
return ImmutableMutabilityPlan.instance();
699699
}
700700
}
701701

hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/GeneratedValuesProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private List<Object[]> executeSelect(Object id, SharedSessionContractImplementor
176176
jdbcSelect,
177177
jdbcParamBindings,
178178
new NoCallbackExecutionContext( session ),
179-
RowTransformerArrayImpl.INSTANCE,
179+
RowTransformerArrayImpl.instance(),
180180
null,
181181
FILTER,
182182
1

hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,13 +438,13 @@ public Object assemble(Serializable cached, SharedSessionContract session) {
438438
};
439439
}
440440
else {
441-
return ImmutableMutabilityPlan.INSTANCE;
441+
return ImmutableMutabilityPlan.instance();
442442
}
443443
}
444444

445445
@SuppressWarnings("rawtypes")
446446
public static AttributeMetadata getAttributeMetadata(PropertyAccess propertyAccess) {
447-
return new SimpleAttributeMetadata( propertyAccess, ImmutableMutabilityPlan.INSTANCE, false, true, false, false, true, null);// todo (6.0) : not sure if CascadeStyle=null is correct
447+
return new SimpleAttributeMetadata( propertyAccess, ImmutableMutabilityPlan.instance(), false, true, false, false, true, null);// todo (6.0) : not sure if CascadeStyle=null is correct
448448
}
449449

450450
@SuppressWarnings("rawtypes")

hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/SingleAttributeIdentifierMapping.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@ default boolean isIncludedInOptimisticLocking() {
8585

8686
@Override
8787
default MutabilityPlan getMutabilityPlan() {
88-
return ImmutableMutabilityPlan.INSTANCE;
88+
return ImmutableMutabilityPlan.instance();
8989
}
9090
}

hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/MatchingIdSelectionHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public <T> MappingModelExpressible<T> getResolvedMappingModelType(SqmParameter<T
316316
rowTransformer = RowTransformerSingularReturnImpl.instance();
317317
}
318318
else {
319-
rowTransformer = RowTransformerArrayImpl.INSTANCE;
319+
rowTransformer = RowTransformerArrayImpl.instance();
320320
}
321321
//noinspection unchecked
322322
return jdbcServices.getJdbcSelectExecutor().list(

hibernate-core/src/main/java/org/hibernate/result/internal/OutputsImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ protected List<Object> extractResults(ResultSet resultSet) {
188188
//noinspection unchecked
189189
final RowReader<Object> rowReader = (RowReader<Object>) ResultsHelper.createRowReader(
190190
getSessionFactory(),
191-
RowTransformerStandardImpl.INSTANCE,
191+
RowTransformerStandardImpl.instance(),
192192
null,
193193
jdbcValues
194194
);

hibernate-core/src/main/java/org/hibernate/sql/results/internal/RowTransformerArrayImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class RowTransformerArrayImpl implements RowTransformer<Object[]> {
1717
/**
1818
* Singleton access
1919
*/
20-
public static final RowTransformerArrayImpl INSTANCE = new RowTransformerArrayImpl();
20+
private static final RowTransformerArrayImpl INSTANCE = new RowTransformerArrayImpl();
2121

2222
public static RowTransformerArrayImpl instance() {
2323
return INSTANCE;

0 commit comments

Comments
 (0)