Skip to content

Commit dd858e3

Browse files
committed
miscellaneous code cleanups
1 parent 9d30d21 commit dd858e3

File tree

12 files changed

+295
-377
lines changed

12 files changed

+295
-377
lines changed

hibernate-core/src/main/java/org/hibernate/NaturalIdLoadAccess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ default NaturalIdLoadAccess<T> withLoadGraph(RootGraph<T> graph) {
154154
* @deprecated use {@link #using(Map)} with {@link Map#of}, which is
155155
* slightly more typesafe
156156
*/
157-
@Deprecated(since = "6.3")
157+
@Deprecated(since = "6.3", forRemoval = true)
158158
NaturalIdLoadAccess<T> using(Object... mappings);
159159

160160
/**

hibernate-core/src/main/java/org/hibernate/NaturalIdMultiLoadAccess.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
*/
55
package org.hibernate;
66

7+
import java.util.HashMap;
78
import java.util.List;
89
import java.util.Map;
910

1011
import org.hibernate.graph.GraphSemantic;
1112
import org.hibernate.graph.RootGraph;
12-
13-
import static org.hibernate.internal.util.collections.CollectionHelper.asMap;
13+
import org.hibernate.internal.util.collections.CollectionHelper;
1414

1515
/**
1616
* Loads multiple instances of a given entity type at once, by
@@ -184,8 +184,17 @@ default NaturalIdMultiLoadAccess<T> with(RootGraph<T> graph) {
184184
*
185185
* @deprecated use {@link Map#of} instead
186186
*/
187-
@Deprecated(since = "6.3")
187+
@Deprecated(since = "6.3", forRemoval = true)
188188
static Map<String,?> compoundValue(Object... elements) {
189-
return asMap( elements );
189+
assert elements != null;
190+
assert elements.length % 2 == 0;
191+
192+
final HashMap<String, Object> map = new HashMap<>();
193+
CollectionHelper.collectMapEntries( map::put, elements );
194+
for ( int i = 0; i < elements.length; i += 2 ) {
195+
map.put( (String) elements[ i ], (Object) elements[ i+1 ] );
196+
}
197+
198+
return map;
190199
}
191200
}

hibernate-core/src/main/java/org/hibernate/boot/model/internal/GeneratorBinder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import org.hibernate.internal.CoreLogging;
4444
import org.hibernate.internal.CoreMessageLogger;
4545
import org.hibernate.internal.util.StringHelper;
46-
import org.hibernate.internal.util.collections.CollectionHelper;
4746
import org.hibernate.mapping.GeneratorCreator;
4847
import org.hibernate.mapping.KeyValue;
4948
import org.hibernate.mapping.PersistentClass;
@@ -74,6 +73,7 @@
7473
import static org.hibernate.id.IdentifierGenerator.GENERATOR_NAME;
7574
import static org.hibernate.internal.util.NullnessUtil.castNonNull;
7675
import static org.hibernate.internal.util.StringHelper.qualify;
76+
import static org.hibernate.internal.util.collections.CollectionHelper.combineUntyped;
7777
import static org.hibernate.resource.beans.internal.Helper.allowExtensionsInCdi;
7878

7979
/**
@@ -883,7 +883,7 @@ static void createIdGeneratorsFromGeneratorAnnotations(
883883
Locale.ROOT,
884884
"Identifier attribute '%s' has too many generator annotations: %s",
885885
getPath( propertyHolder, inferredData ),
886-
CollectionHelper.combineUntyped( idGeneratorAnnotations, generatorAnnotations )
886+
combineUntyped( idGeneratorAnnotations, generatorAnnotations )
887887
) );
888888
}
889889
if ( !idGeneratorAnnotations.isEmpty() ) {

0 commit comments

Comments
 (0)