[
https://issues.apache.org/jira/browse/CALCITE-5908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17752516#comment-17752516
]
Julian Hyde commented on CALCITE-5908:
--------------------------------------
It's a reasonable refactoring. I was concerned that without the
'requireNonNull' CheckerFramework would not be able to deduce that the fields
were non-null. But that is not the case. Also, I think the concurrent
modification problem you saw is something else. So, I have modified your change
slightly (see
[ac5e149|https://github.com/julianhyde/calcite/commit/ac5e1498f399a88d65f83c208792eb40df9ed688])
and if you have no objections I'll merge.
> Remove unnecessary NULL checks in CalciteSchema
> -----------------------------------------------
>
> Key: CALCITE-5908
> URL: https://issues.apache.org/jira/browse/CALCITE-5908
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.35.0
> Reporter: Ran Tao
> Assignee: Ran Tao
> Priority: Minor
> Labels: pull-request-available
>
> When i read the source code of `CalciteSchema` found so many null checks
> below:
>
> {code:java}
> if (tableMap == null) {
> this.tableMap = new NameMap<>();
> } else {
> this.tableMap = Objects.requireNonNull(tableMap, "tableMap");
> }
> if (latticeMap == null) {
> this.latticeMap = new NameMap<>();
> } else {
> this.latticeMap = Objects.requireNonNull(latticeMap, "latticeMap");
> } {code}
> i think we can remove it. it was misleading.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)