Skip to content

Commit 3d0545e

Browse files
committed
HHH-18875 Avoid using the deprecated constructors of StandardStack
1 parent 76b3105 commit 3d0545e

File tree

8 files changed

+18
-19
lines changed

8 files changed

+18
-19
lines changed

hibernate-core/src/main/java/org/hibernate/graph/internal/parse/GraphParser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ public static void parseInto(
6464

6565
private final SessionFactoryImplementor sessionFactory;
6666

67-
private final Stack<GraphImplementor> graphStack = new StandardStack<>( GraphImplementor.class );
68-
private final Stack<AttributeNodeImplementor> attributeNodeStack = new StandardStack<>( AttributeNodeImplementor.class );
69-
private final Stack<SubGraphGenerator> graphSourceStack = new StandardStack<>(SubGraphGenerator.class);
67+
private final Stack<GraphImplementor> graphStack = new StandardStack<>();
68+
private final Stack<AttributeNodeImplementor> attributeNodeStack = new StandardStack<>();
69+
private final Stack<SubGraphGenerator> graphSourceStack = new StandardStack<>();
7070

7171
public GraphParser(SessionFactoryImplementor sessionFactory) {
7272
this.sessionFactory = sessionFactory;

hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ public static <R> SqmStatement<R> buildSemanticModel(
308308

309309
private final Stack<DotIdentifierConsumer> dotIdentifierConsumerStack;
310310

311-
private final Stack<ParameterDeclarationContext> parameterDeclarationContextStack = new StandardStack<>( ParameterDeclarationContext.class );
312-
private final Stack<SqmCreationProcessingState> processingStateStack = new StandardStack<>( SqmCreationProcessingState.class );
311+
private final Stack<ParameterDeclarationContext> parameterDeclarationContextStack = new StandardStack<>();
312+
private final Stack<SqmCreationProcessingState> processingStateStack = new StandardStack<>();
313313

314314
private final BasicDomainType<Integer> integerDomainType;
315315
private final JavaType<List<?>> listJavaType;
@@ -382,7 +382,6 @@ private SemanticQueryBuilder(
382382
this.creationContext = creationContext;
383383
this.query = query;
384384
this.dotIdentifierConsumerStack = new StandardStack<>(
385-
DotIdentifierConsumer.class,
386385
new BasicDotIdentifierConsumer( this )
387386
);
388387
this.parameterStyle = creationOptions.useStrictJpaCompliance()

hibernate-core/src/main/java/org/hibernate/query/results/internal/DomainResultCreationStateImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public class DomainResultCreationStateImpl
7777
private final LegacyFetchResolver legacyFetchResolver;
7878
private final SessionFactoryImplementor sessionFactory;
7979

80-
private final Stack<Function> fetchBuilderResolverStack = new StandardStack<>( Function.class, fetchableName -> null );
80+
private final Stack<Function> fetchBuilderResolverStack = new StandardStack<>( fetchableName -> null );
8181
private Map<String, LockMode> registeredLockModes;
8282
private boolean processingKeyFetches = false;
8383
private boolean resolvingCircularFetch;

hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
488488
private boolean deduplicateSelectionItems;
489489
private ForeignKeyDescriptor.Nature currentlyResolvingForeignKeySide;
490490
private SqmStatement<?> currentSqmStatement;
491-
private Stack<SqmQueryPart> sqmQueryPartStack = new StandardStack<>( SqmQueryPart.class );
491+
private Stack<SqmQueryPart> sqmQueryPartStack = new StandardStack<>();
492492
private CteContainer cteContainer;
493493
/**
494494
* A map from {@link SqmCteTable#getCteName()} to the final SQL name.
@@ -506,8 +506,8 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
506506
private List<Map.Entry<OrderByFragment, TableGroup>> orderByFragments;
507507

508508
private final SqlAliasBaseManager sqlAliasBaseManager = new SqlAliasBaseManager();
509-
private final Stack<SqlAstProcessingState> processingStateStack = new StandardStack<>( SqlAstProcessingState.class );
510-
private final Stack<FromClauseIndex> fromClauseIndexStack = new StandardStack<>( FromClauseIndex.class );
509+
private final Stack<SqlAstProcessingState> processingStateStack = new StandardStack<>();
510+
private final Stack<FromClauseIndex> fromClauseIndexStack = new StandardStack<>();
511511

512512
// Captures all entity name uses under which a table group is being used within the current conjunct.
513513
// Outside a top level conjunct, it represents the "global uses" i.e. select, from, group and order by clauses.
@@ -521,9 +521,9 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
521521
private SqmJoin<?, ?> currentlyProcessingJoin;
522522
protected Predicate additionalRestrictions;
523523

524-
private final Stack<Clause> currentClauseStack = new StandardStack<>( Clause.class );
525-
private final Stack<Supplier> inferrableTypeAccessStack = new StandardStack<>( Supplier.class );
526-
private final Stack<List> queryTransformers = new StandardStack<>( List.class );
524+
private final Stack<Clause> currentClauseStack = new StandardStack<>();
525+
private final Stack<Supplier> inferrableTypeAccessStack = new StandardStack<>();
526+
private final Stack<List> queryTransformers = new StandardStack<>();
527527
private boolean inTypeInference;
528528
private boolean inImpliedResultTypeInference;
529529
private boolean inNestedContext;

hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,9 @@ public abstract class AbstractSqlAstTranslator<T extends JdbcOperation> implemen
304304
private final ParameterMarkerStrategy parameterMarkerStrategy;
305305

306306

307-
private final Stack<Clause> clauseStack = new StandardStack<>( Clause.class );
308-
private final Stack<QueryPart> queryPartStack = new StandardStack<>( QueryPart.class );
309-
private final Stack<Statement> statementStack = new StandardStack<>( Statement.class );
307+
private final Stack<Clause> clauseStack = new StandardStack<>();
308+
private final Stack<QueryPart> queryPartStack = new StandardStack<>();
309+
private final Stack<Statement> statementStack = new StandardStack<>();
310310

311311
private final Dialect dialect;
312312
private final Set<String> affectedTableNames = new HashSet<>();

hibernate-core/src/main/java/org/hibernate/sql/results/graph/DomainResultGraphPrinter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static void logDomainResultGraph(String header, List<DomainResult<?>> dom
4545
}
4646

4747
private final StringBuilder buffer;
48-
private final Stack<FetchParent> fetchParentStack = new StandardStack<>( FetchParent.class );
48+
private final Stack<FetchParent> fetchParentStack = new StandardStack<>();
4949

5050
private DomainResultGraphPrinter(String header) {
5151
buffer = new StringBuilder( header + ":" + System.lineSeparator() );

hibernate-core/src/main/java/org/hibernate/sql/results/spi/LoadContexts.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class LoadContexts {
2424
private static final CoreMessageLogger log = CoreLogging.messageLogger( LoadContexts.class );
2525

2626
private final PersistenceContext persistenceContext;
27-
private final StandardStack<JdbcValuesSourceProcessingState> jdbcValuesSourceProcessingStateStack = new StandardStack<>( JdbcValuesSourceProcessingState.class );
27+
private final StandardStack<JdbcValuesSourceProcessingState> jdbcValuesSourceProcessingStateStack = new StandardStack<>();
2828

2929
public LoadContexts(PersistenceContext persistenceContext) {
3030
this.persistenceContext = persistenceContext;

hibernate-core/src/test/java/org/hibernate/orm/test/util/StandardStackTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public void testFindCurrentFirstWithParameterCleared() {
146146
// utility functions
147147

148148
private Stack<Integer> allocateStack(int size) {
149-
final Stack<Integer> stack = new StandardStack<>( Integer.class );
149+
final Stack<Integer> stack = new StandardStack<>();
150150
for ( int i = 0; i < size; i++ ) {
151151
stack.push( i );
152152
}

0 commit comments

Comments
 (0)