Skip to content

Commit 573ccbc

Browse files
committed
fix some compiler warnings in GraphParser
1 parent ceec437 commit 573ccbc

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/**
1818
* Parser for string representations of JPA {@link jakarta.persistence.EntityGraph}
1919
* ({@link RootGraph}) and {@link jakarta.persistence.Subgraph} ({@link SubGraph}),
20-
* using a simple syntax defined by the `graph.g` Antlr grammar.
20+
* using a simple syntax defined by the {@code graph.g} ANTLR grammar.
2121
* <p>
2222
* The {@link #parse} methods all create a root {@link jakarta.persistence.EntityGraph}
2323
* based on the passed entity class and parse the graph string into that root graph.

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import org.hibernate.grammars.graph.GraphLanguageLexer;
99
import org.hibernate.grammars.graph.GraphLanguageParser;
1010
import org.hibernate.grammars.graph.GraphLanguageParserBaseVisitor;
11+
import org.hibernate.graph.GraphNode;
1112
import org.hibernate.graph.InvalidGraphException;
1213
import org.hibernate.graph.spi.AttributeNodeImplementor;
1314
import org.hibernate.graph.spi.GraphImplementor;
@@ -24,7 +25,7 @@
2425
/**
2526
* @author Steve Ebersole
2627
*/
27-
public class GraphParser extends GraphLanguageParserBaseVisitor {
28+
public class GraphParser extends GraphLanguageParserBaseVisitor<GraphNode<?>> {
2829

2930
/**
3031
* Parse the passed graph textual representation into the passed Graph.
@@ -64,16 +65,16 @@ public static void parseInto(
6465

6566
private final SessionFactoryImplementor sessionFactory;
6667

67-
private final Stack<GraphImplementor> graphStack = new StandardStack<>();
68-
private final Stack<AttributeNodeImplementor> attributeNodeStack = new StandardStack<>();
68+
private final Stack<GraphImplementor<?>> graphStack = new StandardStack<>();
69+
private final Stack<AttributeNodeImplementor<?,?,?>> attributeNodeStack = new StandardStack<>();
6970
private final Stack<SubGraphGenerator> graphSourceStack = new StandardStack<>();
7071

7172
public GraphParser(SessionFactoryImplementor sessionFactory) {
7273
this.sessionFactory = sessionFactory;
7374
}
7475

7576
@Override
76-
public AttributeNodeImplementor visitAttributeNode(GraphLanguageParser.AttributeNodeContext ctx) {
77+
public AttributeNodeImplementor<?,?,?> visitAttributeNode(GraphLanguageParser.AttributeNodeContext ctx) {
7778
final String attributeName = ctx.attributePath().ATTR_NAME().getText();
7879

7980
final SubGraphGenerator subGraphCreator;
@@ -105,7 +106,7 @@ public AttributeNodeImplementor visitAttributeNode(GraphLanguageParser.Attribute
105106
subGraphCreator = pathQualifierType.getSubGraphCreator();
106107
}
107108

108-
final AttributeNodeImplementor attributeNode = resolveAttributeNode( attributeName );
109+
final AttributeNodeImplementor<?,?,?> attributeNode = resolveAttributeNode( attributeName );
109110

110111
if ( ctx.subGraph() != null ) {
111112
attributeNodeStack.push( attributeNode );
@@ -132,12 +133,11 @@ public AttributeNodeImplementor visitAttributeNode(GraphLanguageParser.Attribute
132133
return attributeNode;
133134
}
134135

135-
136-
private AttributeNodeImplementor resolveAttributeNode(String attributeName) {
136+
private AttributeNodeImplementor<?,?,?> resolveAttributeNode(String attributeName) {
137137
final GraphImplementor<?> currentGraph = graphStack.getCurrent();
138138
assert currentGraph != null;
139139

140-
final AttributeNodeImplementor attributeNode = currentGraph.findOrCreateAttributeNode( attributeName );
140+
final AttributeNodeImplementor<?,?,?> attributeNode = currentGraph.findOrCreateAttributeNode( attributeName );
141141
assert attributeNode != null;
142142

143143
return attributeNode;
@@ -156,7 +156,7 @@ private PathQualifierType resolvePathQualifier(String qualifier) {
156156
}
157157

158158
@Override
159-
public SubGraphImplementor visitSubGraph(GraphLanguageParser.SubGraphContext ctx) {
159+
public SubGraphImplementor<?> visitSubGraph(GraphLanguageParser.SubGraphContext ctx) {
160160
final String subTypeName = ctx.subType() == null ? null : ctx.subType().getText();
161161

162162
if ( PARSING_LOGGER.isDebugEnabled() ) {

0 commit comments

Comments
 (0)