lanky228 opened a new pull request, #5062:
URL: https://github.com/apache/calcite/pull/5062
## Summary
Replace `java.util.Stack` with `java.util.ArrayDeque` in two locations as
per existing TODO comments.
## Changes
- **`core/src/main/java/org/apache/calcite/runtime/Pattern.java`**: Replace
`Stack<Pattern>` with `Deque<Pattern>` in `PatternBuilder.stack` field
-
**`core/src/main/java/org/apache/calcite/plan/volcano/TopDownRuleDriver.java`**:
Replace `Stack<Task>` with `Deque<Task>` in task queue
Also removed:
- `@SuppressWarnings("JdkObsolete")` annotations
- TODO comments requesting this change
## Rationale
`java.util.Stack` extends `Vector` and provides unnecessary synchronized
access for single-threaded usage patterns in both `Pattern` and
`TopDownRuleDriver`. The Java documentation officially discourages using
`Stack` and recommends using `Deque` implementations like `ArrayDeque` instead,
which provides better performance without synchronization overhead.
## Testing
- Compilation: BUILD SUCCESSFUL
- Tests passed: AutomatonTest (9 tests), DeterministicAutomatonTest (4
tests), EnumerablesTest (53 tests)
- No remaining `java.util.Stack` references in `core/src/main`
## Related
- JIRA: [CALCITE-7632](https://issues.apache.org/jira/browse/CALCITE-7632)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]