You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by jh...@apache.org on 2023/05/29 21:22:11 UTC

[calcite] 02/02: Code style: improve Javadoc

This is an automated email from the ASF dual-hosted git repository.

jhyde pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite.git

commit c4042a34ef054b89cec1c47fefcbc8689bad55be
Author: Julian Hyde <jh...@apache.org>
AuthorDate: Sun May 28 17:04:36 2023 -0700

    Code style: improve Javadoc
    
    * Javadoc paragraphs (starting with '<p>') must have a blank
      line before;
    * Javadoc paragraphs must have exactly one space between the
      '*' or '/**' at the start of the line and the first
      non-whitespace character;
    * Ensure that '<p>' is not at the end of a line;
    * Remove '</p>'; they are not required because Javadoc is
      HTML, not XHTML;
    * Require blank line between description and first @param,
      @return, etc.
    * Replace all '**/' with '*/'.
---
 .../calcite/sql/babel/postgresql/SqlBegin.java     |  1 +
 .../calcite/sql/babel/postgresql/SqlCommit.java    |  1 +
 .../calcite/sql/babel/postgresql/SqlDiscard.java   |  1 +
 .../calcite/sql/babel/postgresql/SqlRollback.java  |  1 +
 .../calcite/sql/babel/postgresql/SqlShow.java      |  1 +
 .../calcite/adapter/cassandra/CassandraRules.java  |  6 +-
 .../calcite/adapter/cassandra/package-info.java    |  2 +-
 .../apache/calcite/test/CassandraExtension.java    |  9 +--
 .../main/java/org/apache/calcite/DataContext.java  |  2 +-
 .../apache/calcite/adapter/clone/ArrayTable.java   |  6 +-
 .../calcite/adapter/enumerable/AggAddContext.java  |  2 +
 .../calcite/adapter/enumerable/AggContext.java     |  2 +
 .../calcite/adapter/enumerable/EnumUtils.java      |  4 +-
 .../adapter/enumerable/EnumerableRules.java        |  6 +-
 .../adapter/enumerable/EnumerableTableScan.java    |  6 +-
 .../calcite/adapter/enumerable/MatchUtils.java     |  1 +
 .../adapter/enumerable/NestedBlockBuilder.java     |  3 +
 .../adapter/enumerable/NestedBlockBuilderImpl.java |  4 ++
 .../calcite/adapter/enumerable/NullPolicy.java     |  2 +-
 .../calcite/adapter/enumerable/PhysType.java       |  4 +-
 .../adapter/enumerable/RexToLixTranslator.java     |  1 +
 .../adapter/enumerable/StrictAggImplementor.java   |  1 +
 .../enumerable/StrictWinAggImplementor.java        |  1 +
 .../adapter/enumerable/WinAggAddContext.java       |  2 +
 .../adapter/enumerable/WinAggFrameContext.java     |  6 ++
 .../enumerable/WinAggFrameResultContext.java       |  5 ++
 .../adapter/enumerable/WinAggImplementor.java      |  5 ++
 .../adapter/enumerable/WinAggResultContext.java    |  2 +
 .../enumerable/impl/WinAggResetContextImpl.java    |  1 +
 .../calcite/adapter/jdbc/JdbcConvention.java       |  6 +-
 .../apache/calcite/adapter/jdbc/JdbcSchema.java    |  2 +-
 .../org/apache/calcite/adapter/jdbc/JdbcTable.java |  2 +-
 .../calcite/config/CalciteConnectionProperty.java  |  8 +--
 .../calcite/config/CalciteSystemProperty.java      | 68 ++++++++++++----------
 .../apache/calcite/interpreter/AggregateNode.java  |  1 +
 .../org/apache/calcite/jdbc/CalciteConnection.java |  8 +--
 .../org/apache/calcite/jdbc/CalciteSchema.java     | 10 ++--
 .../apache/calcite/jdbc/ContextSqlValidator.java   |  1 +
 .../org/apache/calcite/jdbc/JavaRecordType.java    |  2 +-
 .../apache/calcite/jdbc/JavaTypeFactoryImpl.java   |  2 +-
 .../calcite/materialize/MaterializationActor.java  |  4 +-
 .../calcite/materialize/MaterializationKey.java    |  2 +-
 .../calcite/materialize/SqlStatisticProvider.java  |  2 +-
 .../apache/calcite/materialize/package-info.java   |  2 +-
 .../java/org/apache/calcite/model/JsonRoot.java    |  4 +-
 .../java/org/apache/calcite/model/JsonSchema.java  |  6 +-
 .../org/apache/calcite/model/package-info.java     |  4 +-
 .../java/org/apache/calcite/plan/Convention.java   |  4 +-
 .../java/org/apache/calcite/plan/RelDigest.java    |  2 +-
 .../org/apache/calcite/plan/RelOptConnection.java  |  2 +-
 .../calcite/plan/RelOptMaterializations.java       |  3 +
 .../org/apache/calcite/plan/RelOptPlanner.java     |  9 +--
 .../apache/calcite/plan/RelOptPredicateList.java   |  1 +
 .../java/org/apache/calcite/plan/RelOptRule.java   | 16 ++---
 .../org/apache/calcite/plan/RelOptRuleOperand.java |  8 +--
 .../calcite/plan/RelOptRuleOperandChildPolicy.java |  2 +-
 .../java/org/apache/calcite/plan/RelOptSchema.java |  4 +-
 .../java/org/apache/calcite/plan/RelOptTable.java  |  4 +-
 .../java/org/apache/calcite/plan/RelOptUtil.java   | 15 ++---
 .../java/org/apache/calcite/plan/RelTrait.java     | 10 ++--
 .../java/org/apache/calcite/plan/RelTraitDef.java  |  4 +-
 .../main/java/org/apache/calcite/plan/Strong.java  |  8 +--
 .../apache/calcite/plan/SubstitutionVisitor.java   | 38 ++++++------
 .../plan/visualizer/RuleMatchVisualizer.java       |  4 +-
 .../calcite/plan/volcano/AbstractConverter.java    |  2 +-
 .../org/apache/calcite/plan/volcano/Dumpers.java   |  2 +-
 .../calcite/plan/volcano/IterativeRuleQueue.java   |  2 +-
 .../org/apache/calcite/plan/volcano/RelSet.java    |  2 +-
 .../org/apache/calcite/plan/volcano/RelSubset.java |  2 +-
 .../org/apache/calcite/plan/volcano/RuleQueue.java |  2 +
 .../calcite/plan/volcano/TopDownRuleDriver.java    |  6 +-
 .../apache/calcite/plan/volcano/VolcanoCost.java   |  2 +-
 .../calcite/plan/volcano/VolcanoPlanner.java       |  9 ++-
 .../apache/calcite/plan/volcano/package-info.java  | 65 +++++++++++----------
 .../apache/calcite/prepare/CalcitePrepareImpl.java | 16 ++---
 .../calcite/prepare/QueryableRelBuilder.java       |  6 +-
 .../org/apache/calcite/rel/AbstractRelNode.java    | 10 ++--
 .../apache/calcite/rel/InvalidRelException.java    |  6 +-
 .../java/org/apache/calcite/rel/PhysicalNode.java  | 10 ++--
 .../apache/calcite/rel/RelCollationTraitDef.java   |  2 +-
 .../org/apache/calcite/rel/RelDistribution.java    |  2 +-
 .../main/java/org/apache/calcite/rel/RelNode.java  | 16 ++---
 .../java/org/apache/calcite/rel/RelWriter.java     |  4 +-
 .../org/apache/calcite/rel/convert/Converter.java  |  4 +-
 .../apache/calcite/rel/convert/ConverterRule.java  |  2 +-
 .../java/org/apache/calcite/rel/core/Collect.java  |  2 +-
 .../java/org/apache/calcite/rel/core/Filter.java   |  2 +-
 .../java/org/apache/calcite/rel/core/Join.java     |  2 +-
 .../java/org/apache/calcite/rel/core/JoinInfo.java |  2 +-
 .../java/org/apache/calcite/rel/core/Sort.java     |  2 +-
 .../org/apache/calcite/rel/core/SortExchange.java  |  2 +-
 .../org/apache/calcite/rel/core/TableScan.java     |  2 +-
 .../java/org/apache/calcite/rel/core/Window.java   |  2 +
 .../calcite/rel/externalize/RelDotWriter.java      |  1 +
 .../calcite/rel/hint/CompositeHintPredicate.java   |  2 +-
 .../apache/calcite/rel/logical/LogicalCalc.java    |  2 +-
 .../calcite/rel/logical/LogicalCorrelate.java      |  1 +
 .../apache/calcite/rel/logical/LogicalProject.java |  2 +
 .../calcite/rel/logical/LogicalTableScan.java      |  6 +-
 .../rel/metadata/ChainedRelMetadataProvider.java   |  2 +-
 .../org/apache/calcite/rel/metadata/Metadata.java  |  2 +-
 .../calcite/rel/metadata/MetadataFactory.java      |  4 +-
 .../calcite/rel/metadata/MetadataFactoryImpl.java  |  2 +-
 .../rel/metadata/MetadataHandlerProvider.java      |  1 +
 .../metadata/ProxyingMetadataHandlerProvider.java  |  1 +
 .../metadata/ReflectiveRelMetadataProvider.java    |  6 +-
 .../calcite/rel/metadata/RelMdCollation.java       |  1 +
 .../rel/metadata/RelMdExpressionLineage.java       |  1 +
 .../calcite/rel/metadata/RelMdPredicates.java      |  1 +
 .../org/apache/calcite/rel/metadata/RelMdUtil.java |  2 +-
 .../calcite/rel/metadata/RelMetadataProvider.java  |  4 +-
 .../calcite/rel/metadata/RelMetadataQuery.java     |  1 +
 .../calcite/rel/metadata/RelMetadataQueryBase.java |  1 +
 .../rel/metadata/janino/CacheGeneratorUtil.java    | 38 ++++++------
 .../org/apache/calcite/rel/mutable/MutableRel.java |  2 +-
 .../apache/calcite/rel/rel2sql/SqlImplementor.java |  2 +-
 .../rel/rules/AbstractJoinExtractFilterRule.java   |  2 +-
 .../calcite/rel/rules/AggregateJoinRemoveRule.java |  2 +-
 .../org/apache/calcite/rel/rules/CoreRules.java    |  4 +-
 .../FilterFlattenCorrelatedConditionRule.java      | 26 +++++----
 .../apache/calcite/rel/rules/FilterJoinRule.java   |  2 +-
 .../calcite/rel/rules/IntersectToDistinctRule.java |  2 +-
 .../calcite/rel/rules/JoinAssociateRule.java       |  2 +-
 .../apache/calcite/rel/rules/JoinCommuteRule.java  |  2 +-
 .../calcite/rel/rules/JoinPushThroughJoinRule.java |  2 +-
 .../calcite/rel/rules/JoinToCorrelateRule.java     |  6 +-
 .../calcite/rel/rules/JoinToMultiJoinRule.java     |  2 +-
 .../rel/rules/MultiJoinOptimizeBushyRule.java      |  4 +-
 .../rel/rules/MultiJoinProjectTransposeRule.java   |  7 ++-
 .../rel/rules/ProjectJoinJoinRemoveRule.java       |  2 +-
 .../calcite/rel/rules/ProjectRemoveRule.java       |  2 +-
 .../apache/calcite/rel/rules/PruneEmptyRules.java  | 18 +++---
 .../apache/calcite/rel/rules/PushProjector.java    |  2 +-
 .../apache/calcite/rel/rules/SubstitutionRule.java |  2 +-
 .../calcite/rel/rules/TransformationRule.java      |  2 +-
 .../apache/calcite/rel/rules/ValuesReduceRule.java |  4 +-
 .../rules/materialize/MaterializedViewRule.java    |  1 +
 .../org/apache/calcite/rel/type/RelCrossType.java  |  2 +-
 .../org/apache/calcite/rel/type/RelDataType.java   |  4 +-
 .../calcite/rel/type/RelDataTypeFactory.java       |  2 +-
 .../calcite/rel/type/RelDataTypeFactoryImpl.java   |  2 +-
 .../apache/calcite/rel/type/RelDataTypeImpl.java   |  8 +--
 .../rel/type/RelDataTypePrecedenceList.java        |  2 +-
 .../org/apache/calcite/rel/type/RelRecordType.java |  1 +
 .../java/org/apache/calcite/rex/RexBuilder.java    | 10 ++--
 .../main/java/org/apache/calcite/rex/RexCall.java  |  2 +-
 .../org/apache/calcite/rex/RexCorrelVariable.java  |  2 +-
 .../java/org/apache/calcite/rex/RexInputRef.java   |  6 +-
 .../java/org/apache/calcite/rex/RexLiteral.java    |  9 +--
 .../main/java/org/apache/calcite/rex/RexNode.java  |  4 +-
 .../java/org/apache/calcite/rex/RexNormalize.java  |  9 ++-
 .../java/org/apache/calcite/rex/RexProgram.java    |  4 +-
 .../org/apache/calcite/rex/RexProgramBuilder.java  | 12 ++--
 .../java/org/apache/calcite/rex/RexRangeRef.java   |  6 +-
 .../java/org/apache/calcite/rex/RexShuttle.java    |  2 +-
 .../java/org/apache/calcite/rex/RexSimplify.java   |  2 +-
 .../java/org/apache/calcite/rex/RexSubQuery.java   |  2 +-
 .../org/apache/calcite/rex/RexUnaryBiVisitor.java  |  2 +-
 .../main/java/org/apache/calcite/rex/RexUtil.java  |  6 +-
 .../org/apache/calcite/rex/RexWindowBound.java     |  4 ++
 .../java/org/apache/calcite/rex/package-info.java  | 10 ++--
 .../org/apache/calcite/runtime/BinarySearch.java   |  6 ++
 .../main/java/org/apache/calcite/runtime/Hook.java |  5 +-
 .../java/org/apache/calcite/runtime/Matcher.java   |  1 +
 .../java/org/apache/calcite/runtime/Resources.java | 29 ++++-----
 .../org/apache/calcite/runtime/SqlFunctions.java   |  2 +-
 .../main/java/org/apache/calcite/runtime/Unit.java |  2 +-
 .../calcite/schema/CustomColumnResolvingTable.java |  4 +-
 .../java/org/apache/calcite/schema/Function.java   |  4 +-
 .../apache/calcite/schema/FunctionParameter.java   |  2 +-
 .../calcite/schema/ImplementableFunction.java      |  1 +
 .../java/org/apache/calcite/schema/Member.java     | 10 ++--
 .../org/apache/calcite/schema/ModifiableTable.java |  2 +-
 .../org/apache/calcite/schema/ModifiableView.java  |  2 +-
 .../calcite/schema/ProjectableFilterableTable.java |  4 +-
 .../java/org/apache/calcite/schema/Schema.java     | 12 ++--
 .../org/apache/calcite/schema/SchemaVersion.java   |  1 +
 .../java/org/apache/calcite/schema/Statistic.java  |  2 +-
 .../main/java/org/apache/calcite/schema/Table.java |  8 +--
 .../org/apache/calcite/schema/TableFactory.java    |  8 +--
 .../java/org/apache/calcite/schema/TableMacro.java |  2 +-
 .../apache/calcite/schema/impl/AbstractSchema.java | 10 ++--
 .../schema/impl/AbstractTableQueryable.java        |  2 +-
 .../calcite/schema/impl/ListTransientTable.java    |  2 +-
 .../calcite/schema/impl/MaterializedViewTable.java |  2 +-
 .../schema/impl/ReflectiveFunctionBase.java        |  1 +
 .../org/apache/calcite/schema/impl/StarTable.java  |  4 +-
 .../org/apache/calcite/schema/impl/ViewTable.java  |  2 +-
 .../org/apache/calcite/sql/SqlBasicFunction.java   |  6 +-
 .../main/java/org/apache/calcite/sql/SqlCall.java  | 13 +++--
 .../org/apache/calcite/sql/SqlDataTypeSpec.java    |  2 +-
 .../java/org/apache/calcite/sql/SqlDialect.java    | 12 ++--
 .../org/apache/calcite/sql/SqlFilterOperator.java  |  2 +-
 .../org/apache/calcite/sql/SqlIntervalLiteral.java |  4 +-
 .../apache/calcite/sql/SqlIntervalQualifier.java   |  2 +-
 .../main/java/org/apache/calcite/sql/SqlKind.java  | 48 +++++++--------
 .../java/org/apache/calcite/sql/SqlLiteral.java    |  5 +-
 .../java/org/apache/calcite/sql/SqlOperator.java   |  8 +--
 .../org/apache/calcite/sql/SqlOperatorBinding.java |  4 +-
 .../java/org/apache/calcite/sql/SqlOrderBy.java    |  2 +-
 .../org/apache/calcite/sql/SqlOverOperator.java    |  2 +-
 .../java/org/apache/calcite/sql/SqlSampleSpec.java |  4 +-
 .../org/apache/calcite/sql/SqlSelectOperator.java  |  2 +-
 .../java/org/apache/calcite/sql/SqlTableRef.java   |  6 +-
 .../calcite/sql/SqlTypeConstructorFunction.java    |  2 +-
 .../apache/calcite/sql/SqlUnresolvedFunction.java  |  2 +-
 .../main/java/org/apache/calcite/sql/SqlUtil.java  |  1 +
 .../java/org/apache/calcite/sql/SqlWindow.java     |  4 +-
 .../apache/calcite/sql/SqlWindowTableFunction.java |  4 +-
 .../apache/calcite/sql/SqlWithinGroupOperator.java |  2 +-
 .../java/org/apache/calcite/sql/SqlWriter.java     | 18 +++---
 .../org/apache/calcite/sql/SqlWriterConfig.java    |  1 +
 .../apache/calcite/sql/TableCharacteristic.java    |  2 +-
 .../org/apache/calcite/sql/advise/SqlAdvisor.java  |  1 +
 .../apache/calcite/sql/advise/package-info.java    |  2 +-
 .../calcite/sql/dialect/BigQuerySqlDialect.java    |  2 +-
 .../apache/calcite/sql/fun/SqlCaseOperator.java    | 16 ++---
 .../calcite/sql/fun/SqlJsonValueFunction.java      |  2 +-
 .../calcite/sql/fun/SqlLibraryOperators.java       |  4 +-
 .../calcite/sql/fun/SqlMapQueryConstructor.java    |  2 +-
 .../calcite/sql/fun/SqlMapValueConstructor.java    |  2 +-
 .../sql/fun/SqlMultisetValueConstructor.java       |  2 +-
 .../calcite/sql/fun/SqlStdOperatorTable.java       | 18 +++---
 .../apache/calcite/sql/fun/SqlThrowOperator.java   |  4 +-
 .../calcite/sql/fun/SqlTranslateFunction.java      |  9 ++-
 .../org/apache/calcite/sql/fun/package-info.java   |  2 +-
 .../java/org/apache/calcite/sql/package-info.java  | 14 ++---
 .../calcite/sql/parser/SqlParserImplFactory.java   |  2 +-
 .../apache/calcite/sql/parser/SqlParserPos.java    |  2 +-
 .../apache/calcite/sql/pretty/SqlPrettyWriter.java |  2 +-
 .../org/apache/calcite/sql/type/ReturnTypes.java   |  6 +-
 .../sql/type/SqlReturnTypeInferenceChain.java      |  2 +-
 .../org/apache/calcite/sql/type/SqlTypeUtil.java   |  3 +
 .../apache/calcite/sql/validate/GroupByScope.java  |  4 +-
 .../org/apache/calcite/sql/validate/JoinScope.java |  2 +-
 .../apache/calcite/sql/validate/OrderByScope.java  |  4 +-
 .../org/apache/calcite/sql/validate/OverScope.java |  4 +-
 .../apache/calcite/sql/validate/SelectScope.java   | 10 ++--
 .../calcite/sql/validate/SqlConformance.java       |  1 +
 .../sql/validate/SqlUserDefinedAggFunction.java    |  2 +-
 .../sql/validate/SqlUserDefinedFunction.java       |  3 +-
 .../sql/validate/SqlUserDefinedTableFunction.java  |  1 +
 .../apache/calcite/sql/validate/SqlValidator.java  | 14 +++--
 .../calcite/sql/validate/SqlValidatorImpl.java     | 13 +++--
 .../sql/validate/SqlValidatorNamespace.java        | 14 ++---
 .../calcite/sql/validate/SqlValidatorUtil.java     |  4 +-
 .../org/apache/calcite/sql/validate/WithScope.java |  4 +-
 .../sql/validate/implicit/TypeCoercion.java        |  2 +-
 .../sql/validate/implicit/TypeCoercionImpl.java    |  9 ++-
 .../sql/validate/implicit/package-info.java        |  2 +-
 .../calcite/sql2rel/CorrelateProjectExtractor.java | 19 +++---
 .../apache/calcite/sql2rel/RelDecorrelator.java    |  2 +-
 .../org/apache/calcite/sql2rel/SqlRexContext.java  |  6 +-
 .../org/apache/calcite/tools/FrameworkConfig.java  |  4 +-
 .../java/org/apache/calcite/tools/Program.java     |  5 +-
 .../calcite/util/BarfingInvocationHandler.java     |  2 +-
 .../main/java/org/apache/calcite/util/BitSets.java |  2 +-
 .../src/main/java/org/apache/calcite/util/Bug.java |  3 +-
 .../java/org/apache/calcite/util/ChunkList.java    |  2 +-
 .../apache/calcite/util/ControlFlowException.java  |  2 +-
 .../java/org/apache/calcite/util/Glossary.java     | 13 +++--
 .../main/java/org/apache/calcite/util/Holder.java  |  4 +-
 .../org/apache/calcite/util/ImmutableBitSet.java   |  2 +-
 .../apache/calcite/util/ImmutableNullableList.java |  6 +-
 .../apache/calcite/util/IntegerIntervalSet.java    |  2 +-
 .../java/org/apache/calcite/util/JsonBuilder.java  |  2 +-
 .../main/java/org/apache/calcite/util/Pair.java    | 10 ++--
 .../apache/calcite/util/PartiallyOrderedSet.java   | 16 ++---
 .../java/org/apache/calcite/util/Permutation.java  |  8 +--
 .../calcite/util/PrecedenceClimbingParser.java     |  1 +
 .../calcite/util/ReflectiveVisitDispatcher.java    |  2 +-
 .../main/java/org/apache/calcite/util/Static.java  |  2 +-
 .../org/apache/calcite/util/TimestampString.java   |  2 +-
 .../calcite/util/TimestampWithTimeZoneString.java  |  4 +-
 .../apache/calcite/util/UnmodifiableArrayList.java |  6 +-
 .../main/java/org/apache/calcite/util/Util.java    | 36 +++++++-----
 .../java/org/apache/calcite/util/XmlOutput.java    | 10 ++--
 .../apache/calcite/util/format/FormatElement.java  |  2 +-
 .../java/org/apache/calcite/util/graph/Graphs.java |  3 +-
 .../org/apache/calcite/util/mapping/IntPair.java   |  2 +-
 .../org/apache/calcite/util/mapping/Mappings.java  | 16 ++---
 .../examples/foodmart/java/JdbcExample.java        |  2 +-
 .../apache/calcite/rex/RexProgramBuilderBase.java  |  5 +-
 .../test/JdbcFrontJdbcBackLinqMiddleTest.java      |  2 +-
 .../apache/calcite/test/JdbcFrontJdbcBackTest.java |  2 +-
 .../apache/calcite/test/JdbcFrontLinqBackTest.java |  2 +-
 .../java/org/apache/calcite/test/JdbcTest.java     | 14 ++---
 .../java/org/apache/calcite/test/LatticeTest.java  |  2 +-
 .../org/apache/calcite/test/RelBuilderTest.java    |  2 +-
 .../org/apache/calcite/test/RelOptRulesTest.java   | 40 +++++++------
 .../apache/calcite/test/SqlHintsConverterTest.java |  2 +-
 .../apache/calcite/test/SqlToRelConverterTest.java |  3 +
 .../org/apache/calcite/test/SqlValidatorTest.java  |  7 +--
 .../concurrent/ConcurrentTestCommandGenerator.java | 10 ++--
 .../calcite/test/concurrent/package-info.java      | 22 +++----
 .../java/org/apache/calcite/tools/PlannerTest.java |  6 +-
 .../apache/calcite/adapter/druid/DruidQuery.java   |  2 +-
 .../adapter/druid/DruidSqlOperatorConverter.java   |  1 +
 .../elasticsearch/ElasticsearchConstants.java      |  1 +
 .../adapter/elasticsearch/ElasticsearchJson.java   |  3 +
 .../adapter/elasticsearch/ElasticsearchRel.java    |  5 ++
 .../adapter/elasticsearch/ElasticsearchRules.java  |  1 +
 .../elasticsearch/ElasticsearchSearchResult.java   |  1 +
 .../adapter/elasticsearch/ElasticsearchTable.java  |  1 +
 .../elasticsearch/ElasticsearchTableScan.java      |  2 +-
 .../ElasticsearchToEnumerableConverter.java        |  2 +
 .../elasticsearch/ElasticsearchTransport.java      |  1 +
 .../adapter/elasticsearch/PredicateAnalyzer.java   |  3 +
 .../elasticsearch/ElasticSearchAdapterTest.java    |  1 +
 .../elasticsearch/EmbeddedElasticsearchNode.java   | 12 ++--
 .../elasticsearch/EmbeddedElasticsearchPolicy.java | 65 +++++++++++----------
 .../calcite/adapter/elasticsearch/MatchTest.java   |  1 +
 .../adapter/elasticsearch/Projection2Test.java     |  2 +
 .../adapter/elasticsearch/QueryBuildersTest.java   |  1 +
 .../adapter/elasticsearch/ScrollingTest.java       |  1 +
 .../apache/calcite/test/ElasticsearchChecker.java  |  2 +
 .../calcite/adapter/csv/CsvStreamTableFactory.java |  2 +-
 .../apache/calcite/adapter/csv/package-info.java   |  2 +-
 .../calcite/adapter/file/CsvStreamReader.java      |  2 +-
 .../adapter/geode/util/JavaTypeFactoryExtImpl.java |  2 +-
 .../adapter/geode/rel/GeodeEmbeddedPolicy.java     |  1 +
 .../apache/calcite/adapter/kafka/package-info.java |  2 +-
 .../apache/calcite/linq4j/AbstractEnumerable.java  |  2 +-
 .../apache/calcite/linq4j/AbstractEnumerable2.java |  2 +-
 .../apache/calcite/linq4j/AbstractQueryable.java   |  2 +-
 .../apache/calcite/linq4j/DefaultEnumerable.java   |  2 +-
 .../java/org/apache/calcite/linq4j/Enumerable.java |  4 +-
 .../apache/calcite/linq4j/EnumerableDefaults.java  | 22 ++++---
 .../apache/calcite/linq4j/ExtendedEnumerable.java  | 16 ++---
 .../calcite/linq4j/ExtendedOrderedEnumerable.java  |  2 +-
 .../apache/calcite/linq4j/ExtendedQueryable.java   |  8 +--
 .../java/org/apache/calcite/linq4j/Extensions.java |  2 +-
 .../java/org/apache/calcite/linq4j/Linq4j.java     | 12 ++--
 .../org/apache/calcite/linq4j/MemoryFactory.java   |  1 +
 .../calcite/linq4j/MergeUnionEnumerator.java       |  1 +
 .../org/apache/calcite/linq4j/QueryProvider.java   |  6 +-
 .../apache/calcite/linq4j/QueryProviderImpl.java   |  2 +-
 .../java/org/apache/calcite/linq4j/Queryable.java  |  2 +-
 .../apache/calcite/linq4j/QueryableDefaults.java   | 10 ++--
 .../org/apache/calcite/linq4j/RawEnumerable.java   |  4 +-
 .../org/apache/calcite/linq4j/RawQueryable.java    |  1 +
 .../apache/calcite/linq4j/function/Functions.java  |  6 +-
 .../apache/calcite/linq4j/tree/BlockBuilder.java   |  2 +-
 .../org/apache/calcite/linq4j/tree/Blocks.java     |  2 +-
 .../calcite/linq4j/tree/ConditionalExpression.java |  1 -
 .../calcite/linq4j/tree/ConditionalStatement.java  |  1 -
 .../org/apache/calcite/linq4j/tree/Expression.java |  4 +-
 .../apache/calcite/linq4j/tree/ExpressionType.java |  4 +-
 .../apache/calcite/linq4j/tree/Expressions.java    | 12 ++--
 .../apache/calcite/linq4j/tree/NewExpression.java  |  2 +-
 .../java/org/apache/calcite/linq4j/tree/Node.java  |  4 +-
 .../org/apache/calcite/linq4j/tree/Primitive.java  |  2 +-
 .../org/apache/calcite/linq4j/tree/Statement.java  |  2 +-
 .../java/org/apache/calcite/linq4j/tree/Types.java |  2 +-
 .../apache/calcite/linq4j/tree/package-info.java   |  2 +-
 .../calcite/linq4j/test/BlockBuilderTest.java      |  1 +
 .../calcite/linq4j/test/JoinPreserveOrderTest.java |  1 +
 .../adapter/mongodb/MongoSchemaFactory.java        |  2 +-
 .../apache/calcite/adapter/mongodb/MongoTable.java |  4 +-
 .../calcite/adapter/mongodb/MongoTableScan.java    |  2 +-
 .../calcite/adapter/mongodb/MongoAdapterTest.java  |  4 +-
 .../apache/calcite/adapter/pig/PigAggregate.java   |  1 +
 .../calcite/adapter/pig/PigTableFactory.java       |  2 +-
 .../calcite/piglet/DynamicTupleRecordType.java     |  1 +
 .../calcite/adapter/tpcds/TpcdsSchemaFactory.java  |  2 +-
 .../calcite/adapter/tpch/TpchSchemaFactory.java    |  2 +-
 .../apache/calcite/adapter/tpcds/TpcdsTest.java    | 10 ++--
 .../org/apache/calcite/adapter/tpch/TpchTest.java  |  2 +-
 .../adapter/spark/EnumerableToSparkConverter.java  |  2 +-
 .../apache/calcite/adapter/spark/HttpServer.java   |  2 +-
 .../apache/calcite/adapter/spark/SparkRuntime.java |  2 +-
 .../adapter/spark/SparkToEnumerableConverter.java  |  2 +-
 .../calcite/adapter/splunk/SplunkDriver.java       |  2 +-
 .../calcite/adapter/splunk/SplunkTableScan.java    |  2 +-
 .../calcite/adapter/splunk/package-info.java       |  2 +-
 .../splunk/search/SplunkConnectionImpl.java        |  2 +-
 .../apache/calcite/sql/test/AbstractSqlTester.java |  6 +-
 .../calcite/sql/test/SqlOperatorFixture.java       |  1 +
 .../org/apache/calcite/test/CalciteAssert.java     | 20 +++----
 .../org/apache/calcite/test/DiffRepository.java    |  8 +--
 .../java/org/apache/calcite/test/DiffTestCase.java |  2 +-
 .../java/org/apache/calcite/test/Matchers.java     |  1 +
 .../apache/calcite/test/MockSqlOperatorTable.java  |  2 +-
 .../main/java/org/apache/calcite/test/Unsafe.java  |  1 +
 .../test/catalog/CompoundNameColumnResolver.java   |  2 +-
 .../main/java/org/apache/calcite/util/Smalls.java  |  2 +-
 .../java/org/apache/calcite/util/TestUtil.java     | 26 +++++----
 387 files changed, 1113 insertions(+), 907 deletions(-)

diff --git a/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlBegin.java b/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlBegin.java
index bfd275c3ef..0036920ac8 100644
--- a/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlBegin.java
+++ b/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlBegin.java
@@ -36,6 +36,7 @@ import java.util.List;
 
 /**
  * Parse tree node representing a {@code BEGIN} clause.
+ *
  * @see <a href="https://www.postgresql.org/docs/current/sql-begin.html">BEGIN specification</a>
  */
 public class SqlBegin extends SqlCall {
diff --git a/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlCommit.java b/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlCommit.java
index 8b9491803f..63d0396feb 100644
--- a/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlCommit.java
+++ b/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlCommit.java
@@ -34,6 +34,7 @@ import java.util.List;
 
 /**
  * Parse tree node representing a {@code COMMIT} clause.
+ *
  * @see <a href="https://www.postgresql.org/docs/current/sql-commit.html">COMMIT specification</a>
  */
 public class SqlCommit extends SqlCall {
diff --git a/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlDiscard.java b/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlDiscard.java
index 78adbd8574..1dac9a450d 100644
--- a/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlDiscard.java
+++ b/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlDiscard.java
@@ -35,6 +35,7 @@ import java.util.List;
 
 /**
  * Parse tree node representing a {@code DISCARD} clause.
+ *
  * @see <a href="https://www.postgresql.org/docs/current/sql-discard.html">DISCARD specification</a>
  */
 public class SqlDiscard extends SqlCall {
diff --git a/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlRollback.java b/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlRollback.java
index c400f0c843..74ec7b8258 100644
--- a/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlRollback.java
+++ b/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlRollback.java
@@ -34,6 +34,7 @@ import java.util.List;
 
 /**
  * Parse tree node representing a {@code ROLLBACK} clause.
+ *
  * @see <a href="https://www.postgresql.org/docs/current/sql-rollback.html">ROLLBACK specification</a>
  */
 public class SqlRollback extends SqlCall {
diff --git a/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlShow.java b/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlShow.java
index 6e81b01cb2..5587aa31e9 100644
--- a/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlShow.java
+++ b/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlShow.java
@@ -35,6 +35,7 @@ import java.util.List;
 
 /**
  * Parse tree node representing a {@code SHOW} clause.
+ *
  * @see <a href="https://www.postgresql.org/docs/current/sql-show.html">SHOW specification</a>
  */
 public class SqlShow extends SqlCall {
diff --git a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraRules.java b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraRules.java
index 6fc1f47432..db5d83960d 100644
--- a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraRules.java
+++ b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraRules.java
@@ -228,7 +228,7 @@ public class CassandraRules {
           scan.cassandraTable.getClusteringOrder());
     }
 
-    /** Deprecated in favor of {@link CassandraFilterRuleConfig}. **/
+    /** Deprecated in favor of {@link CassandraFilterRuleConfig}. */
     @Deprecated
     public interface Config extends CassandraFilterRuleConfig { }
 
@@ -362,7 +362,7 @@ public class CassandraRules {
       call.transformTo(convert(sort, filter));
     }
 
-    /** Deprecated in favor of CassandraSortRuleConfig. **/
+    /** Deprecated in favor of CassandraSortRuleConfig. */
     @Deprecated
     public interface Config extends CassandraSortRuleConfig { }
 
@@ -417,7 +417,7 @@ public class CassandraRules {
       call.transformTo(convert(limit));
     }
 
-    /** Deprecated in favor of CassandraLimitRuleConfig. **/
+    /** Deprecated in favor of CassandraLimitRuleConfig. */
     @Deprecated
     public interface Config extends CassandraLimitRuleConfig { }
 
diff --git a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/package-info.java b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/package-info.java
index 82ed9fde09..c9bc16403e 100644
--- a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/package-info.java
+++ b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/package-info.java
@@ -18,6 +18,6 @@
 /**
  * Cassandra query provider.
  *
- * <p>There is one table for each Cassandra column family.</p>
+ * <p>There is one table for each Cassandra column family.
  */
 package org.apache.calcite.adapter.cassandra;
diff --git a/cassandra/src/test/java/org/apache/calcite/test/CassandraExtension.java b/cassandra/src/test/java/org/apache/calcite/test/CassandraExtension.java
index e332d329d9..73f19b49cc 100644
--- a/cassandra/src/test/java/org/apache/calcite/test/CassandraExtension.java
+++ b/cassandra/src/test/java/org/apache/calcite/test/CassandraExtension.java
@@ -51,13 +51,13 @@ import java.util.Objects;
 import java.util.concurrent.ExecutionException;
 
 /**
- * JUnit5 extension to start and stop embedded cassandra server.
+ * JUnit5 extension to start and stop embedded Cassandra server.
  *
  * <p>Note that tests will be skipped if running on JDK11+ or Eclipse OpenJ9 JVM
  * (not supported by cassandra-unit and Cassandra, respectively) see
- *  <a href="https://github.com/jsevellec/cassandra-unit/issues/294">cassandra-unit issue #294</a>
- *  and <a href="https://issues.apache.org/jira/browse/CASSANDRA-14883">CASSANDRA-14883</a>,
- *  respectively.
+ * <a href="https://github.com/jsevellec/cassandra-unit/issues/294">cassandra-unit issue #294</a>
+ * and <a href="https://issues.apache.org/jira/browse/CASSANDRA-14883">CASSANDRA-14883</a>,
+ * respectively.
  */
 class CassandraExtension implements ParameterResolver, ExecutionCondition {
 
@@ -102,6 +102,7 @@ class CassandraExtension implements ParameterResolver, ExecutionCondition {
 
   /**
    * Whether to run this test.
+   *
    * <p>Enabled by default, unless explicitly disabled
    * from command line ({@code -Dcalcite.test.cassandra=false}) or running on incompatible JDK
    * version or JVM (see below).
diff --git a/core/src/main/java/org/apache/calcite/DataContext.java b/core/src/main/java/org/apache/calcite/DataContext.java
index 9632b36173..ed784094bc 100644
--- a/core/src/main/java/org/apache/calcite/DataContext.java
+++ b/core/src/main/java/org/apache/calcite/DataContext.java
@@ -63,7 +63,7 @@ public interface DataContext {
    * Returns a context variable.
    *
    * <p>Supported variables include: "sparkContext", "currentTimestamp",
-   * "localTimestamp".</p>
+   * "localTimestamp".
    *
    * @param name Name of variable
    */
diff --git a/core/src/main/java/org/apache/calcite/adapter/clone/ArrayTable.java b/core/src/main/java/org/apache/calcite/adapter/clone/ArrayTable.java
index 9c5581e636..1ac4612fa0 100644
--- a/core/src/main/java/org/apache/calcite/adapter/clone/ArrayTable.java
+++ b/core/src/main/java/org/apache/calcite/adapter/clone/ArrayTable.java
@@ -112,7 +112,7 @@ class ArrayTable extends AbstractQueryableTable implements ScannableTable {
     /** Constant. Contains only one value.
      *
      * <p>We can't store 0-bit values in
-     * an array: we'd have no way of knowing how many there were.</p>
+     * an array: we'd have no way of knowing how many there were.
      *
      * @see Constant
      */
@@ -156,7 +156,7 @@ class ArrayTable extends AbstractQueryableTable implements ScannableTable {
      * values with many duplicates is a win; a column of mostly distinct
      * {@code short} values is likely a loss. The other win is if there are
      * null values; otherwise the best option would be an
-     * {@link #OBJECT_ARRAY}.</p>
+     * {@link #OBJECT_ARRAY}.
      *
      * @see PrimitiveDictionary
      */
@@ -180,7 +180,7 @@ class ArrayTable extends AbstractQueryableTable implements ScannableTable {
      * occur very commonly are held in an 'exceptions' array and are
      * recognized by their high offsets. Other strings are created on demand
      * (this reduces the number of objects that need to be created during
-     * deserialization from cache.</p>
+     * deserialization from cache.
      *
      * @see StringDictionary
      */
diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/AggAddContext.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/AggAddContext.java
index bdb3a706fb..68d1e1be47 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/AggAddContext.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/AggAddContext.java
@@ -35,6 +35,7 @@ public interface AggAddContext extends AggResultContext {
    * Returns {@link org.apache.calcite.rex.RexNode} representation of arguments.
    * This can be useful for manual translation of required arguments with
    * different {@link NullPolicy}.
+   *
    * @return {@link org.apache.calcite.rex.RexNode} representation of arguments
    */
   List<RexNode> rexArguments();
@@ -50,6 +51,7 @@ public interface AggAddContext extends AggResultContext {
    * The resulting value is equivalent to
    * {@code rowTranslator().translateList(rexArguments())}.
    * This is handy if you need just operate on argument.
+   *
    * @return Linq4j form of arguments.
    */
   List<Expression> arguments();
diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/AggContext.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/AggContext.java
index c5f5ca1f8b..e6897094d9 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/AggContext.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/AggContext.java
@@ -31,6 +31,7 @@ import java.util.List;
 public interface AggContext {
   /**
    * Returns the aggregation being implemented.
+   *
    * @return aggregation being implemented.
    */
   SqlAggFunction aggregation();
@@ -47,6 +48,7 @@ public interface AggContext {
 
   /**
    * Returns the return type of the aggregate as {@link java.lang.reflect.Type}.
+   *
    * @return return type of the aggregate as {@link java.lang.reflect.Type}
    */
   Type returnType();
diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumUtils.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumUtils.java
index a92cc98202..70e99deeb8 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumUtils.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumUtils.java
@@ -733,7 +733,7 @@ public class EnumUtils {
     return null;
   }
 
-  /** Transforms a JoinRelType to Linq4j JoinType. **/
+  /** Transforms a JoinRelType to Linq4j JoinType. */
   static JoinType toLinq4jJoinType(JoinRelType joinRelType) {
     switch (joinRelType) {
     case INNER:
@@ -755,7 +755,7 @@ public class EnumUtils {
         "Unable to convert " + joinRelType + " to Linq4j JoinType");
   }
 
-  /** Returns a predicate expression based on a join condition. **/
+  /** Returns a predicate expression based on a join condition. */
   static Expression generatePredicate(
       EnumerableRelImplementor implementor,
       RexBuilder rexBuilder,
diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableRules.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableRules.java
index d12a31e717..a597108964 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableRules.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableRules.java
@@ -66,7 +66,7 @@ public class EnumerableRules {
       EnumerableBatchNestedLoopJoinRule.Config.DEFAULT.toRule();
 
   /** Rule that converts a
-   *  {@link org.apache.calcite.rel.logical.LogicalProject} to an
+   * {@link org.apache.calcite.rel.logical.LogicalProject} to an
    * {@link EnumerableProject}. */
   public static final EnumerableProjectRule ENUMERABLE_PROJECT_RULE =
       EnumerableProjectRule.DEFAULT_CONFIG.toRule(EnumerableProjectRule.class);
@@ -166,7 +166,7 @@ public class EnumerableRules {
       EnumerableProjectToCalcRule.Config.DEFAULT.toRule();
 
   /** Rule that converts a
-   *  {@link org.apache.calcite.rel.logical.LogicalTableScan} to
+   * {@link org.apache.calcite.rel.logical.LogicalTableScan} to
    * {@link EnumerableConvention enumerable calling convention}. */
   public static final EnumerableTableScanRule ENUMERABLE_TABLE_SCAN_RULE =
       EnumerableTableScanRule.DEFAULT_CONFIG
@@ -180,7 +180,7 @@ public class EnumerableRules {
           .toRule(EnumerableTableFunctionScanRule.class);
 
   /** Rule that converts a {@link LogicalMatch} to an
-   *  {@link EnumerableMatch}. */
+   * {@link EnumerableMatch}. */
   public static final EnumerableMatchRule ENUMERABLE_MATCH_RULE =
       EnumerableMatchRule.DEFAULT_CONFIG.toRule(EnumerableMatchRule.class);
 
diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableTableScan.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableTableScan.java
index 9df232f59d..ace76188b1 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableTableScan.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableTableScan.java
@@ -119,8 +119,9 @@ public class EnumerableTableScan
 
   /** Returns whether EnumerableTableScan can generate code to handle a
    * particular variant of the Table SPI.
+   *
    * @deprecated remove before Calcite 2.0
-   **/
+   */
   @Deprecated
   public static boolean canHandle(Table table) {
     if (table instanceof TransientTable) {
@@ -135,8 +136,7 @@ public class EnumerableTableScan
   }
 
   /** Returns whether EnumerableTableScan can generate code to handle a
-   * particular variant of the Table SPI.
-   **/
+   * particular variant of the Table SPI. */
   public static boolean canHandle(RelOptTable relOptTable) {
     Table table = relOptTable.unwrap(Table.class);
     if (table != null && !canHandle(table)) {
diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/MatchUtils.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/MatchUtils.java
index 52c917b570..254ffc289a 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/MatchUtils.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/MatchUtils.java
@@ -28,6 +28,7 @@ public class MatchUtils {
 
   /**
    * Returns the row with the highest index whose corresponding symbol matches, null otherwise.
+   *
    * @param symbol Target Symbol
    * @param rows List of passed rows
    * @param symbols Corresponding symbols to rows
diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/NestedBlockBuilder.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/NestedBlockBuilder.java
index d319251a00..8dcfec45ce 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/NestedBlockBuilder.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/NestedBlockBuilder.java
@@ -27,6 +27,7 @@ public interface NestedBlockBuilder {
   /**
    * Starts nested code block. The resulting block can optimize expressions
    * and reuse already calculated values from the parent blocks.
+   *
    * @return new code block that can optimize expressions and reuse already
    * calculated values from the parent blocks.
    */
@@ -35,6 +36,7 @@ public interface NestedBlockBuilder {
   /**
    * Uses given block as the new code context.
    * The current block will be restored after {@link #exitBlock()} call.
+   *
    * @param block new code block
    * @see #exitBlock()
    */
@@ -47,6 +49,7 @@ public interface NestedBlockBuilder {
 
   /**
    * Leaves the current code block.
+   *
    * @see #nestBlock()
    */
   void exitBlock();
diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/NestedBlockBuilderImpl.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/NestedBlockBuilderImpl.java
index 581f840496..9b6bbd4161 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/NestedBlockBuilderImpl.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/NestedBlockBuilderImpl.java
@@ -31,6 +31,7 @@ public class NestedBlockBuilderImpl implements NestedBlockBuilder {
 
   /**
    * Constructs nested block builders starting of a given code block.
+   *
    * @param block root code block
    */
   @SuppressWarnings("method.invocation.invalid")
@@ -41,6 +42,7 @@ public class NestedBlockBuilderImpl implements NestedBlockBuilder {
   /**
    * Starts nested code block. The resulting block can optimize expressions
    * and reuse already calculated values from the parent blocks.
+   *
    * @return new code block that can optimize expressions and reuse already
    * calculated values from the parent blocks.
    */
@@ -53,6 +55,7 @@ public class NestedBlockBuilderImpl implements NestedBlockBuilder {
   /**
    * Uses given block as the new code context.
    * The current block will be restored after {@link #exitBlock()} call.
+   *
    * @param block new code block
    * @see #exitBlock()
    */
@@ -69,6 +72,7 @@ public class NestedBlockBuilderImpl implements NestedBlockBuilder {
 
   /**
    * Leaves the current code block.
+   *
    * @see #nestBlock()
    */
   @Override public final void exitBlock() {
diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/NullPolicy.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/NullPolicy.java
index 8a9c78bfc3..1d426ea43b 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/NullPolicy.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/NullPolicy.java
@@ -22,7 +22,7 @@ package org.apache.calcite.adapter.enumerable;
  * <p>STRICT and ANY are similar. STRICT says f(a0, a1) will NEVER return
  * null if a0 and a1 are not null. This means that we can check whether f
  * returns null just by checking its arguments. Use STRICT in preference to
- * ANY whenever possible.</p>
+ * ANY whenever possible.
  */
 public enum NullPolicy {
   /** Returns null if and only if all of the arguments are null;
diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/PhysType.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/PhysType.java
index 4ee08361cd..4447e91dfe 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/PhysType.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/PhysType.java
@@ -36,7 +36,7 @@ import java.util.List;
  * type of the row (returned by {@link #getJavaRowType()}), and methods to
  * generate expressions to access fields, generate records, and so forth.
  * Together, the records encapsulate how the logical type maps onto the physical
- * type.</p>
+ * type.
  */
 public interface PhysType {
   /** Returns the Java type (often a Class) that represents a row. For
@@ -48,7 +48,7 @@ public interface PhysType {
    * ordinal.
    *
    * <p>For instance, when the java row type is {@code Object[]}, the java
-   * field type is {@code Object} even if the field is not nullable.</p> */
+   * field type is {@code Object} even if the field is not nullable. */
   Type getJavaFieldType(int field);
 
   /** Returns the type factory. */
diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/RexToLixTranslator.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/RexToLixTranslator.java
index 2eba9bf112..24c1d02748 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/RexToLixTranslator.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/RexToLixTranslator.java
@@ -940,6 +940,7 @@ public class RexToLixTranslator implements RexVisitor<RexToLixTranslator.Result>
   }
 
   /** Returns whether an expression is nullable.
+   *
    * @param e Expression
    * @return Whether expression is nullable
    */
diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/StrictAggImplementor.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/StrictAggImplementor.java
index 105c8ac9c6..54569acc57 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/StrictAggImplementor.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/StrictAggImplementor.java
@@ -32,6 +32,7 @@ import java.util.List;
 
 /**
  * The base implementation of strict aggregate function.
+ *
  * @see org.apache.calcite.adapter.enumerable.RexImpTable.CountImplementor
  * @see org.apache.calcite.adapter.enumerable.RexImpTable.SumImplementor
  */
diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/StrictWinAggImplementor.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/StrictWinAggImplementor.java
index cd27b9da2d..2c7ba0a7d8 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/StrictWinAggImplementor.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/StrictWinAggImplementor.java
@@ -23,6 +23,7 @@ import java.util.List;
 
 /**
  * The base implementation of strict window aggregate function.
+ *
  * @see org.apache.calcite.adapter.enumerable.RexImpTable.FirstLastValueImplementor
  * @see org.apache.calcite.adapter.enumerable.RexImpTable.RankImplementor
  * @see org.apache.calcite.adapter.enumerable.RexImpTable.RowNumberImplementor
diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggAddContext.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggAddContext.java
index dd1e92f7ad..d62b2efba6 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggAddContext.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggAddContext.java
@@ -25,6 +25,7 @@ import org.apache.calcite.linq4j.tree.Expression;
  * <p>{@link WinAggAddContext} is used when implementing windowed aggregate.
  * Typically, the aggregation implementation will use {@link #arguments()}
  * or {@link #rexArguments()} to update aggregate value.
+ *
  * @see AggAddContext
  */
 public interface WinAggAddContext extends AggAddContext, WinAggResultContext {
@@ -34,6 +35,7 @@ public interface WinAggAddContext extends AggAddContext, WinAggResultContext {
    * This is NOT current row as in "rows between current row".
    * If you need to know the relative index of the current row in the partition,
    * use {@link WinAggFrameContext#index()}.
+   *
    * @return current position inside for-loop of window aggregate.
    * @see WinAggFrameContext#index()
    * @see WinAggFrameContext#startIndex()
diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggFrameContext.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggFrameContext.java
index 397ff2c4e0..1b3e9c6dfc 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggFrameContext.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggFrameContext.java
@@ -31,18 +31,21 @@ public interface WinAggFrameContext {
    * Returns the index of the current row in the partition.
    * In other words, it is close to ~ROWS BETWEEN CURRENT ROW.
    * Note to use {@link #startIndex()} when you need zero-based row position.
+   *
    * @return the index of the very first row in partition
    */
   Expression index();
 
   /**
    * Returns the index of the very first row in partition.
+   *
    * @return index of the very first row in partition
    */
   Expression startIndex();
 
   /**
    * Returns the index of the very last row in partition.
+   *
    * @return index of the very last row in partition
    */
   Expression endIndex();
@@ -51,6 +54,7 @@ public interface WinAggFrameContext {
    * Returns the boolean expression that tells if the partition has rows.
    * The partition might lack rows in cases like ROWS BETWEEN 1000 PRECEDING
    * AND 900 PRECEDING.
+   *
    * @return boolean expression that tells if the partition has rows
    */
   Expression hasRows();
@@ -58,6 +62,7 @@ public interface WinAggFrameContext {
   /**
    * Returns the number of rows in the current frame (subject to framing
    * clause).
+   *
    * @return number of rows in the current partition or 0 if the partition
    *   is empty
    */
@@ -66,6 +71,7 @@ public interface WinAggFrameContext {
   /**
    * Returns the number of rows in the current partition (as determined by
    * PARTITION BY clause).
+   *
    * @return number of rows in the current partition or 0 if the partition
    *   is empty
    */
diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggFrameResultContext.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggFrameResultContext.java
index ef4423d2e3..900c346bbd 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggFrameResultContext.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggFrameResultContext.java
@@ -25,6 +25,7 @@ import org.apache.calcite.linq4j.tree.Expression;
 public interface WinAggFrameResultContext extends WinAggFrameContext {
   /**
    * Converts absolute index position of the given relative position.
+   *
    * @param offset offset of the requested row
    * @param seekType the type of offset (start of window, end of window, etc)
    * @return absolute position of the requested row
@@ -35,6 +36,7 @@ public interface WinAggFrameResultContext extends WinAggFrameContext {
   /**
    * Returns boolean the expression that checks if the given index is in
    * the frame bounds.
+   *
    * @param rowIndex index if the row to check
    * @return expression that validates frame bounds for the given index
    */
@@ -43,6 +45,7 @@ public interface WinAggFrameResultContext extends WinAggFrameContext {
   /**
    * Returns boolean the expression that checks if the given index is in
    * the partition bounds.
+   *
    * @param rowIndex index if the row to check
    * @return expression that validates partition bounds for the given index
    */
@@ -50,6 +53,7 @@ public interface WinAggFrameResultContext extends WinAggFrameContext {
 
   /**
    * Returns row translator for given absolute row position.
+   *
    * @param rowIndex absolute index of the row.
    * @return translator for the requested row
    */
@@ -58,6 +62,7 @@ public interface WinAggFrameResultContext extends WinAggFrameContext {
   /**
    * Compares two rows given by absolute positions according to the order
    * collation of the current window.
+   *
    * @param a absolute index of the first row
    * @param b absolute index of the second row
    * @return result of comparison as as in {@link Comparable#compareTo}
diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggImplementor.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggImplementor.java
index 8a09a7e570..ced082733b 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggImplementor.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggImplementor.java
@@ -22,6 +22,7 @@ package org.apache.calcite.adapter.enumerable;
  * Windowed aggregate is more powerful than regular aggregate since it can
  * access rows in the current partition by row indices.
  * Regular aggregate can be used to implement windowed aggregate.
+ *
  * <p>This interface does not define new methods: window-specific
  * sub-interfaces are passed when implementing window aggregate.
  *
@@ -38,22 +39,26 @@ public interface WinAggImplementor extends AggImplementor {
   enum SeekType {
     /**
      * Start of window.
+     *
      * @see WinAggFrameContext#startIndex()
      */
     START,
     /**
      * Row position in the frame.
+     *
      * @see WinAggFrameContext#index()
      */
     SET,
     /**
      * The index of row that is aggregated.
      * Valid only in {@link WinAggAddContext}.
+     *
      * @see WinAggAddContext#currentPosition()
      */
     AGG_INDEX,
     /**
      * End of window.
+     *
      * @see WinAggFrameContext#endIndex()
      */
     END
diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggResultContext.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggResultContext.java
index 26818f0490..4357c0fd6e 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggResultContext.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggResultContext.java
@@ -35,6 +35,7 @@ public interface WinAggResultContext extends AggResultContext,
    * Returns {@link org.apache.calcite.rex.RexNode} representation of arguments.
    * This can be useful for manual translation of required arguments with
    * different {@link NullPolicy}.
+   *
    * @return {@link org.apache.calcite.rex.RexNode} representation of arguments
    */
   List<RexNode> rexArguments();
@@ -44,6 +45,7 @@ public interface WinAggResultContext extends AggResultContext,
    * The resulting value is equivalent to
    * {@code rowTranslator().translateList(rexArguments())}.
    * This is handy if you need just operate on argument.
+   *
    * @param rowIndex index of the requested row. The index must be in range
    *                 of partition's startIndex and endIndex.
    * @return Linq4j form of arguments of the particular row
diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/WinAggResetContextImpl.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/WinAggResetContextImpl.java
index f1e83cda16..793b6a7fd6 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/WinAggResetContextImpl.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/WinAggResetContextImpl.java
@@ -37,6 +37,7 @@ public class WinAggResetContextImpl extends AggResetContextImpl
 
   /**
    * Creates window aggregate reset context.
+   *
    * @param block code block that will contain the added initialization
    * @param accumulator accumulator variables that store the intermediate
    *                    aggregate state
diff --git a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcConvention.java b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcConvention.java
index aba34409ff..2e1f7449e8 100644
--- a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcConvention.java
+++ b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcConvention.java
@@ -29,17 +29,17 @@ import org.apache.calcite.sql.SqlDialect;
  *
  * <p>The convention is a slight misnomer. The operations occur in whatever
  * data-flow architecture the database uses internally. Nevertheless, the result
- * pops out in JDBC.</p>
+ * pops out in JDBC.
  *
  * <p>This is the only convention, thus far, that is not a singleton. Each
  * instance contains a JDBC schema (and therefore a data source). If Calcite is
  * working with two different databases, it would even make sense to convert
  * from "JDBC#A" convention to "JDBC#B", even though we don't do it currently.
  * (That would involve asking database B to open a database link to database
- * A.)</p>
+ * A.)
  *
  * <p>As a result, converter rules from and to this convention need to be
- * instantiated, at the start of planning, for each JDBC database in play.</p>
+ * instantiated, at the start of planning, for each JDBC database in play.
  */
 public class JdbcConvention extends Convention.Impl {
   /** Cost of a JDBC node versus implementing an equivalent node in a "typical"
diff --git a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcSchema.java b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcSchema.java
index 2f3e4e302a..006390e387 100644
--- a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcSchema.java
+++ b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcSchema.java
@@ -73,7 +73,7 @@ import static java.util.Objects.requireNonNull;
  *
  * <p>The tables in the JDBC data source appear to be tables in this schema;
  * queries against this schema are executed against those tables, pushing down
- * as much as possible of the query logic to SQL.</p>
+ * as much as possible of the query logic to SQL.
  */
 public class JdbcSchema implements Schema {
   private static final Logger LOGGER = LoggerFactory.getLogger(JdbcSchema.class);
diff --git a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcTable.java b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcTable.java
index f021df5bad..8e9593b632 100644
--- a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcTable.java
+++ b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcTable.java
@@ -74,7 +74,7 @@ import static java.util.Objects.requireNonNull;
  * such as
  * {@link org.apache.calcite.linq4j.Queryable#where(org.apache.calcite.linq4j.function.Predicate2)}.
  * The resulting queryable can then be converted to a SQL query, which can be
- * executed efficiently on the JDBC server.</p>
+ * executed efficiently on the JDBC server.
  */
 public class JdbcTable extends AbstractQueryableTable
     implements TranslatableTable, ScannableTable, ModifiableTable {
diff --git a/core/src/main/java/org/apache/calcite/config/CalciteConnectionProperty.java b/core/src/main/java/org/apache/calcite/config/CalciteConnectionProperty.java
index d195c15f8d..7117787c4a 100644
--- a/core/src/main/java/org/apache/calcite/config/CalciteConnectionProperty.java
+++ b/core/src/main/java/org/apache/calcite/config/CalciteConnectionProperty.java
@@ -85,19 +85,19 @@ public enum CalciteConnectionProperty implements ConnectionProperty {
   FUN("fun", Type.STRING, "standard", true),
 
   /** How identifiers are quoted.
-   *  If not specified, value from {@link #LEX} is used. */
+   * If not specified, value from {@link #LEX} is used. */
   QUOTING("quoting", Type.ENUM, null, false, Quoting.class),
 
   /** How identifiers are stored if they are quoted.
-   *  If not specified, value from {@link #LEX} is used. */
+   * If not specified, value from {@link #LEX} is used. */
   QUOTED_CASING("quotedCasing", Type.ENUM, null, false, Casing.class),
 
   /** How identifiers are stored if they are not quoted.
-   *  If not specified, value from {@link #LEX} is used. */
+   * If not specified, value from {@link #LEX} is used. */
   UNQUOTED_CASING("unquotedCasing", Type.ENUM, null, false, Casing.class),
 
   /** Whether identifiers are matched case-sensitively.
-   *  If not specified, value from {@link #LEX} is used. */
+   * If not specified, value from {@link #LEX} is used. */
   CASE_SENSITIVE("caseSensitive", Type.BOOLEAN, null, false),
 
   /** Parser factory.
diff --git a/core/src/main/java/org/apache/calcite/config/CalciteSystemProperty.java b/core/src/main/java/org/apache/calcite/config/CalciteSystemProperty.java
index 29140dab4b..964d0cc081 100644
--- a/core/src/main/java/org/apache/calcite/config/CalciteSystemProperty.java
+++ b/core/src/main/java/org/apache/calcite/config/CalciteSystemProperty.java
@@ -36,7 +36,7 @@ import static java.util.Objects.requireNonNull;
 /**
  * A Calcite specific system property that is used to configure various aspects of the framework.
  *
- * <p>Calcite system properties must always be in the "calcite" root namespace.</p>
+ * <p>Calcite system properties must always be in the "calcite" root namespace.
  *
  * @param <T> the type of the property value
  */
@@ -45,7 +45,7 @@ public final class CalciteSystemProperty<T> {
    * Holds all system properties related with the Calcite.
    *
    * <p>Deprecated <code>"saffron.properties"</code> (in namespaces"saffron" and "net.sf.saffron")
-   * are also kept here but under "calcite" namespace.</p>
+   * are also kept here but under "calcite" namespace.
    */
   private static final Properties PROPERTIES = loadProperties();
 
@@ -55,7 +55,7 @@ public final class CalciteSystemProperty<T> {
    * <p>When debug mode is activated significantly more information is gathered and printed to
    * STDOUT. It is most commonly used to print and identify problems in generated java code. Debug
    * mode is also used to perform more verifications at runtime, which are not performed during
-   * normal execution.</p>
+   * normal execution.
    */
   public static final CalciteSystemProperty<Boolean> DEBUG =
       booleanProperty("calcite.debug", false);
@@ -98,28 +98,29 @@ public final class CalciteSystemProperty<T> {
   public static final CalciteSystemProperty<Boolean> ENABLE_STREAM =
       booleanProperty("calcite.enable.stream", true);
 
-  /**
-   * Whether RexNode digest should be normalized (e.g. call operands ordered).
-   * <p>Normalization helps to treat $0=$1 and $1=$0 expressions equal, thus it saves efforts
-   * on planning.</p> */
+  /** Whether RexNode digest should be normalized (e.g. call operands ordered).
+   *
+   * <p>Normalization helps to treat $0=$1 and $1=$0 expressions equal, thus it
+   * saves efforts on planning. */
   public static final CalciteSystemProperty<Boolean> ENABLE_REX_DIGEST_NORMALIZE =
       booleanProperty("calcite.enable.rexnode.digest.normalize", true);
 
   /**
-   *  Whether to follow the SQL standard strictly.
+   * Whether to follow the SQL standard strictly.
    */
   public static final CalciteSystemProperty<Boolean> STRICT =
       booleanProperty("calcite.strict.sql", false);
 
   /**
-   * Whether to include a GraphViz representation when dumping the state of the Volcano planner.
+   * Whether to include a GraphViz representation when dumping the state of the
+   * Volcano planner.
    */
   public static final CalciteSystemProperty<Boolean> DUMP_GRAPHVIZ =
       booleanProperty("calcite.volcano.dump.graphviz", true);
 
   /**
-   * Whether to include <code>RelSet</code> information when dumping the state of the Volcano
-   * planner.
+   * Whether to include <code>RelSet</code> information when dumping the state
+   * of the Volcano planner.
    */
   public static final CalciteSystemProperty<Boolean> DUMP_SETS =
       booleanProperty("calcite.volcano.dump.sets", true);
@@ -129,7 +130,7 @@ public final class CalciteSystemProperty<T> {
    * by {@link CalciteConnectionProperty#TOPDOWN_OPT}.
    *
    * <p>Note: Enabling top-down optimization will automatically disable
-   * the use of AbstractConverter and related rules.</p>
+   * the use of AbstractConverter and related rules.
    */
   public static final CalciteSystemProperty<Boolean> TOPDOWN_OPT =
       booleanProperty("calcite.planner.topdown.opt", false);
@@ -323,7 +324,7 @@ public final class CalciteSystemProperty<T> {
    * tertiary, identical.
    *
    * <p>It is used in {@link org.apache.calcite.sql.SqlCollation} and
-   * {@link org.apache.calcite.sql.SqlLiteral#SqlLiteral}.</p>
+   * {@link org.apache.calcite.sql.SqlLiteral#SqlLiteral}.
    */
   // TODO review zabetak:
   // What happens if a wrong value is specified?
@@ -333,43 +334,46 @@ public final class CalciteSystemProperty<T> {
   /**
    * The maximum size of the cache of metadata handlers.
    *
-   * <p>A typical value is the number of queries being concurrently prepared multiplied by the
-   * number of types of metadata.</p>
+   * <p>A typical value is the number of queries being concurrently prepared
+   * multiplied by the number of types of metadata.
    *
-   * <p>If the value is less than 0, there is no limit.</p>
+   * <p>If the value is less than 0, there is no limit.
    */
   public static final CalciteSystemProperty<Integer> METADATA_HANDLER_CACHE_MAXIMUM_SIZE =
       intProperty("calcite.metadata.handler.cache.maximum.size", 1000);
 
   /**
-   * The maximum size of the cache used for storing Bindable objects, instantiated via
-   * dynamically generated Java classes.
+   * The maximum size of the cache used for storing Bindable objects,
+   * instantiated via dynamically generated Java classes.
    *
-   * <p>The default value is 0.</p>
+   * <p>The default value is 0.
    *
-   * <p>The property can take any value between [0, {@link Integer#MAX_VALUE}] inclusive. If the
-   * value is not valid (or not specified) then the default value is used.</p>
+   * <p>The property can take any value between [0, {@link Integer#MAX_VALUE}]
+   * inclusive. If the value is not valid (or not specified) then the default
+   * value is used.
    *
-   * <p>The cached objects may be quite big so it is suggested to use a rather small cache size
-   * (e.g., 1000). For the most common use cases a number close to 1000 should be enough to
-   * alleviate the performance penalty of compiling and loading classes.</p>
+   * <p>The cached objects may be quite big so it is suggested to use a rather
+   * small cache size (e.g., 1000). For the most common use cases a number close
+   * to 1000 should be enough to alleviate the performance penalty of compiling
+   * and loading classes.
    *
-   * <p>Setting this property to 0 disables the cache.</p>
+   * <p>Setting this property to 0 disables the cache.
    */
   public static final CalciteSystemProperty<Integer> BINDABLE_CACHE_MAX_SIZE =
       intProperty("calcite.bindable.cache.maxSize", 0, v -> v >= 0 && v <= Integer.MAX_VALUE);
 
   /**
-   * The concurrency level of the cache used for storing Bindable objects, instantiated via
-   * dynamically generated Java classes.
+   * The concurrency level of the cache used for storing Bindable objects,
+   * instantiated via dynamically generated Java classes.
    *
-   * <p>The default value is 1.</p>
+   * <p>The default value is 1.
    *
-   * <p>The property can take any value between [1, {@link Integer#MAX_VALUE}] inclusive. If the
-   * value is not valid (or not specified) then the default value is used.</p>
+   * <p>The property can take any value between [1, {@link Integer#MAX_VALUE}]
+   * inclusive. If the value is not valid (or not specified) then the default
+   * value is used.
    *
-   * <p>This property has no effect if the cache is disabled (i.e., {@link #BINDABLE_CACHE_MAX_SIZE}
-   * set to 0.</p>
+   * <p>This property has no effect if the cache is disabled (i.e.,
+   * {@link #BINDABLE_CACHE_MAX_SIZE} set to 0.
    */
   public static final CalciteSystemProperty<Integer> BINDABLE_CACHE_CONCURRENCY_LEVEL =
       intProperty("calcite.bindable.cache.concurrencyLevel", 1,
diff --git a/core/src/main/java/org/apache/calcite/interpreter/AggregateNode.java b/core/src/main/java/org/apache/calcite/interpreter/AggregateNode.java
index f1aea70823..9f9db72dcc 100644
--- a/core/src/main/java/org/apache/calcite/interpreter/AggregateNode.java
+++ b/core/src/main/java/org/apache/calcite/interpreter/AggregateNode.java
@@ -527,6 +527,7 @@ public class AggregateNode extends AbstractSingleNode<Aggregate> {
 
   /** Common implementation of comparison aggregate methods over numeric
    * values as a user-defined aggregate.
+   *
    * @param <T> The numeric type
    */
   public static class NumericComparison<T> {
diff --git a/core/src/main/java/org/apache/calcite/jdbc/CalciteConnection.java b/core/src/main/java/org/apache/calcite/jdbc/CalciteConnection.java
index 7706cae4b9..d350d46aa2 100644
--- a/core/src/main/java/org/apache/calcite/jdbc/CalciteConnection.java
+++ b/core/src/main/java/org/apache/calcite/jdbc/CalciteConnection.java
@@ -32,18 +32,18 @@ import java.util.Properties;
  * dynamically.
  *
  * <p>You can start off with an empty connection (no schemas), define one
- * or two schemas, and start querying them.</p>
+ * or two schemas, and start querying them.
  *
  * <p>Since a {@code CalciteConnection} implements the linq4j
  * {@link QueryProvider} interface, you can use a connection to execute
- * expression trees as queries.</p>
+ * expression trees as queries.
  */
 public interface CalciteConnection extends Connection, QueryProvider {
   /**
    * Returns the root schema.
    *
    * <p>You can define objects (such as relations) in this schema, and
-   * also nested schemas.</p>
+   * also nested schemas.
    *
    * @return Root schema
    */
@@ -64,7 +64,7 @@ public interface CalciteConnection extends Connection, QueryProvider {
    * collection is undefined. Some implementations might, for example, see
    * a modified property, but only if you set it before you create a
    * statement. We will remove this method when there are better
-   * implementations of stateful connections and configuration.</p>
+   * implementations of stateful connections and configuration.
    *
    * @return properties
    */
diff --git a/core/src/main/java/org/apache/calcite/jdbc/CalciteSchema.java b/core/src/main/java/org/apache/calcite/jdbc/CalciteSchema.java
index 05eee7f333..b1218c1e4f 100644
--- a/core/src/main/java/org/apache/calcite/jdbc/CalciteSchema.java
+++ b/core/src/main/java/org/apache/calcite/jdbc/CalciteSchema.java
@@ -56,7 +56,7 @@ import javax.sql.DataSource;
 /**
  * Schema.
  *
- * <p>Wrapper around user-defined schema used internally.</p>
+ * <p>Wrapper around user-defined schema used internally.
  */
 public abstract class CalciteSchema {
 
@@ -64,7 +64,7 @@ public abstract class CalciteSchema {
   public final Schema schema;
   public final String name;
   /** Tables explicitly defined in this schema. Does not include tables in
-   *  {@link #schema}. */
+   * {@link #schema}. */
   protected final NameMap<TableEntry> tableMap;
   protected final NameMultimap<FunctionEntry> functionMap;
   protected final NameMap<TypeEntry> typeMap;
@@ -447,7 +447,7 @@ public abstract class CalciteSchema {
    *
    * <p>Currently, to accommodate the requirement of creating tables on the fly
    * for materializations, the snapshot will still use the same table map and
-   * lattice map as in the original CalciteSchema instead of making copies.</p>
+   * lattice map as in the original CalciteSchema instead of making copies.
    *
    * @param version The current schema version
    *
@@ -460,6 +460,7 @@ public abstract class CalciteSchema {
 
   /** Returns a subset of a map whose keys match the given string
    * case-insensitively.
+   *
    * @deprecated use NameMap
    */
   @Deprecated // to be removed before 2.0
@@ -470,6 +471,7 @@ public abstract class CalciteSchema {
 
   /** Returns a subset of a set whose values match the given string
    * case-insensitively.
+   *
    * @deprecated use NameSet
    */
   @Deprecated // to be removed before 2.0
@@ -559,7 +561,7 @@ public abstract class CalciteSchema {
    * <p>Each object's name is a property of its membership in a schema;
    * therefore in principle it could belong to several schemas, or
    * even the same schema several times, with different names. In this
-   * respect, it is like an inode in a Unix file system.</p>
+   * respect, it is like an inode in a Unix file system.
    *
    * <p>The members of a schema must have unique names.
    */
diff --git a/core/src/main/java/org/apache/calcite/jdbc/ContextSqlValidator.java b/core/src/main/java/org/apache/calcite/jdbc/ContextSqlValidator.java
index 352ce012f4..df5ebc4475 100644
--- a/core/src/main/java/org/apache/calcite/jdbc/ContextSqlValidator.java
+++ b/core/src/main/java/org/apache/calcite/jdbc/ContextSqlValidator.java
@@ -40,6 +40,7 @@ public class ContextSqlValidator extends SqlValidatorImpl {
 
   /**
    * Create a {@code ContextSqlValidator}.
+   *
    * @param context Prepare context.
    * @param mutable Whether to get the mutable schema.
    */
diff --git a/core/src/main/java/org/apache/calcite/jdbc/JavaRecordType.java b/core/src/main/java/org/apache/calcite/jdbc/JavaRecordType.java
index 7fbce8696b..da86efa819 100644
--- a/core/src/main/java/org/apache/calcite/jdbc/JavaRecordType.java
+++ b/core/src/main/java/org/apache/calcite/jdbc/JavaRecordType.java
@@ -29,7 +29,7 @@ import java.util.Objects;
  * of the class.
  *
  * <p><strong>NOTE: This class is experimental and subject to
- * change/removal without notice</strong>.</p>
+ * change/removal without notice</strong>.
  */
 public class JavaRecordType extends RelRecordType {
   final Class clazz;
diff --git a/core/src/main/java/org/apache/calcite/jdbc/JavaTypeFactoryImpl.java b/core/src/main/java/org/apache/calcite/jdbc/JavaTypeFactoryImpl.java
index d689759c75..00d256dbf1 100644
--- a/core/src/main/java/org/apache/calcite/jdbc/JavaTypeFactoryImpl.java
+++ b/core/src/main/java/org/apache/calcite/jdbc/JavaTypeFactoryImpl.java
@@ -57,7 +57,7 @@ import static java.util.Objects.requireNonNull;
  * Implementation of {@link JavaTypeFactory}.
  *
  * <p><strong>NOTE: This class is experimental and subject to
- * change/removal without notice</strong>.</p>
+ * change/removal without notice</strong>.
  */
 public class JavaTypeFactoryImpl
     extends SqlTypeFactoryImpl
diff --git a/core/src/main/java/org/apache/calcite/materialize/MaterializationActor.java b/core/src/main/java/org/apache/calcite/materialize/MaterializationActor.java
index b01cd7b6cd..e61bee8597 100644
--- a/core/src/main/java/org/apache/calcite/materialize/MaterializationActor.java
+++ b/core/src/main/java/org/apache/calcite/materialize/MaterializationActor.java
@@ -44,8 +44,8 @@ class MaterializationActor {
   final Map<TileKey, MaterializationKey> keyByTile = new HashMap<>();
 
   /** Tiles grouped by dimensionality. We use a
-   *  {@link TileKey} with no measures to represent a
-   *  dimensionality. */
+   * {@link TileKey} with no measures to represent a
+   * dimensionality. */
   final Multimap<TileKey, TileKey> tilesByDimensionality =
       HashMultimap.create();
 
diff --git a/core/src/main/java/org/apache/calcite/materialize/MaterializationKey.java b/core/src/main/java/org/apache/calcite/materialize/MaterializationKey.java
index 3aa39d0007..3661a7f45f 100644
--- a/core/src/main/java/org/apache/calcite/materialize/MaterializationKey.java
+++ b/core/src/main/java/org/apache/calcite/materialize/MaterializationKey.java
@@ -25,7 +25,7 @@ import java.util.UUID;
  * Unique identifier for a materialization.
  *
  * <p>It is immutable and can only be created by the
- * {@link MaterializationService}. For communicating with the service.</p>
+ * {@link MaterializationService}. For communicating with the service.
  */
 public class MaterializationKey implements Serializable {
   private final UUID uuid = UUID.randomUUID();
diff --git a/core/src/main/java/org/apache/calcite/materialize/SqlStatisticProvider.java b/core/src/main/java/org/apache/calcite/materialize/SqlStatisticProvider.java
index a9baeff7d9..f1fc33e5fb 100644
--- a/core/src/main/java/org/apache/calcite/materialize/SqlStatisticProvider.java
+++ b/core/src/main/java/org/apache/calcite/materialize/SqlStatisticProvider.java
@@ -56,6 +56,6 @@ public interface SqlStatisticProvider {
   /** Returns whether a collection of columns is a unique (or primary) key.
    *
    * <p>For example, {@code isKey(EMP, [DEPTNO]} returns true;
-   * <p>For example, {@code isKey(DEPT, [DEPTNO]} returns false. */
+   * {@code isKey(DEPT, [DEPTNO]} returns false. */
   boolean isKey(RelOptTable table, List<Integer> columns);
 }
diff --git a/core/src/main/java/org/apache/calcite/materialize/package-info.java b/core/src/main/java/org/apache/calcite/materialize/package-info.java
index 3a91d9618b..4939c315ce 100644
--- a/core/src/main/java/org/apache/calcite/materialize/package-info.java
+++ b/core/src/main/java/org/apache/calcite/materialize/package-info.java
@@ -22,7 +22,7 @@
  * maintains the state of all
  * materializations in the system and is wrapped in a service
  * ({@link org.apache.calcite.materialize.MaterializationService})
- * for access from other parts of the system.</p>
+ * for access from other parts of the system.
  *
  * <p>Optimizer rules allow Calcite to rewrite queries using materializations,
  * if they are valid (that is, contain the same result as executing their
diff --git a/core/src/main/java/org/apache/calcite/model/JsonRoot.java b/core/src/main/java/org/apache/calcite/model/JsonRoot.java
index 5d6115cebe..0ca140e9cc 100644
--- a/core/src/main/java/org/apache/calcite/model/JsonRoot.java
+++ b/core/src/main/java/org/apache/calcite/model/JsonRoot.java
@@ -31,9 +31,9 @@ import static java.util.Objects.requireNonNull;
  *
  * <p>A POJO with fields of {@link Boolean}, {@link String}, {@link ArrayList},
  * {@link java.util.LinkedHashMap LinkedHashMap}, per Jackson simple data
- * binding.</p>
+ * binding.
  *
- * <p>Schema structure is as follows:</p>
+ * <p>Schema structure is as follows:
  *
  * <!-- CHECKSTYLE: OFF -->
  * <pre>{@code Root}
diff --git a/core/src/main/java/org/apache/calcite/model/JsonSchema.java b/core/src/main/java/org/apache/calcite/model/JsonSchema.java
index 9b1a7c0396..bb820ebf43 100644
--- a/core/src/main/java/org/apache/calcite/model/JsonSchema.java
+++ b/core/src/main/java/org/apache/calcite/model/JsonSchema.java
@@ -77,16 +77,16 @@ public abstract class JsonSchema {
    *
    * <p>If {@code false}, Calcite will go back to the schema each time it needs
    * metadata, for example, each time it needs a list of tables in order to
-   * validate a query against the schema.</p>
+   * validate a query against the schema.
    *
    * <p>If {@code true}, Calcite will cache the metadata the first time it reads
    * it. This can lead to better performance, especially if name-matching is
    * case-insensitive
-   * (see {@link org.apache.calcite.config.Lex#caseSensitive}).</p>
+   * (see {@link org.apache.calcite.config.Lex#caseSensitive}).
    *
    * <p>Tables, functions and sub-schemas explicitly created in a schema are
    * not affected by this caching mechanism. They always appear in the schema
-   * immediately, and are never flushed.</p>
+   * immediately, and are never flushed.
    */
   public final @Nullable Boolean cache;
 
diff --git a/core/src/main/java/org/apache/calcite/model/package-info.java b/core/src/main/java/org/apache/calcite/model/package-info.java
index 02081d2d31..fdedb4c3ab 100644
--- a/core/src/main/java/org/apache/calcite/model/package-info.java
+++ b/core/src/main/java/org/apache/calcite/model/package-info.java
@@ -22,13 +22,13 @@
  * the JDBC connect string. Calcite loads the model while initializing the
  * connection. It first parses the JSON, then uses a
  * {@link org.apache.calcite.model.ModelHandler} as visitor over the parse
- * tree.</p>
+ * tree.
  *
  * <p>There are standard implementations of schema and table, but the user can
  * provide their own by implementing the
  * {@link org.apache.calcite.schema.SchemaFactory}
  * or {@link org.apache.calcite.schema.TableFactory}
- * interfaces and including a custom schema in the model.</p>
+ * interfaces and including a custom schema in the model.
  *
  * <p>There are several examples of schemas in the
  * <a href="https://calcite.apache.org/docs/tutorial.html">tutorial</a>.
diff --git a/core/src/main/java/org/apache/calcite/plan/Convention.java b/core/src/main/java/org/apache/calcite/plan/Convention.java
index 797ef06375..059726b4ed 100644
--- a/core/src/main/java/org/apache/calcite/plan/Convention.java
+++ b/core/src/main/java/org/apache/calcite/plan/Convention.java
@@ -30,9 +30,9 @@ public interface Convention extends RelTrait {
    * convention. It is not implementable, and has to be transformed to
    * something else in order to be implemented.
    *
-   * <p>Relational expressions generally start off in this form.</p>
+   * <p>Relational expressions generally start off in this form.
    *
-   * <p>Such expressions always have infinite cost.</p>
+   * <p>Such expressions always have infinite cost.
    */
   Convention NONE = new Impl("NONE", RelNode.class);
 
diff --git a/core/src/main/java/org/apache/calcite/plan/RelDigest.java b/core/src/main/java/org/apache/calcite/plan/RelDigest.java
index 510a91e881..20dcaddd6b 100644
--- a/core/src/main/java/org/apache/calcite/plan/RelDigest.java
+++ b/core/src/main/java/org/apache/calcite/plan/RelDigest.java
@@ -26,7 +26,7 @@ import org.apiguardian.api.API;
  * {@code #equals} and {@code #hashCode}, which are prohibited to override
  * for RelNode, for legacy reasons.
  *
- * <p>INTERNAL USE ONLY.</p>
+ * <p>INTERNAL USE ONLY.
  */
 @API(since = "1.24", status = API.Status.INTERNAL)
 public interface RelDigest {
diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptConnection.java b/core/src/main/java/org/apache/calcite/plan/RelOptConnection.java
index 0f64f50797..4149a8f67e 100644
--- a/core/src/main/java/org/apache/calcite/plan/RelOptConnection.java
+++ b/core/src/main/java/org/apache/calcite/plan/RelOptConnection.java
@@ -20,7 +20,7 @@ package org.apache.calcite.plan;
  * The planner's view of a connection to a database.
  *
  * <p>A connection contains a {@link RelOptSchema}, via which the query planner
- * can access {@link RelOptTable} objects.</p>
+ * can access {@link RelOptTable} objects.
  */
 public interface RelOptConnection {
   /**
diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptMaterializations.java b/core/src/main/java/org/apache/calcite/plan/RelOptMaterializations.java
index 71246f860d..9feb6507d0 100644
--- a/core/src/main/java/org/apache/calcite/plan/RelOptMaterializations.java
+++ b/core/src/main/java/org/apache/calcite/plan/RelOptMaterializations.java
@@ -54,6 +54,7 @@ public abstract class RelOptMaterializations {
    * Returns a list of RelNode transformed from all possible combination of
    * materialized view uses. Big queries will likely have more than one
    * transformed RelNode, e.g., (t1 group by c1) join (t2 group by c2).
+   *
    * @param rel               the original RelNode
    * @param materializations  the materialized view list
    * @return the list of transformed RelNode together with their corresponding
@@ -69,6 +70,7 @@ public abstract class RelOptMaterializations {
    * materialized view uses. Big queries will likely have more than one
    * transformed RelNode, e.g., (t1 group by c1) join (t2 group by c2).
    * In addition, you can add custom materialized view recognition rules.
+   *
    * @param rel               the original RelNode
    * @param materializations  the materialized view list
    * @param materializationRules the materialized view recognition rules
@@ -106,6 +108,7 @@ public abstract class RelOptMaterializations {
 
   /**
    * Returns a list of RelNode transformed from all possible lattice uses.
+   *
    * @param rel       the original RelNode
    * @param lattices  the lattice list
    * @return the list of transformed RelNode together with their corresponding
diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptPlanner.java b/core/src/main/java/org/apache/calcite/plan/RelOptPlanner.java
index 1ef7933932..3f1fe01fef 100644
--- a/core/src/main/java/org/apache/calcite/plan/RelOptPlanner.java
+++ b/core/src/main/java/org/apache/calcite/plan/RelOptPlanner.java
@@ -168,7 +168,7 @@ public interface RelOptPlanner {
    * {@code tableRel} is cheaper to evaluate and therefore if the query being
    * optimized uses (or can be rewritten to use) {@code queryRel} as a
    * sub-expression then it can be optimized by using {@code tableRel}
-   * instead.</p>
+   * instead.
    */
   void addMaterialization(RelOptMaterialization materialization);
 
@@ -280,7 +280,7 @@ public interface RelOptPlanner {
    *
    * <p>Planners which use their own relational expressions internally
    * to represent concepts such as equivalence classes will generally need to
-   * supply corresponding metadata providers.</p>
+   * supply corresponding metadata providers.
    *
    * @param list receives planner's custom providers, if any
    */
@@ -303,7 +303,8 @@ public interface RelOptPlanner {
    *
    * <p>When a node is pruned, the related pending rule
    * calls are cancelled, and future rules will not fire.
-   * This can be used to reduce the search space. </p>
+   * This can be used to reduce the search space.
+   *
    * @param rel the node to prune.
    */
   void prune(RelNode rel);
@@ -321,7 +322,7 @@ public interface RelOptPlanner {
    * default values of any traits that have them.
    *
    * <p>The empty trait set acts as the prototype (a kind of factory) for all
-   * subsequently created trait sets.</p>
+   * subsequently created trait sets.
    *
    * @return Empty trait set
    */
diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptPredicateList.java b/core/src/main/java/org/apache/calcite/plan/RelOptPredicateList.java
index d6f1de5ce1..9045bb589a 100644
--- a/core/src/main/java/org/apache/calcite/plan/RelOptPredicateList.java
+++ b/core/src/main/java/org/apache/calcite/plan/RelOptPredicateList.java
@@ -125,6 +125,7 @@ public class RelOptPredicateList {
 
   /**
    * Returns true if given predicate list is empty.
+   *
    * @param value input predicate list
    * @return true if all the predicates are empty or if the argument is null
    */
diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptRule.java b/core/src/main/java/org/apache/calcite/plan/RelOptRule.java
index dadf7f4f95..c9a7280b08 100644
--- a/core/src/main/java/org/apache/calcite/plan/RelOptRule.java
+++ b/core/src/main/java/org/apache/calcite/plan/RelOptRule.java
@@ -40,7 +40,7 @@ import java.util.function.Predicate;
  * applied to a particular section of the tree.
  *
  * <p>The optimizer figures out which rules are applicable, then calls
- * {@link #onMatch} on each of them.</p>
+ * {@link #onMatch} on each of them.
  */
 public abstract class RelOptRule {
   //~ Static fields/initializers ---------------------------------------------
@@ -237,10 +237,10 @@ public abstract class RelOptRule {
    * <p>Shorthand for <code>operand(clazz, some(...))</code>.
    *
    * <p>If you wish to match a relational expression that has no children
-   * (that is, a leaf node), write <code>operand(clazz, none())</code></p>.
+   * (that is, a leaf node), write <code>operand(clazz, none())</code>.
    *
    * <p>If you wish to match a relational expression that has any number of
-   * children, write <code>operand(clazz, any())</code></p>.
+   * children, write <code>operand(clazz, any())</code>.
    *
    * @param clazz Class of relational expression to match (must not be null)
    * @param first First operand
@@ -312,20 +312,20 @@ public abstract class RelOptRule {
    *
    * <p>This is useful when matching a relational expression which
    * can have a variable number of children. For example, the rule to
-   * eliminate empty children of a Union would have operands</p>
+   * eliminate empty children of a Union would have operands
    *
    * <blockquote>Operand(Union, true, Operand(Empty))</blockquote>
    *
-   * <p>and given the relational expressions</p>
+   * <p>and given the relational expressions
    *
    * <blockquote>Union(LogicalFilter, Empty, LogicalProject)</blockquote>
    *
-   * <p>would fire the rule with arguments</p>
+   * <p>would fire the rule with arguments
    *
    * <blockquote>{Union, Empty}</blockquote>
    *
    * <p>It is up to the rule to deduce the other children, or indeed the
-   * position of the matched child.</p>
+   * position of the matched child.
    *
    * @param first First child operand
    * @param rest  Remaining child operands (may be empty)
@@ -540,7 +540,7 @@ public abstract class RelOptRule {
    *
    * <p>Typically a rule would check that the nodes are valid matches, creates
    * a new expression, then calls back {@link RelOptRuleCall#transformTo} to
-   * register the expression.</p>
+   * register the expression.
    *
    * @param call Rule call
    * @see #matches(RelOptRuleCall)
diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptRuleOperand.java b/core/src/main/java/org/apache/calcite/plan/RelOptRuleOperand.java
index 796901236a..65d74c60f7 100644
--- a/core/src/main/java/org/apache/calcite/plan/RelOptRuleOperand.java
+++ b/core/src/main/java/org/apache/calcite/plan/RelOptRuleOperand.java
@@ -34,11 +34,11 @@ import java.util.function.Predicate;
  * can be applied to a particular expression.
  *
  * <p>For example, the rule to pull a filter up from the left side of a join
- * takes operands: <code>Join(Filter, Any)</code>.</p>
+ * takes operands: <code>Join(Filter, Any)</code>.
  *
  * <p>Note that <code>children</code> means different things if it is empty or
  * it is <code>null</code>: <code>Join(Filter <b>()</b>, Any)</code> means
- * that, to match the rule, <code>Filter</code> must have no operands.</p>
+ * that, to match the rule, <code>Filter</code> must have no operands.
  */
 public class RelOptRuleOperand {
   //~ Instance fields --------------------------------------------------------
@@ -197,10 +197,10 @@ public class RelOptRuleOperand {
    *
    * <p>To facilitate IDE shows the operand description in the debugger,
    * returns the root operand description, but highlight current
-   * operand's matched class with '*' in the description.</p>
+   * operand's matched class with '*' in the description.
    *
    * <p>e.g. The following are examples of rule operand description for
-   * the operands that match with {@code LogicalFilter}.</p>
+   * the operands that match with {@code LogicalFilter}.
    *
    * <ul>
    * <li>SemiJoinRule:project: Project(Join(*RelNode*, Aggregate))</li>
diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptRuleOperandChildPolicy.java b/core/src/main/java/org/apache/calcite/plan/RelOptRuleOperandChildPolicy.java
index dabba09213..47ba10b1d1 100644
--- a/core/src/main/java/org/apache/calcite/plan/RelOptRuleOperandChildPolicy.java
+++ b/core/src/main/java/org/apache/calcite/plan/RelOptRuleOperandChildPolicy.java
@@ -32,7 +32,7 @@ public enum RelOptRuleOperandChildPolicy {
    *
    * <p>{@code RelOptRuleOperand(Foo.class, NONE)} is equivalent to
    * {@code RelOptRuleOperand(Foo.class)} but we prefer the former because
-   * it is more explicit.</p>
+   * it is more explicit.
    */
   LEAF,
 
diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptSchema.java b/core/src/main/java/org/apache/calcite/plan/RelOptSchema.java
index c130d6854f..77527c2e7b 100644
--- a/core/src/main/java/org/apache/calcite/plan/RelOptSchema.java
+++ b/core/src/main/java/org/apache/calcite/plan/RelOptSchema.java
@@ -33,10 +33,10 @@ public interface RelOptSchema {
    *
    * <p>For example, the Saffron expression <code>salesSchema.emps</code>
    * would be resolved using a call to <code>salesSchema.getTableForMember(new
-   * String[]{"emps" })</code>.</p>
+   * String[]{"emps" })</code>.
    *
    * <p>Note that name.length is only greater than 1 for queries originating
-   * from JDBC.</p>
+   * from JDBC.
    *
    * @param names Qualified name
    */
diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptTable.java b/core/src/main/java/org/apache/calcite/plan/RelOptTable.java
index 1e9929973e..7fb90677c8 100644
--- a/core/src/main/java/org/apache/calcite/plan/RelOptTable.java
+++ b/core/src/main/java/org/apache/calcite/plan/RelOptTable.java
@@ -73,7 +73,7 @@ public interface RelOptTable extends Wrapper {
    * {@link org.apache.calcite.rel.logical.LogicalTableScan},
    * then optimizes this expression by
    * applying {@link org.apache.calcite.plan.RelOptRule rules} to transform it
-   * into more efficient access methods for this table.</p>
+   * into more efficient access methods for this table.
    */
   RelNode toRel(ToRelContext context);
 
@@ -132,7 +132,7 @@ public interface RelOptTable extends Wrapper {
   RelOptTable extend(List<RelDataTypeField> extendedFields);
 
   /** Returns a list describing how each column is populated. The list has the
-   *  same number of entries as there are fields, and is immutable. */
+   * same number of entries as there are fields, and is immutable. */
   List<ColumnStrategy> getColumnStrategies();
 
   /** Can expand a view into relational expressions. */
diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java b/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java
index 1e1df16a29..fc1d016dd7 100644
--- a/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java
+++ b/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java
@@ -1461,6 +1461,7 @@ public abstract class RelOptUtil {
   /**
    * Returns {@link SqlOperator} for given {@link SqlKind} or returns {@code operator}
    * when {@link SqlKind} is not known.
+   *
    * @param kind input kind
    * @param operator default operator value
    * @return SqlOperator for the given kind
@@ -2461,14 +2462,14 @@ public abstract class RelOptUtil {
    * together, and a list of expressions that are preceded by NOT.
    *
    * <p>For example, {@code a AND NOT b AND NOT (c and d) AND TRUE AND NOT
-   * FALSE} returns {@code rexList = [a], notList = [b, c AND d]}.</p>
+   * FALSE} returns {@code rexList = [a], notList = [b, c AND d]}.
    *
    * <p>TRUE and NOT FALSE expressions are ignored. FALSE and NOT TRUE
    * expressions are placed on {@code rexList} and {@code notList} as other
-   * expressions.</p>
+   * expressions.
    *
    * <p>For example, {@code a AND TRUE AND NOT TRUE} returns
-   * {@code rexList = [a], notList = [TRUE]}.</p>
+   * {@code rexList = [a], notList = [TRUE]}.
    *
    * @param rexPredicate predicate to be analyzed
    * @param rexList      list of decomposed RexNodes (except those with NOT)
@@ -2548,7 +2549,7 @@ public abstract class RelOptUtil {
    * Returns a condition decomposed by AND.
    *
    * <p>For example, {@code conjunctions(TRUE)} returns the empty list;
-   * {@code conjunctions(FALSE)} returns list {@code {FALSE}}.</p>
+   * {@code conjunctions(FALSE)} returns list {@code {FALSE}}.
    */
   public static List<RexNode> conjunctions(@Nullable RexNode rexPredicate) {
     final List<RexNode> list = new ArrayList<>();
@@ -2559,7 +2560,7 @@ public abstract class RelOptUtil {
   /**
    * Returns a condition decomposed by OR.
    *
-   * <p>For example, {@code disjunctions(FALSE)} returns the empty list.</p>
+   * <p>For example, {@code disjunctions(FALSE)} returns the empty list.
    */
   public static List<RexNode> disjunctions(RexNode rexPredicate) {
     final List<RexNode> list = new ArrayList<>();
@@ -3424,7 +3425,7 @@ public abstract class RelOptUtil {
    * Creates a relational expression that projects the given fields of the
    * input.
    *
-   * <p>Optimizes if the fields are the identity projection.</p>
+   * <p>Optimizes if the fields are the identity projection.
    *
    * @param child   Input relational expression
    * @param posList Source of each projected field
@@ -3491,7 +3492,7 @@ public abstract class RelOptUtil {
    * Creates a relational expression which permutes the output fields of a
    * relational expression according to a permutation.
    *
-   * <p>Optimizations:</p>
+   * <p>Optimizations:
    *
    * <ul>
    * <li>If the relational expression is a
diff --git a/core/src/main/java/org/apache/calcite/plan/RelTrait.java b/core/src/main/java/org/apache/calcite/plan/RelTrait.java
index c410a96d67..c0e29793e3 100644
--- a/core/src/main/java/org/apache/calcite/plan/RelTrait.java
+++ b/core/src/main/java/org/apache/calcite/plan/RelTrait.java
@@ -35,7 +35,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
  * new RelTrait instances are generated at runtime (e.g. based on state external
  * to the planner), you must implement {@link #hashCode()} and
  * {@link #equals(Object)} for proper {@link RelTraitDef#canonize canonization}
- * of your RelTrait objects.</p>
+ * of your RelTrait objects.
  */
 public interface RelTrait {
   //~ Methods ----------------------------------------------------------------
@@ -86,7 +86,7 @@ public interface RelTrait {
    * Registers a trait instance with the planner.
    *
    * <p>This is an opportunity to add rules that relate to that trait. However,
-   * typical implementations will do nothing.</p>
+   * typical implementations will do nothing.
    *
    * @param planner Planner
    */
@@ -96,16 +96,16 @@ public interface RelTrait {
    * Applies a mapping to this trait.
    *
    * <p>Some traits may be changed if the columns order is changed by a mapping
-   * of the {@link Project} operator. </p>
+   * of the {@link Project} operator.
    *
    * <p>For example, if relation {@code SELECT a, b ORDER BY a, b} is sorted by
    * columns [0, 1], then the project {@code SELECT b, a} over this relation
    * will be sorted by columns [1, 0]. In the same time project {@code SELECT b}
    * will not be sorted at all because it doesn't contain the collation
-   * prefix and this method will return an empty collation. </p>
+   * prefix and this method will return an empty collation.
    *
    * <p>Other traits are independent from the columns remapping. For example
-   * {@link Convention} or {@link RelDistributions#SINGLETON}.</p>
+   * {@link Convention} or {@link RelDistributions#SINGLETON}.
    *
    * @param mapping   Mapping
    * @return trait with mapping applied
diff --git a/core/src/main/java/org/apache/calcite/plan/RelTraitDef.java b/core/src/main/java/org/apache/calcite/plan/RelTraitDef.java
index 74d46e9c1d..fca993bdb9 100644
--- a/core/src/main/java/org/apache/calcite/plan/RelTraitDef.java
+++ b/core/src/main/java/org/apache/calcite/plan/RelTraitDef.java
@@ -47,7 +47,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
  * </ol>
  *
  * <p>Otherwise, a new instance of RelTraitDef must be constructed and
- * registered with each new planner instantiated.</p>
+ * registered with each new planner instantiated.
  *
  * @param <T> Trait that this trait definition is based upon
  */
@@ -73,7 +73,7 @@ public abstract class RelTraitDef<T extends RelTrait> {
    * Whether a relational expression may possess more than one instance of
    * this trait simultaneously.
    *
-   * <p>A subset has only one instance of a trait.</p>
+   * <p>A subset has only one instance of a trait.
    */
   public boolean multiple() {
     return false;
diff --git a/core/src/main/java/org/apache/calcite/plan/Strong.java b/core/src/main/java/org/apache/calcite/plan/Strong.java
index e2b67f0762..c0d5cece4c 100644
--- a/core/src/main/java/org/apache/calcite/plan/Strong.java
+++ b/core/src/main/java/org/apache/calcite/plan/Strong.java
@@ -39,11 +39,11 @@ import java.util.Map;
 /** Utilities for strong predicates.
  *
  * <p>A predicate is strong (or null-rejecting) with regards to selected subset of inputs
- * if it is UNKNOWN if all inputs in selected subset are UNKNOWN.</p>
+ * if it is UNKNOWN if all inputs in selected subset are UNKNOWN.
  *
- * <p>By the way, UNKNOWN is just the boolean form of NULL.</p>
+ * <p>By the way, UNKNOWN is just the boolean form of NULL.
  *
- * <p>Examples:</p>
+ * <p>Examples:
  * <ul>
  *   <li>{@code UNKNOWN} is strong in [] (definitely null)
  *   <li>{@code c = 1} is strong in [c] (definitely null if and only if c is
@@ -133,7 +133,7 @@ public class Strong {
   /**
    * Returns whether a given expression is strong.
    *
-   * <p>Examples:</p>
+   * <p>Examples:
    * <ul>
    *   <li>Returns true for {@code c = 1} since it returns null if and only if
    *   c is null
diff --git a/core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java b/core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java
index f631cce3f1..9668f44625 100644
--- a/core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java
+++ b/core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java
@@ -96,10 +96,10 @@ import static java.util.Objects.requireNonNull;
  *
  * <p>The call {@code new SubstitutionVisitor(target, query).go(replacement))}
  * will return {@code query} with every occurrence of {@code target} replaced
- * by {@code replacement}.</p>
+ * by {@code replacement}.
  *
  * <p>The following example shows how {@code SubstitutionVisitor} can be used
- * for materialized view recognition.</p>
+ * for materialized view recognition.
  *
  * <ul>
  * <li>query = SELECT a, c FROM t WHERE x = 5 AND b = 4</li>
@@ -109,10 +109,10 @@ import static java.util.Objects.requireNonNull;
  * </ul>
  *
  * <p>Note that {@code result} uses the materialized view table {@code mv} and a
- * simplified condition {@code b = 4}.</p>
+ * simplified condition {@code b = 4}.
  *
  * <p>Uses a bottom-up matching algorithm. Nodes do not need to be identical.
- * At each level, returns the residue.</p>
+ * At each level, returns the residue.
  *
  * <p>The inputs must only include the core relational operators:
  * {@link org.apache.calcite.rel.core.TableScan},
@@ -122,7 +122,7 @@ import static java.util.Objects.requireNonNull;
  * {@link org.apache.calcite.rel.core.Join},
  * {@link org.apache.calcite.rel.core.Union},
  * {@link org.apache.calcite.rel.core.Intersect},
- * {@link org.apache.calcite.rel.core.Aggregate}.</p>
+ * {@link org.apache.calcite.rel.core.Aggregate}.
  */
 public class SubstitutionVisitor {
   private static final boolean DEBUG = CalciteSystemProperty.DEBUG.value();
@@ -233,17 +233,17 @@ public class SubstitutionVisitor {
    * <p>If condition is stronger than target, returns the residue.
    * If it is equal to target, returns the expression that evaluates to
    * the constant {@code true}. If it is weaker than target, returns
-   * {@code null}.</p>
+   * {@code null}.
    *
-   * <p>The terms satisfy the relation</p>
+   * <p>The terms satisfy the relation
    *
    * <blockquote>
    * <pre>{@code condition = target AND residue}</pre>
    * </blockquote>
    *
-   * <p>and {@code residue} must be as weak as possible.</p>
+   * <p>and {@code residue} must be as weak as possible.
    *
-   * <p>Example #1: condition stronger than target</p>
+   * <p>Example #1: condition stronger than target
    * <ul>
    * <li>condition: x = 1 AND y = 2</li>
    * <li>target: x = 1</li>
@@ -252,24 +252,24 @@ public class SubstitutionVisitor {
    *
    * <p>Note that residue {@code x > 0 AND y = 2} would also satisfy the
    * relation {@code condition = target AND residue} but is stronger than
-   * necessary, so we prefer {@code y = 2}.</p>
+   * necessary, so we prefer {@code y = 2}.
    *
    * <p>Example #2: target weaker than condition (valid, but not currently
-   * implemented)</p>
+   * implemented)
    * <ul>
    * <li>condition: x = 1</li>
    * <li>target: x = 1 OR z = 3</li>
    * <li>residue: x = 1</li>
    * </ul>
    *
-   * <p>Example #3: condition and target are equivalent</p>
+   * <p>Example #3: condition and target are equivalent
    * <ul>
    * <li>condition: x = 1 AND y = 2</li>
    * <li>target: y = 2 AND x = 1</li>
    * <li>residue: TRUE</li>
    * </ul>
    *
-   * <p>Example #4: condition weaker than target</p>
+   * <p>Example #4: condition weaker than target
    * <ul>
    * <li>condition: x = 1</li>
    * <li>target: x = 1 AND y = 2</li>
@@ -280,7 +280,7 @@ public class SubstitutionVisitor {
    * whether {@code condition AND NOT target} can ever evaluate to
    * true, and therefore is a form of the NP-complete
    * <a href="http://en.wikipedia.org/wiki/Satisfiability">Satisfiability</a>
-   * problem.</p>
+   * problem.
    */
   @VisibleForTesting
   public static @Nullable RexNode splitFilter(final RexSimplify simplify,
@@ -426,7 +426,7 @@ public class SubstitutionVisitor {
    *
    * <p>This method may give false positives. For instance, it will say
    * that {@code x = 5 AND x > 10} is satisfiable, because at present it
-   * cannot prove that it is not.</p>
+   * cannot prove that it is not.
    */
   public static boolean mayBeSatisfiable(RexNode e) {
     // Example:
@@ -862,7 +862,7 @@ public class SubstitutionVisitor {
    * against a target relational expression.
    *
    * <p>The rule declares the query and target types; this allows the
-   * engine to fire only a few rules in a given context.</p>
+   * engine to fire only a few rules in a given context.
    */
   public abstract static class UnifyRule {
     protected final int slotCount;
@@ -882,7 +882,7 @@ public class SubstitutionVisitor {
      * invoked, Calcite has made sure that query's children are equivalent
      * to target's children.
      *
-     * <p>There are 3 possible outcomes:</p>
+     * <p>There are 3 possible outcomes:
      *
      * <ul>
      *
@@ -898,7 +898,7 @@ public class SubstitutionVisitor {
      * </ul>
      *
      * <p>REVIEW: Is possible that we match query PLUS one or more of its
-     * ancestors?</p>
+     * ancestors?
      *
      * @param call Input parameters
      */
@@ -1050,7 +1050,7 @@ public class SubstitutionVisitor {
    *
    * <p>Matches scans to the same table, because these will be
    * {@link MutableScan}s with the same
-   * {@link org.apache.calcite.rel.core.TableScan} instance.</p>
+   * {@link org.apache.calcite.rel.core.TableScan} instance.
    */
   private static class TrivialRule extends AbstractUnifyRule {
     private static final TrivialRule INSTANCE = new TrivialRule();
diff --git a/core/src/main/java/org/apache/calcite/plan/visualizer/RuleMatchVisualizer.java b/core/src/main/java/org/apache/calcite/plan/visualizer/RuleMatchVisualizer.java
index 4b2c1828b5..d9e795996d 100644
--- a/core/src/main/java/org/apache/calcite/plan/visualizer/RuleMatchVisualizer.java
+++ b/core/src/main/java/org/apache/calcite/plan/visualizer/RuleMatchVisualizer.java
@@ -373,8 +373,8 @@ public class RuleMatchVisualizer implements RelOptListener {
 
   /**
    * Writes the HTML and JS files of the rule match visualization.
-   * <p>
-   * The old files with the same name will be replaced.
+   *
+   * <p>The old files with the same name will be replaced.
    */
   public void writeToFile() {
     if (outputDirectory == null || outputSuffix == null) {
diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/AbstractConverter.java b/core/src/main/java/org/apache/calcite/plan/volcano/AbstractConverter.java
index 3192f0986b..23f85c888e 100644
--- a/core/src/main/java/org/apache/calcite/plan/volcano/AbstractConverter.java
+++ b/core/src/main/java/org/apache/calcite/plan/volcano/AbstractConverter.java
@@ -46,7 +46,7 @@ import java.util.List;
  *
  * <p>If an abstract converter cannot be satisfied immediately (because the
  * source subset is abstract), the set is flagged, so this converter will be
- * expanded as soon as a non-abstract relexp is added to the set.</p>
+ * expanded as soon as a non-abstract relexp is added to the set.
  */
 @Value.Enclosing
 public class AbstractConverter extends ConverterImpl {
diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/Dumpers.java b/core/src/main/java/org/apache/calcite/plan/volcano/Dumpers.java
index 4664a19434..44560dde7e 100644
--- a/core/src/main/java/org/apache/calcite/plan/volcano/Dumpers.java
+++ b/core/src/main/java/org/apache/calcite/plan/volcano/Dumpers.java
@@ -57,7 +57,7 @@ class Dumpers {
    *
    * <p>Thus, every relational expression and rule invocation that affected
    * the final outcome is described in the provenance. This can be useful
-   * when finding the root cause of "mistakes" in a query plan.</p>
+   * when finding the root cause of "mistakes" in a query plan.
    *
    * @param provenanceMap The provenance map
    * @param root Root relational expression in a tree
diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/IterativeRuleQueue.java b/core/src/main/java/org/apache/calcite/plan/volcano/IterativeRuleQueue.java
index 81976b4877..711f92e319 100644
--- a/core/src/main/java/org/apache/calcite/plan/volcano/IterativeRuleQueue.java
+++ b/core/src/main/java/org/apache/calcite/plan/volcano/IterativeRuleQueue.java
@@ -95,7 +95,7 @@ class IterativeRuleQueue extends RuleQueue {
   /**
    * Removes the rule match from the head of match list, and returns it.
    *
-   * <p>Returns {@code null} if there are no more matches.</p>
+   * <p>Returns {@code null} if there are no more matches.
    *
    * <p>Note that the VolcanoPlanner may still decide to reject rule matches
    * which have become invalid, say if one of their operands belongs to an
diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/RelSet.java b/core/src/main/java/org/apache/calcite/plan/volcano/RelSet.java
index 1fd6ed9229..6d0890e869 100644
--- a/core/src/main/java/org/apache/calcite/plan/volcano/RelSet.java
+++ b/core/src/main/java/org/apache/calcite/plan/volcano/RelSet.java
@@ -52,7 +52,7 @@ import static java.util.Objects.requireNonNull;
  * using the expression which has the lowest cost.
  *
  * <p>All of the expressions in an <code>RelSet</code> have the same calling
- * convention.</p>
+ * convention.
  */
 class RelSet {
   //~ Static fields/initializers ---------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/RelSubset.java b/core/src/main/java/org/apache/calcite/plan/volcano/RelSubset.java
index 2cb01a390f..29b26adb36 100644
--- a/core/src/main/java/org/apache/calcite/plan/volcano/RelSubset.java
+++ b/core/src/main/java/org/apache/calcite/plan/volcano/RelSubset.java
@@ -160,7 +160,7 @@ public class RelSubset extends AbstractRelNode {
    * Computes the best {@link RelNode} in this subset.
    *
    * <p>Only necessary when a subset is created in a set that has subsets that
-   * subsume it. Rationale:</p>
+   * subsume it. Rationale:
    *
    * <ol>
    * <li>If the are no subsuming subsets, the subset is initially empty.</li>
diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/RuleQueue.java b/core/src/main/java/org/apache/calcite/plan/volcano/RuleQueue.java
index c608e6966d..3efe2ec289 100644
--- a/core/src/main/java/org/apache/calcite/plan/volcano/RuleQueue.java
+++ b/core/src/main/java/org/apache/calcite/plan/volcano/RuleQueue.java
@@ -38,6 +38,7 @@ public abstract class RuleQueue {
 
   /**
    * Add a RuleMatch into the queue.
+   *
    * @param match rule match to add
    */
   public abstract void addMatch(VolcanoRuleMatch match);
@@ -45,6 +46,7 @@ public abstract class RuleQueue {
   /**
    * clear this rule queue.
    * The return value indicates whether the rule queue was empty before clear.
+   *
    * @return true if the rule queue was not empty
    */
   public abstract boolean clear();
diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/TopDownRuleDriver.java b/core/src/main/java/org/apache/calcite/plan/volcano/TopDownRuleDriver.java
index 02a3a8d9fc..821c7e5335 100644
--- a/core/src/main/java/org/apache/calcite/plan/volcano/TopDownRuleDriver.java
+++ b/core/src/main/java/org/apache/calcite/plan/volcano/TopDownRuleDriver.java
@@ -45,7 +45,7 @@ import static java.util.Objects.requireNonNull;
  *
  * <p>This implementation uses tasks to manage rule matches.
  * A Task is a piece of work to be executed, it may apply some rules
- * or schedule other tasks.</p>
+ * or schedule other tasks.
  */
 @SuppressWarnings("JdkObsolete")
 class TopDownRuleDriver implements RuleDriver {
@@ -541,9 +541,7 @@ class TopDownRuleDriver implements RuleDriver {
     }
   }
 
-  /**
-   *  Decides how to optimize a physical node.
-   */
+  /** Decides how to optimize a physical node. */
   private @Nullable Task getOptimizeInputTask(RelNode rel, RelSubset group) {
     // If the physical does not in current optimizing RelSubset, it firstly tries to
     // convert the physical node either by converter rule or traits pass though.
diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoCost.java b/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoCost.java
index f5390282de..1c0fb6e974 100644
--- a/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoCost.java
+++ b/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoCost.java
@@ -28,7 +28,7 @@ import java.util.Objects;
  * <code>VolcanoCost</code> represents the cost of a plan node.
  *
  * <p>This class is immutable: none of the methods modify any member
- * variables.</p>
+ * variables.
  */
 class VolcanoCost implements RelOptCost {
   //~ Static fields/initializers ---------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java b/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java
index ad57236c47..4e43d13fa0 100644
--- a/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java
+++ b/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java
@@ -103,7 +103,7 @@ public class VolcanoPlanner extends AbstractRelOptPlanner {
    *
    * <p>Any operand can be an 'entry point' to a rule call, when a RelNode is
    * registered which matches the operand. This map allows us to narrow down
-   * operands based on the class of the RelNode.</p>
+   * operands based on the class of the RelNode.
    */
   private final Multimap<Class<? extends RelNode>, RelOptRuleOperand>
       classOperands = LinkedListMultimap.create();
@@ -128,7 +128,7 @@ public class VolcanoPlanner extends AbstractRelOptPlanner {
    * {@link RelSet} objects. Most {@link RelNode} objects are identified by
    * their digest, which involves the set that their child relational
    * expressions belong to. If those children belong to the same set, we have
-   * to be careful, otherwise it gets incestuous.</p>
+   * to be careful, otherwise it gets incestuous.
    */
   private final IdentityHashMap<RelNode, RelSubset> mapRel2Subset =
       new IdentityHashMap<>();
@@ -254,7 +254,7 @@ public class VolcanoPlanner extends AbstractRelOptPlanner {
    * Enable or disable top-down optimization.
    *
    * <p>Note: Enabling top-down optimization will automatically enable
-   * top-down trait propagation.</p>
+   * top-down trait propagation.
    */
   public void setTopDownOpt(boolean value) {
     if (topDownOpt == value) {
@@ -697,6 +697,7 @@ public class VolcanoPlanner extends AbstractRelOptPlanner {
   /**
    * Sets whether this planner should consider rel nodes with Convention.NONE
    * to have infinite cost or not.
+   *
    * @param infinite Whether to make none convention rel nodes infinite cost
    */
   public void setNoneConventionHasInfiniteCost(boolean infinite) {
@@ -705,6 +706,7 @@ public class VolcanoPlanner extends AbstractRelOptPlanner {
 
   /**
    * Returns cost of a relation or infinite cost if the cost is not known.
+   *
    * @param rel relation t
    * @param mq metadata query
    * @return cost of the relation or infinite cost if the cost is not known
@@ -1514,6 +1516,7 @@ public class VolcanoPlanner extends AbstractRelOptPlanner {
 
   /**
    * Decide whether a rule is logical or not.
+   *
    * @param rel The specific rel node
    * @return True if the relnode is a logical node
    */
diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/package-info.java b/core/src/main/java/org/apache/calcite/plan/volcano/package-info.java
index 15ac0f28f4..24232dc9c9 100644
--- a/core/src/main/java/org/apache/calcite/plan/volcano/package-info.java
+++ b/core/src/main/java/org/apache/calcite/plan/volcano/package-info.java
@@ -16,28 +16,28 @@
  */
 
 /**
- * Optimizes relational expressions.<p>&nbsp;</p>
+ * Optimizes relational expressions.
  *
  * <h2>Overview</h2>
  *
  * <p>A <dfn>planner</dfn> (also known as an <dfn>optimizer</dfn>) finds the
  * most efficient implementation of a
- * {@link org.apache.calcite.rel.RelNode relational expression}.</p>
+ * {@link org.apache.calcite.rel.RelNode relational expression}.
  *
  * <p>Interface {@link org.apache.calcite.plan.RelOptPlanner} defines a planner,
  * and class {@link org.apache.calcite.plan.volcano.VolcanoPlanner} is an
  * implementation which uses a dynamic programming technique. It is based upon
- * the Volcano optimizer [<a href="#graefe93">1</a>].</p>
+ * the Volcano optimizer [<a href="#graefe93">1</a>].
  *
  * <p>Interface {@link org.apache.calcite.plan.RelOptCost} defines a cost
  * model; class {@link org.apache.calcite.plan.volcano.VolcanoCost} is
- * the implementation for a <code>VolcanoPlanner</code>.</p>
+ * the implementation for a <code>VolcanoPlanner</code>.
  *
  * <p>A {@link org.apache.calcite.plan.volcano.RelSet} is a set of equivalent
  * relational expressions.  They are equivalent because they will produce the
  * same result for any set of input data. It is an equivalence class: two
  * expressions are in the same set if and only if they are in the same
- * <code>RelSet</code>.</p>
+ * <code>RelSet</code>.
  *
  * <p>One of the unique features of the optimizer is that expressions can take
  * on a variety of physical traits. Each relational expression has a set of
@@ -48,7 +48,7 @@
  * data. {@link org.apache.calcite.plan.ConventionTraitDef} defines the trait
  * and {@link org.apache.calcite.plan.Convention} enumerates the
  * protocols. Every relational expression has a single calling convention by
- * which it returns its results. Some examples:</p>
+ * which it returns its results. Some examples:
  *
  * <ul>
  *     <li>{@link org.apache.calcite.adapter.jdbc.JdbcConvention} is a fairly
@@ -78,7 +78,7 @@
  *     </li>
  * </ul>
  *
- * <p>New traits are added to the planner in one of two ways:</p>
+ * <p>New traits are added to the planner in one of two ways:
  * <ol>
  * <li>If the new trait is integral to Calcite, then each and every
  *     implementation of {@link org.apache.calcite.rel.RelNode} should include
@@ -102,12 +102,12 @@
  * type and quantity of traits in their trait set. In either case, the new
  * <code>RelTraitDef</code> implementation must be
  * {@link org.apache.calcite.plan.volcano.VolcanoPlanner#addRelTraitDef(org.apache.calcite.plan.RelTraitDef)}
- * registered with the planner.</p>
+ * registered with the planner.
  *
  * <p>A {@link org.apache.calcite.plan.volcano.RelSubset} is a subset of a
  * <code>RelSet</code> containing expressions which are equivalent and which
  * have the same <code>Convention</code>. Like <code>RelSet</code>, it is an
- * equivalence class.</p>
+ * equivalence class.
  *
  * <h2>Related packages</h2>
  * <ul>
@@ -118,13 +118,11 @@
  *
  * <h2>Details</h2>
  *
- * <p>...</p>
- *
  * <p>Sets merge when the result of a rule already exists in another set. This
  *     implies that all of the expressions are equivalent. The RelSets are
- *     merged, and so are the contained RelSubsets.</p>
+ *     merged, and so are the contained RelSubsets.
  *
- * <p>Expression registration.</p>
+ * <p>Expression registration.
  * <ul>
  *     <li>Expression is added to a set. We may find that an equivalent
  *         expression already exists. Otherwise, this is the moment when an
@@ -139,31 +137,31 @@
  *         expression is registered </li>
  * </ul>
  *
- * <p>Algorithm</p>
+ * <p>Algorithm
  *
- * <p>To optimize a relational expression R:</p>
+ * <p>To optimize a relational expression R:
  *
- * <p>1. Register R.</p>
+ * <p>1. Register R.
  *
- * <p>2. Create rule-calls for all applicable rules.</p>
+ * <p>2. Create rule-calls for all applicable rules.
  *
- * <p>3. Rank the rule calls by importance.</p>
+ * <p>3. Rank the rule calls by importance.
  *
- * <p>4. Call the most important rule</p>
+ * <p>4. Call the most important rule
  *
- * <p>5. Repeat.</p>
+ * <p>5. Repeat.
  *
  * <p><b>Importance</b>. A rule-call is important if it is likely to produce
  *     better implementation of a relexp on the plan's critical path. Hence (a)
  *     it produces a member of an important RelSubset, (b) its children are
- *     cheap.</p>
+ *     cheap.
  *
  * <p>Conversion. Conversions are difficult because we have to work backwards
- *     from the goal.</p>
+ *     from the goal.
  *
- * <p><b>Rule triggering</b></p>
+ * <p><b>Rule triggering</b>
  *
- * <p>The rules are:</p>
+ * <p>The rules are:
  * <ol>
  *     <li><code>PushFilterThroughProjectRule</code>. Operands:
  *         <blockquote>
@@ -182,7 +180,7 @@
  * <p>A rule can be triggered by a change to any of its operands. Consider the
  *     rule to combine two filters into one. It would have operands [Filter
  *     [Filter]].  If I register a new Filter, it will trigger the rule in 2
- *     places. Consider:</p>
+ *     places. Consider:
  *
  * <blockquote>
  *   <pre>Project (deptno)                              [exp 1, subset A]
@@ -191,7 +189,9 @@
  *       Project (deptno, gender, empno, salary) [exp 4, subset D]
  *         TableScan (emp)                       [exp 0, subset X]</pre>
  * </blockquote>
- * <p>Apply <code>PushFilterThroughProjectRule</code> to [exp 2, exp 3]:</p>
+ *
+ * <p>Apply <code>PushFilterThroughProjectRule</code> to [exp 2, exp 3]:
+ *
  * <blockquote>
  *   <pre>Project (deptno)                              [exp 1, subset A]
  *   Project (deptno, gender, empno)             [exp 5, subset B]
@@ -202,11 +202,11 @@
  *
  * <p>Two new expressions are created. Expression 5 is in subset B (because it
  *     is equivalent to expression 2), and expression 6 is in a new equivalence
- *     class, subset E.</p>
+ *     class, subset E.
  *
  * <p>The products of a applying a rule can trigger a cascade of rules. Even in
  *     this simple system (2 rules and 4 initial expressions), two more rules
- *     are triggered:</p>
+ *     are triggered:
  *
  * <ul>
  *
@@ -239,16 +239,17 @@
  *     non-singleton subsets are now A {1, 7}, B {2, 5} and E {6, 8}, and new
  *     combinations are possible. For example,
  *     <code>CombineProjectsRule</code>(exp 7, exp 8) further reduces the depth
- *     of the tree to:</p>
+ *     of the tree to:
  *
  * <blockquote>
  *   <pre>Project (deptno)                          [exp 10, subset A]
  *   Filter (gender='F')                     [exp 9, subset F]
  *     TableScan (emp)                       [exp 0, subset X]</pre>
  * </blockquote>
- * <p>Todo: show how rules can cause subsets to merge.</p>
  *
- * <p>Conclusion:</p>
+ * <p>Todo: show how rules can cause subsets to merge.
+ *
+ * <p>Conclusion:
  * <ol>
  *     <li>A rule can be triggered by any of its operands.</li>
  *     <li>If a subset is a child of more than one parent, it can trigger rule
@@ -266,6 +267,6 @@
  *     Volcano Optimizer
  *     Generator: Extensibility and Efficient Search - Goetz Graefe, William J.
  *     McKenna
- *     (1993)</a>.</p>
+ *     (1993)</a>.
  */
 package org.apache.calcite.plan.volcano;
diff --git a/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java b/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java
index d9655a7f7a..2323029f19 100644
--- a/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java
+++ b/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java
@@ -141,7 +141,7 @@ import static java.util.Objects.requireNonNull;
  *
  * <p>This class is public so that projects that create their own JDBC driver
  * and server can fine-tune preferences. However, this class and its methods are
- * subject to change without notice.</p>
+ * subject to change without notice.
  */
 public class CalcitePrepareImpl implements CalcitePrepare {
 
@@ -413,14 +413,14 @@ public class CalcitePrepareImpl implements CalcitePrepare {
    *
    * <p>The collection must have at least one factory, and each factory must
    * create a planner. If the collection has more than one planner, Calcite will
-   * try each planner in turn.</p>
+   * try each planner in turn.
    *
    * <p>One of the things you can do with this mechanism is to try a simpler,
    * faster, planner with a smaller rule set first, then fall back to a more
-   * complex planner for complex and costly queries.</p>
+   * complex planner for complex and costly queries.
    *
    * <p>The default implementation returns a factory that calls
-   * {@link #createPlanner(org.apache.calcite.jdbc.CalcitePrepare.Context)}.</p>
+   * {@link #createPlanner(org.apache.calcite.jdbc.CalcitePrepare.Context)}.
    */
   protected List<Function1<Context, RelOptPlanner>> createPlannerFactories() {
     return Collections.singletonList(
@@ -952,8 +952,8 @@ public class CalcitePrepareImpl implements CalcitePrepare {
 
   /** Holds state for the process of preparing a SQL statement.
    *
-   * <p>Overload this class and {@link #createSqlValidator} to provide desired SqlValidator
-   * and custom validation logic.</p>
+   * <p>Overload this class and {@link #createSqlValidator} to provide desired
+   * SqlValidator and custom validation logic.
    */
   public static class CalcitePreparingStmt extends Prepare
       implements RelOptTable.ViewExpander {
@@ -973,8 +973,8 @@ public class CalcitePrepareImpl implements CalcitePrepare {
 
     /** Constructor.
      *
-     * <p>Overload this constructor and {@link #createSqlValidator} to provide desired
-     *  SqlValidaor and custom validation logic.</p>
+     * <p>Overload this constructor and {@link #createSqlValidator} to provide
+     * desired SqlValidator and custom validation logic.
      */
     public CalcitePreparingStmt(CalcitePrepareImpl prepare,
         Context context,
diff --git a/core/src/main/java/org/apache/calcite/prepare/QueryableRelBuilder.java b/core/src/main/java/org/apache/calcite/prepare/QueryableRelBuilder.java
index 4731e029dd..1835555c71 100644
--- a/core/src/main/java/org/apache/calcite/prepare/QueryableRelBuilder.java
+++ b/core/src/main/java/org/apache/calcite/prepare/QueryableRelBuilder.java
@@ -70,17 +70,17 @@ import static java.util.Objects.requireNonNull;
  * <p>Each of the methods that implements a {@code Replayer} method creates
  * a tree of {@code RelNode}s equivalent to the arguments, and calls
  * {@link #setRel} to assign the root of that tree to the {@link #rel} member
- * variable.</p>
+ * variable.
  *
  * <p>To comply with the {@link org.apache.calcite.linq4j.QueryableFactory}
  * interface, which is after all a factory, each method returns a dummy result
  * such as {@code null} or {@code 0}.
  * The caller will not use the result.
  * The real effect of the method is to
- * call {@link #setRel} with a {@code RelNode}.</p>
+ * call {@link #setRel} with a {@code RelNode}.
  *
  * <p>NOTE: Many methods currently throw {@link UnsupportedOperationException}.
- * These method need to be implemented.</p>
+ * These method need to be implemented.
  *
  * @param <T> Element type
  */
diff --git a/core/src/main/java/org/apache/calcite/rel/AbstractRelNode.java b/core/src/main/java/org/apache/calcite/rel/AbstractRelNode.java
index 53e6d95911..37d12c0528 100644
--- a/core/src/main/java/org/apache/calcite/rel/AbstractRelNode.java
+++ b/core/src/main/java/org/apache/calcite/rel/AbstractRelNode.java
@@ -349,7 +349,7 @@ public abstract class AbstractRelNode implements RelNode {
    * This should work well for most cases. If this method is a performance
    * bottleneck for your project, or the default behavior can't handle
    * your scenario properly, you can choose to override this method and
-   * {@link #deepHashCode()}. See {@code LogicalJoin} as an example.</p>
+   * {@link #deepHashCode()}. See {@code LogicalJoin} as an example.
    *
    * @return Whether the 2 RelNodes are equivalent or have the same digest.
    * @see #deepHashCode()
@@ -460,10 +460,10 @@ public abstract class AbstractRelNode implements RelNode {
   /**
    * A writer object used exclusively for computing the digest of a RelNode.
    *
-   * <p>The writer is meant to be used only for computing a single digest and then thrown away.
-   * After calling {@link #done(RelNode)} the writer should be used only to obtain the computed
-   * {@link #digest}. Any other action is prohibited.</p>
-   *
+   * <p>The writer is meant to be used only for computing a single digest and
+   * then thrown away.  After calling {@link #done(RelNode)} the writer should
+   * be used only to obtain the computed {@link #digest}. Any other action is
+   * prohibited.
    */
   private static final class RelDigestWriter implements RelWriter {
 
diff --git a/core/src/main/java/org/apache/calcite/rel/InvalidRelException.java b/core/src/main/java/org/apache/calcite/rel/InvalidRelException.java
index 36bf29bed0..f71e0a5e13 100644
--- a/core/src/main/java/org/apache/calcite/rel/InvalidRelException.java
+++ b/core/src/main/java/org/apache/calcite/rel/InvalidRelException.java
@@ -24,7 +24,7 @@ package org.apache.calcite.rel;
  * {@link RelNode} when given parameters it cannot accept. For example,
  * {@code EnumerableJoinRel} can only implement equi-joins, so its constructor
  * throws {@code InvalidRelException} when given the condition
- * {@code input0.x - input1.y = 2}.</p>
+ * {@code input0.x - input1.y = 2}.
  *
  * <p>Because the exception is checked (i.e. extends {@link Exception} but not
  * {@link RuntimeException}), constructors that throw this exception will
@@ -32,11 +32,11 @@ package org.apache.calcite.rel;
  * those relational expressions will need to handle it. Usually a rule will
  * not take the exception personally, and will fail to match. The burden of
  * checking is removed from the rule, which means less code for the author of
- * the rule to maintain.</p>
+ * the rule to maintain.
  *
  * <p>The caller that receives an {@code InvalidRelException} (typically a rule
  * attempting to create a relational expression) should log it at
- * the DEBUG level.</p>
+ * the DEBUG level.
  */
 public class InvalidRelException extends Exception {
   /**
diff --git a/core/src/main/java/org/apache/calcite/rel/PhysicalNode.java b/core/src/main/java/org/apache/calcite/rel/PhysicalNode.java
index 8e32b9509e..e90cffb04f 100644
--- a/core/src/main/java/org/apache/calcite/rel/PhysicalNode.java
+++ b/core/src/main/java/org/apache/calcite/rel/PhysicalNode.java
@@ -32,7 +32,7 @@ import java.util.List;
  * Physical node in a planner that is capable of doing
  * physical trait propagation and derivation.
  *
- * <p>How to use?</p>
+ * <p>How to use?
  *
  * <ol>
  *   <li>Enable top-down optimization by setting
@@ -94,8 +94,8 @@ public interface PhysicalNode extends RelNode {
    * Pass required traitset from parent node to child nodes,
    * returns a pair of traits after traits is passed down.
    *
-   * <p>Pair.left: the new traitset
-   * <p>Pair.right: the list of required traitsets for child nodes
+   * <p>Pair.left: the new traitset;
+   * Pair.right: the list of required traitsets for child nodes.
    */
   default @Nullable Pair<RelTraitSet, List<RelTraitSet>> passThroughTraits(
       RelTraitSet required) {
@@ -127,8 +127,8 @@ public interface PhysicalNode extends RelNode {
    * Derive traitset from child node, returns a pair of traits after
    * traits derivation.
    *
-   * <p>Pair.left: the new traitset
-   * <p>Pair.right: the list of required traitsets for child nodes
+   * <p>Pair.left: the new traitset;
+   * Pair.right: the list of required traitsets for child nodes.
    */
   default @Nullable Pair<RelTraitSet, List<RelTraitSet>> deriveTraits(
       RelTraitSet childTraits, int childId) {
diff --git a/core/src/main/java/org/apache/calcite/rel/RelCollationTraitDef.java b/core/src/main/java/org/apache/calcite/rel/RelCollationTraitDef.java
index 7dce4d7c32..d60864362b 100644
--- a/core/src/main/java/org/apache/calcite/rel/RelCollationTraitDef.java
+++ b/core/src/main/java/org/apache/calcite/rel/RelCollationTraitDef.java
@@ -36,7 +36,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
  * <code>LogicalTableScan(table=TIME_BY_DAY)</code> might be sorted by
  * <code>{the_year, the_month, the_date}</code> and also by
  * <code>{time_id}</code>. We have to allow a RelNode to belong to more than
- * one RelSubset (these RelSubsets are always in the same set).</p>
+ * one RelSubset (these RelSubsets are always in the same set).
  */
 public class RelCollationTraitDef extends RelTraitDef<RelCollation> {
   public static final RelCollationTraitDef INSTANCE =
diff --git a/core/src/main/java/org/apache/calcite/rel/RelDistribution.java b/core/src/main/java/org/apache/calcite/rel/RelDistribution.java
index 2c9320ffc7..5708571cc7 100644
--- a/core/src/main/java/org/apache/calcite/rel/RelDistribution.java
+++ b/core/src/main/java/org/apache/calcite/rel/RelDistribution.java
@@ -24,7 +24,7 @@ import java.util.List;
 /**
  * Description of the physical distribution of a relational expression.
  *
- * <p>TBD:</p>
+ * <p>TBD:
  * <ul>
  *   <li>Can we shorten {@link Type#HASH_DISTRIBUTED} to HASH, etc.</li>
  *   <li>Do we need {@link RelDistributions}.DEFAULT?</li>
diff --git a/core/src/main/java/org/apache/calcite/rel/RelNode.java b/core/src/main/java/org/apache/calcite/rel/RelNode.java
index a97b283977..bee62a8a31 100644
--- a/core/src/main/java/org/apache/calcite/rel/RelNode.java
+++ b/core/src/main/java/org/apache/calcite/rel/RelNode.java
@@ -47,11 +47,11 @@ import java.util.Set;
  * Sort, Join, Project, Filter, Scan, Sample.
  *
  * <p>A relational expression is not a scalar expression; see
- * {@link org.apache.calcite.sql.SqlNode} and {@link RexNode}.</p>
+ * {@link org.apache.calcite.sql.SqlNode} and {@link RexNode}.
  *
  * <p>If this type of relational expression has some particular planner rules,
  * it should implement the <em>public static</em> method
- * {@link AbstractRelNode#register}.</p>
+ * {@link AbstractRelNode#register}.
  *
  * <p>When a relational expression comes to be implemented, the system allocates
  * a {@link org.apache.calcite.plan.RelImplementor} to manage the process. Every
@@ -61,7 +61,7 @@ import java.util.Set;
  * relational expression, but may contain other traits, including some applied
  * externally. Because traits can be applied externally, implementations of
  * RelNode should never assume the size or contents of their trait set (beyond
- * those traits configured by the RelNode itself).</p>
+ * those traits configured by the RelNode itself).
  *
  * <p>For each calling-convention, there is a corresponding sub-interface of
  * RelNode. For example,
@@ -69,17 +69,17 @@ import java.util.Set;
  * has operations to manage the conversion to a graph of
  * {@code org.apache.calcite.adapter.enumerable.EnumerableConvention}
  * calling-convention, and it interacts with a
- * {@code EnumerableRelImplementor}.</p>
+ * {@code EnumerableRelImplementor}.
  *
  * <p>A relational expression is only required to implement its
  * calling-convention's interface when it is actually implemented, that is,
  * converted into a plan/program. This means that relational expressions which
  * cannot be implemented, such as converters, are not required to implement
- * their convention's interface.</p>
+ * their convention's interface.
  *
  * <p>Every relational expression must derive from {@link AbstractRelNode}. (Why
  * have the <code>RelNode</code> interface, then? We need a root interface,
- * because an interface can only derive from an interface.)</p>
+ * because an interface can only derive from an interface.)
  */
 public interface RelNode extends RelOptNode, Cloneable {
   //~ Methods ----------------------------------------------------------------
@@ -292,7 +292,7 @@ public interface RelNode extends RelOptNode, Cloneable {
    * Deep equality check for RelNode digest.
    *
    * <p>By default this method collects digest attributes from
-   * explain terms, then compares each attribute pair.</p>
+   * explain terms, then compares each attribute pair.
    *
    * @return Whether the 2 RelNodes are equivalent or have the same digest.
    * @see #deepHashCode()
@@ -382,7 +382,7 @@ public interface RelNode extends RelOptNode, Cloneable {
    * <p>The planner calls this method this first time that it sees a
    * relational expression of this class. The derived class should call
    * {@link org.apache.calcite.plan.RelOptPlanner#addRule} for each rule, and
-   * then call {@code super.register}.</p>
+   * then call {@code super.register}.
    *
    * @param planner Planner to be used to register additional relational
    *                expressions
diff --git a/core/src/main/java/org/apache/calcite/rel/RelWriter.java b/core/src/main/java/org/apache/calcite/rel/RelWriter.java
index 8caf38c4d4..17b44227f0 100644
--- a/core/src/main/java/org/apache/calcite/rel/RelWriter.java
+++ b/core/src/main/java/org/apache/calcite/rel/RelWriter.java
@@ -27,7 +27,7 @@ import java.util.List;
  * Callback for an expression to dump itself to.
  *
  * <p>It is used for generating EXPLAIN PLAN output, and also for serializing
- * a tree of relational expressions to JSON.</p>
+ * a tree of relational expressions to JSON.
  */
 public interface RelWriter {
   /**
@@ -37,7 +37,7 @@ public interface RelWriter {
    * {@link org.apache.calcite.rel.RelNode#explain(RelWriter)}.
    * Each sub-class of {@link org.apache.calcite.rel.RelNode}
    * calls {@link #input(String, org.apache.calcite.rel.RelNode)}
-   * and {@link #item(String, Object)} to declare term-value pairs.</p>
+   * and {@link #item(String, Object)} to declare term-value pairs.
    *
    * @param rel       Relational expression
    * @param valueList List of term-value pairs
diff --git a/core/src/main/java/org/apache/calcite/rel/convert/Converter.java b/core/src/main/java/org/apache/calcite/rel/convert/Converter.java
index 19b1c61bce..cc0eaa8ee7 100644
--- a/core/src/main/java/org/apache/calcite/rel/convert/Converter.java
+++ b/core/src/main/java/org/apache/calcite/rel/convert/Converter.java
@@ -30,7 +30,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
  *
  * <p>Sometimes this conversion is expensive; for example, to convert a
  * non-distinct to a distinct object stream, we have to clone every object in
- * the input.</p>
+ * the input.
  *
  * <p>A converter does not change the logical expression being evaluated; after
  * conversion, the number of rows and the values of those rows will still be the
@@ -44,7 +44,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
  * relational expression). In which case, the method {@link #getInputTraits()}
  * would return a {@link org.apache.calcite.plan.RelTraitSet}. But for
  * simplicity, this class only allows one trait to be converted at a
- * time; all other traits are assumed to be preserved.</p>
+ * time; all other traits are assumed to be preserved.
  */
 public interface Converter extends RelNode {
   //~ Methods ----------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/rel/convert/ConverterRule.java b/core/src/main/java/org/apache/calcite/rel/convert/ConverterRule.java
index c512e29733..240d143d99 100644
--- a/core/src/main/java/org/apache/calcite/rel/convert/ConverterRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/convert/ConverterRule.java
@@ -157,7 +157,7 @@ public abstract class ConverterRule
    * of the input convention.
    *
    * <p>The union-to-java converter, for example, is not guaranteed, because
-   * it only works on unions.</p>
+   * it only works on unions.
    *
    * @return {@code true} if this rule can convert <em>any</em> relational
    *   expression
diff --git a/core/src/main/java/org/apache/calcite/rel/core/Collect.java b/core/src/main/java/org/apache/calcite/rel/core/Collect.java
index d5b1e4588d..6d5d06a2cf 100644
--- a/core/src/main/java/org/apache/calcite/rel/core/Collect.java
+++ b/core/src/main/java/org/apache/calcite/rel/core/Collect.java
@@ -38,7 +38,7 @@ import static java.util.Objects.requireNonNull;
 /**
  * A relational expression that collapses multiple rows into one.
  *
- * <p>Rules:</p>
+ * <p>Rules:
  *
  * <ul>
  * <li>{@link org.apache.calcite.rel.rules.SubQueryRemoveRule}
diff --git a/core/src/main/java/org/apache/calcite/rel/core/Filter.java b/core/src/main/java/org/apache/calcite/rel/core/Filter.java
index dbe44e4df0..14b4b2fcc2 100644
--- a/core/src/main/java/org/apache/calcite/rel/core/Filter.java
+++ b/core/src/main/java/org/apache/calcite/rel/core/Filter.java
@@ -53,7 +53,7 @@ import static java.util.Objects.requireNonNull;
  * <code>true</code>.
  *
  * <p>If the condition allows nulls, then a null value is treated the same as
- * false.</p>
+ * false.
  *
  * @see org.apache.calcite.rel.logical.LogicalFilter
  */
diff --git a/core/src/main/java/org/apache/calcite/rel/core/Join.java b/core/src/main/java/org/apache/calcite/rel/core/Join.java
index 0e461cd783..dc99bfbfe0 100644
--- a/core/src/main/java/org/apache/calcite/rel/core/Join.java
+++ b/core/src/main/java/org/apache/calcite/rel/core/Join.java
@@ -259,7 +259,7 @@ public abstract class Join extends BiRel implements Hintable {
    * {@code SemiJoin} via
    * {@link org.apache.calcite.rel.rules.JoinAddRedundantSemiJoinRule}.
    *
-   * <p>The base implementation returns false.</p>
+   * <p>The base implementation returns false.
    *
    * @return whether this join has already spawned a semi join
    */
diff --git a/core/src/main/java/org/apache/calcite/rel/core/JoinInfo.java b/core/src/main/java/org/apache/calcite/rel/core/JoinInfo.java
index 7b17978df7..e8f20f009a 100644
--- a/core/src/main/java/org/apache/calcite/rel/core/JoinInfo.java
+++ b/core/src/main/java/org/apache/calcite/rel/core/JoinInfo.java
@@ -39,7 +39,7 @@ import java.util.Objects;
  *
  * <p>You can create one using {@link #of}, or call
  * {@link Join#analyzeCondition()}; many kinds of join cache their
- * join info, especially those that are equi-joins.</p>
+ * join info, especially those that are equi-joins.
  *
  * @see Join#analyzeCondition() */
 public class JoinInfo {
diff --git a/core/src/main/java/org/apache/calcite/rel/core/Sort.java b/core/src/main/java/org/apache/calcite/rel/core/Sort.java
index 6297def223..750d27753a 100644
--- a/core/src/main/java/org/apache/calcite/rel/core/Sort.java
+++ b/core/src/main/java/org/apache/calcite/rel/core/Sort.java
@@ -244,7 +244,7 @@ public abstract class Sort extends SingleRel implements Hintable {
    * <code>the_year, the_month</code> because of a known monotonicity
    * constraint among the columns. {@code getCollation} would return
    * <code>[time_id]</code> and {@code collations} would return
-   * <code>[ [time_id], [the_year, the_month] ]</code>.</p>
+   * <code>[ [time_id], [the_year, the_month] ]</code>.
    */
   public RelCollation getCollation() {
     return collation;
diff --git a/core/src/main/java/org/apache/calcite/rel/core/SortExchange.java b/core/src/main/java/org/apache/calcite/rel/core/SortExchange.java
index 0c005e1311..9b1653e865 100644
--- a/core/src/main/java/org/apache/calcite/rel/core/SortExchange.java
+++ b/core/src/main/java/org/apache/calcite/rel/core/SortExchange.java
@@ -97,7 +97,7 @@ public abstract class SortExchange extends Exchange {
    * <code>the_year, the_month</code> because of a known monotonicity
    * constraint among the columns. {@code getCollation} would return
    * <code>[time_id]</code> and {@code collations} would return
-   * <code>[ [time_id], [the_year, the_month] ]</code>.</p>
+   * <code>[ [time_id], [the_year, the_month] ]</code>.
    */
   public RelCollation getCollation() {
     return collation;
diff --git a/core/src/main/java/org/apache/calcite/rel/core/TableScan.java b/core/src/main/java/org/apache/calcite/rel/core/TableScan.java
index 423cb20230..2a1c498a44 100644
--- a/core/src/main/java/org/apache/calcite/rel/core/TableScan.java
+++ b/core/src/main/java/org/apache/calcite/rel/core/TableScan.java
@@ -137,7 +137,7 @@ public abstract class TableScan
    * {@link RelBuilder#project(Iterable)} method.
    *
    * <p>Sub-classes, representing table types that have these capabilities,
-   * should override.</p>
+   * should override.
    *
    * @param fieldsUsed  Bitmap of the fields desired by the consumer
    * @param extraFields Extra fields, not advertised in the table's row-type,
diff --git a/core/src/main/java/org/apache/calcite/rel/core/Window.java b/core/src/main/java/org/apache/calcite/rel/core/Window.java
index 437944f0c5..8cdaa90fff 100644
--- a/core/src/main/java/org/apache/calcite/rel/core/Window.java
+++ b/core/src/main/java/org/apache/calcite/rel/core/Window.java
@@ -189,6 +189,7 @@ public abstract class Window extends SingleRel implements Hintable {
 
   /**
    * Returns constants that are additional inputs of current relation.
+   *
    * @return constants that are additional inputs of current relation
    */
   public List<RexLiteral> getConstants() {
@@ -340,6 +341,7 @@ public abstract class Window extends SingleRel implements Hintable {
      * Returns if the window is guaranteed to have rows.
      * This is useful to refine data type of window aggregates.
      * For instance sum(non-nullable) over (empty window) is NULL.
+     *
      * @return true when the window is non-empty
      * @see org.apache.calcite.sql.SqlWindow#isAlwaysNonEmpty()
      * @see org.apache.calcite.sql.SqlOperatorBinding#getGroupCount()
diff --git a/core/src/main/java/org/apache/calcite/rel/externalize/RelDotWriter.java b/core/src/main/java/org/apache/calcite/rel/externalize/RelDotWriter.java
index 74d82d78ed..07bd57b796 100644
--- a/core/src/main/java/org/apache/calcite/rel/externalize/RelDotWriter.java
+++ b/core/src/main/java/org/apache/calcite/rel/externalize/RelDotWriter.java
@@ -212,6 +212,7 @@ public class RelDotWriter extends RelWriterImpl {
 
   /**
    * Format the label into multiple lines according to the options.
+   *
    * @param label the original label.
    * @param limit the maximal length of the formatted label.
    *              -1 means no limit.
diff --git a/core/src/main/java/org/apache/calcite/rel/hint/CompositeHintPredicate.java b/core/src/main/java/org/apache/calcite/rel/hint/CompositeHintPredicate.java
index 1015ef7103..143e4a7fd1 100644
--- a/core/src/main/java/org/apache/calcite/rel/hint/CompositeHintPredicate.java
+++ b/core/src/main/java/org/apache/calcite/rel/hint/CompositeHintPredicate.java
@@ -44,7 +44,7 @@ public class CompositeHintPredicate implements HintPredicate {
    *
    * <p>Make this constructor package-protected intentionally.
    * Use utility methods in {@link HintPredicates}
-   * to create a {@link CompositeHintPredicate}.</p>
+   * to create a {@link CompositeHintPredicate}.
    */
   CompositeHintPredicate(Composition composition, HintPredicate... predicates) {
     assert predicates != null;
diff --git a/core/src/main/java/org/apache/calcite/rel/logical/LogicalCalc.java b/core/src/main/java/org/apache/calcite/rel/logical/LogicalCalc.java
index 2ab47e5c2f..7d3bccf7fc 100644
--- a/core/src/main/java/org/apache/calcite/rel/logical/LogicalCalc.java
+++ b/core/src/main/java/org/apache/calcite/rel/logical/LogicalCalc.java
@@ -51,7 +51,7 @@ import java.util.Set;
  * stages of optimization, by merging consecutive {@link LogicalProject} and
  * {@link LogicalFilter} nodes together.
  *
- * <p>The following rules relate to <code>LogicalCalc</code>:</p>
+ * <p>The following rules relate to <code>LogicalCalc</code>:
  *
  * <ul>
  * <li>{@link FilterToCalcRule} creates this from a {@link LogicalFilter}
diff --git a/core/src/main/java/org/apache/calcite/rel/logical/LogicalCorrelate.java b/core/src/main/java/org/apache/calcite/rel/logical/LogicalCorrelate.java
index 2929f03208..5db859a141 100644
--- a/core/src/main/java/org/apache/calcite/rel/logical/LogicalCorrelate.java
+++ b/core/src/main/java/org/apache/calcite/rel/logical/LogicalCorrelate.java
@@ -53,6 +53,7 @@ public final class LogicalCorrelate extends Correlate {
 
   /**
    * Creates a LogicalCorrelate.
+   *
    * @param cluster      cluster this relational expression belongs to
    * @param left         left input relational expression
    * @param right        right input relational expression
diff --git a/core/src/main/java/org/apache/calcite/rel/logical/LogicalProject.java b/core/src/main/java/org/apache/calcite/rel/logical/LogicalProject.java
index 2cfe9e0b9c..c1db7f223b 100644
--- a/core/src/main/java/org/apache/calcite/rel/logical/LogicalProject.java
+++ b/core/src/main/java/org/apache/calcite/rel/logical/LogicalProject.java
@@ -122,6 +122,7 @@ public final class LogicalProject extends Project {
 
   /**
    * Creates a LogicalProject.
+   *
    * @deprecated Use {@link #create(RelNode, List, List, List, Set)} instead
    */
   @Deprecated // to be removed before 2.0
@@ -145,6 +146,7 @@ public final class LogicalProject extends Project {
 
   /**
    * Creates a LogicalProject, specifying row type rather than field names.
+   *
    * @deprecated Use {@link #create(RelNode, List, List, RelDataType, Set)} instead
    */
   @Deprecated // to be removed before 2.0
diff --git a/core/src/main/java/org/apache/calcite/rel/logical/LogicalTableScan.java b/core/src/main/java/org/apache/calcite/rel/logical/LogicalTableScan.java
index 07157d0197..7424c007b8 100644
--- a/core/src/main/java/org/apache/calcite/rel/logical/LogicalTableScan.java
+++ b/core/src/main/java/org/apache/calcite/rel/logical/LogicalTableScan.java
@@ -41,13 +41,13 @@ import java.util.List;
  * possible to read all of the rows unless some narrowing constraint is applied.
  *
  * <p>In the example of the <code>net.sf.saffron.ext.ReflectSchema</code>
- * schema,</p>
+ * schema,
  *
  * <blockquote>
  * <pre>select from fields</pre>
  * </blockquote>
  *
- * <p>cannot be implemented, but</p>
+ * <p>cannot be implemented, but
  *
  * <blockquote>
  * <pre>select from fields as f
@@ -55,7 +55,7 @@ import java.util.List;
  * </blockquote>
  *
  * <p>can. It is the optimizer's responsibility to find these ways, by applying
- * transformation rules.</p>
+ * transformation rules.
  */
 public final class LogicalTableScan extends TableScan {
   //~ Constructors -----------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/ChainedRelMetadataProvider.java b/core/src/main/java/org/apache/calcite/rel/metadata/ChainedRelMetadataProvider.java
index 5377b06bc6..acfc83bda1 100644
--- a/core/src/main/java/org/apache/calcite/rel/metadata/ChainedRelMetadataProvider.java
+++ b/core/src/main/java/org/apache/calcite/rel/metadata/ChainedRelMetadataProvider.java
@@ -39,7 +39,7 @@ import java.util.List;
  *
  * <p>When a consumer calls the {@link #apply} method to ask for a provider
  * for a particular type of {@link RelNode} and {@link Metadata}, scans the list
- * of underlying providers.</p>
+ * of underlying providers.
  */
 public class ChainedRelMetadataProvider implements RelMetadataProvider {
   //~ Instance fields --------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/Metadata.java b/core/src/main/java/org/apache/calcite/rel/metadata/Metadata.java
index af4767e2a7..cf7bb3e243 100644
--- a/core/src/main/java/org/apache/calcite/rel/metadata/Metadata.java
+++ b/core/src/main/java/org/apache/calcite/rel/metadata/Metadata.java
@@ -32,7 +32,7 @@ import org.apache.calcite.rel.RelNode;
  * <p>A {@code Metadata} instance already knows which particular {@code RelNode}
  * it is describing, so the methods do not pass in the {@code RelNode}. In fact,
  * quite a few metadata methods have no extra parameters. For instance, you can
- * get the row-count as follows:</p>
+ * get the row-count as follows:
  *
  * <blockquote><pre><code>
  * RelNode rel;
diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/MetadataFactory.java b/core/src/main/java/org/apache/calcite/rel/metadata/MetadataFactory.java
index b773e822c8..157d6a3e75 100644
--- a/core/src/main/java/org/apache/calcite/rel/metadata/MetadataFactory.java
+++ b/core/src/main/java/org/apache/calcite/rel/metadata/MetadataFactory.java
@@ -24,11 +24,11 @@ import org.checkerframework.checker.nullness.qual.Nullable;
  * Source of metadata about relational expressions.
  *
  * <p>The metadata is typically various kinds of statistics used to estimate
- * costs.</p>
+ * costs.
  *
  * <p>Each kind of metadata has an interface that extends {@link Metadata} and
  * has a method. Some examples: {@link BuiltInMetadata.Selectivity},
- * {@link BuiltInMetadata.ColumnUniqueness}.</p>
+ * {@link BuiltInMetadata.ColumnUniqueness}.
  */
 public interface MetadataFactory {
   /** Returns a metadata interface to get a particular kind of metadata
diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/MetadataFactoryImpl.java b/core/src/main/java/org/apache/calcite/rel/metadata/MetadataFactoryImpl.java
index c78d34a306..c0f725af29 100644
--- a/core/src/main/java/org/apache/calcite/rel/metadata/MetadataFactoryImpl.java
+++ b/core/src/main/java/org/apache/calcite/rel/metadata/MetadataFactoryImpl.java
@@ -35,7 +35,7 @@ import java.util.concurrent.ExecutionException;
  *
  * <p>The cache does not store metadata. It remembers which providers can
  * provide which kinds of metadata, for which kinds of relational
- * expressions.</p>
+ * expressions.
  *
  * @deprecated Use {@link RelMetadataQuery}.
  */
diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/MetadataHandlerProvider.java b/core/src/main/java/org/apache/calcite/rel/metadata/MetadataHandlerProvider.java
index c709f6dbfc..51dfa86fc6 100644
--- a/core/src/main/java/org/apache/calcite/rel/metadata/MetadataHandlerProvider.java
+++ b/core/src/main/java/org/apache/calcite/rel/metadata/MetadataHandlerProvider.java
@@ -28,6 +28,7 @@ public interface MetadataHandlerProvider {
 
   /**
    * Provide a handler for the requested metadata class.
+   *
    * @param handlerClass The handler interface expected
    * @param <MH> The metadata type the handler relates to.
    * @return The handler implementation.
diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/ProxyingMetadataHandlerProvider.java b/core/src/main/java/org/apache/calcite/rel/metadata/ProxyingMetadataHandlerProvider.java
index 9c84cbf323..ecba433ac4 100644
--- a/core/src/main/java/org/apache/calcite/rel/metadata/ProxyingMetadataHandlerProvider.java
+++ b/core/src/main/java/org/apache/calcite/rel/metadata/ProxyingMetadataHandlerProvider.java
@@ -44,6 +44,7 @@ public class ProxyingMetadataHandlerProvider implements MetadataHandlerProvider
 
   /**
    * Create a proxying handler provider.
+   *
    * @param provider The provider this will operate against.
    */
   public ProxyingMetadataHandlerProvider(RelMetadataProvider provider) {
diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/ReflectiveRelMetadataProvider.java b/core/src/main/java/org/apache/calcite/rel/metadata/ReflectiveRelMetadataProvider.java
index ab01fc2b2c..cb775d8380 100644
--- a/core/src/main/java/org/apache/calcite/rel/metadata/ReflectiveRelMetadataProvider.java
+++ b/core/src/main/java/org/apache/calcite/rel/metadata/ReflectiveRelMetadataProvider.java
@@ -56,7 +56,7 @@ import java.util.concurrent.ConcurrentMap;
  * the same signature as the implemented metadata method except for an
  * additional first parameter of type {@link RelNode} or a sub-class. That
  * parameter gives this provider an indication of that relational expressions it
- * can handle.</p>
+ * can handle.
  *
  * <p>For an example, see {@link RelMdColumnOrigins#SOURCE}.
  */
@@ -101,7 +101,7 @@ public class ReflectiveRelMetadataProvider
    *
    * <p>For example, {@link BuiltInMetadata.Selectivity} has a method
    * {@link BuiltInMetadata.Selectivity#getSelectivity(RexNode)}.
-   * A class</p>
+   * A class
    *
    * <blockquote><pre><code>
    * class RelMdSelectivity {
@@ -111,7 +111,7 @@ public class ReflectiveRelMetadataProvider
    *
    * <p>provides implementations of selectivity for relational expressions
    * that extend {@link org.apache.calcite.rel.core.Union}
-   * or {@link org.apache.calcite.rel.core.Filter}.</p>
+   * or {@link org.apache.calcite.rel.core.Filter}.
    */
   @Deprecated // to be removed before 2.0
   public static RelMetadataProvider reflectiveSource(Method method,
diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdCollation.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdCollation.java
index f68c54339a..815968d031 100644
--- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdCollation.java
+++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdCollation.java
@@ -457,6 +457,7 @@ public class RelMdCollation
    *
    * <p>If the inputs are sorted on other keys <em>in addition to</em> the join
    * key, the result preserves those collations too.
+   *
    * @deprecated Use {@link #mergeJoin(RelMetadataQuery, RelNode, RelNode, ImmutableIntList, ImmutableIntList, JoinRelType)} */
   @Deprecated // to be removed before 2.0
   public static @Nullable List<RelCollation> mergeJoin(RelMetadataQuery mq,
diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdExpressionLineage.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdExpressionLineage.java
index 16215e7c0b..1b34451111 100644
--- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdExpressionLineage.java
+++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdExpressionLineage.java
@@ -396,6 +396,7 @@ public class RelMdExpressionLineage
 
   /**
    * Expression lineage from Snapshot.
+   *
    * @param rel Snapshot relational expression
    * @param mq metadata query
    * @param outputExpression expression which needs to be inferred
diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdPredicates.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdPredicates.java
index 96a7b0d2cc..e1302639c2 100644
--- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdPredicates.java
+++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdPredicates.java
@@ -530,6 +530,7 @@ public class RelMdPredicates
    * Returns the
    * {@link BuiltInMetadata.Predicates#getPredicates()}
    * statistic.
+   *
    * @see RelMetadataQuery#getPulledUpPredicates(RelNode) */
   public RelOptPredicateList getPredicates(RelSubset r,
       RelMetadataQuery mq) {
diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdUtil.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdUtil.java
index 36b2c3ded1..696daa77db 100644
--- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdUtil.java
+++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdUtil.java
@@ -638,7 +638,7 @@ public class RelMdUtil {
     return numDistinctVals(population, mq.getRowCount(join));
   }
 
-  /** Add an epsilon to the value passed in. **/
+  /** Add an epsilon to the value passed in. */
   public static double addEpsilon(double d) {
     assert d >= 0d;
     final double d0 = d;
diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataProvider.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataProvider.java
index 57c0eb9bba..f9a4e5d1f8 100644
--- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataProvider.java
+++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataProvider.java
@@ -46,9 +46,9 @@ public interface RelMetadataProvider {
    * of relational expression.
    *
    * <p>The object returned is a function. It can be applied to a relational
-   * expression of the given type to create a metadata object.</p>
+   * expression of the given type to create a metadata object.
    *
-   * <p>For example, you might call</p>
+   * <p>For example, you might call
    *
    * <blockquote><pre>
    * RelMetadataProvider provider;
diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQuery.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQuery.java
index 63976f7b3f..b1ff4495e7 100644
--- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQuery.java
+++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQuery.java
@@ -118,6 +118,7 @@ public class RelMetadataQuery extends RelMetadataQueryBase {
 
   /**
    * Create a RelMetadataQuery with a given {@link MetadataHandlerProvider}.
+   *
    * @param provider The provider to use for construction.
    */
   public RelMetadataQuery(MetadataHandlerProvider provider) {
diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQueryBase.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQueryBase.java
index 8b936b318c..37a2e5a127 100644
--- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQueryBase.java
+++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQueryBase.java
@@ -125,6 +125,7 @@ public class RelMetadataQueryBase {
 
   /**
    * Provide a handler for the requested metadata class.
+   *
    * @param handlerClass The handler interface expected
    * @param <MH> The metadata type the handler relates to.
    * @return The handler implementation.
diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/janino/CacheGeneratorUtil.java b/core/src/main/java/org/apache/calcite/rel/metadata/janino/CacheGeneratorUtil.java
index 9a0aa8ca8d..262a7c7e23 100644
--- a/core/src/main/java/org/apache/calcite/rel/metadata/janino/CacheGeneratorUtil.java
+++ b/core/src/main/java/org/apache/calcite/rel/metadata/janino/CacheGeneratorUtil.java
@@ -160,15 +160,14 @@ class CacheGeneratorUtil {
    */
   private enum CacheKeyStrategy {
     /**
-     * Generates an immutable method key, then during each call instantiates a new list to all
-     * the arguments.
+     * Generates an immutable method key, then during each call instantiates a
+     * new list to all the arguments.
      *
-     * Example:
-     * <code>
-     *     private final Object method_key_0 =
-     *        new org.apache.calcite.rel.metadata.janino.DescriptiveCacheKey("...");
+     * <p>Example:
      *
-     *  ...
+     * <blockquote><pre>{@code
+     *   private final Object method_key_0 =
+     *       new org.apache.calcite.rel.metadata.janino.DescriptiveCacheKey("...");
      *
      *   public java.lang.Double getDistinctRowCount(
      *       org.apache.calcite.rel.RelNode r,
@@ -176,12 +175,14 @@ class CacheGeneratorUtil {
      *       org.apache.calcite.util.ImmutableBitSet a2,
      *       org.apache.calcite.rex.RexNode a3) {
      *     final Object key;
-     *     key = org.apache.calcite.runtime.FlatLists.of(method_key_0, org.apache.calcite.rel
-     * .metadata.NullSentinel.mask(a2), a3);
+     *     key = org.apache.calcite.runtime.FlatLists.of(method_key_0,
+     *         org.apache.calcite.rel.metadata.NullSentinel.mask(a2), a3);
      *     final Object v = mq.map.get(r, key);
      *     if (v != null) {
-     *      ...
-     * </code>
+     *       ...
+     *     }
+     *   }
+     * }</pre></blockquote>
      */
     DEFAULT {
       @Override void cacheProperties(StringBuilder buff, Method method, int methodIndex) {
@@ -315,17 +316,17 @@ class CacheGeneratorUtil {
       }
     },
     /**
-     * Generates 2 immutable keys for functions that only take a single boolean arg.
+     * Generates 2 immutable keys for functions that only take a single boolean
+     * arg.
      *
-     * Example:
-     * <code>
-     *  private final Object method_key_0True =
+     * <p>Example:
+     *
+     * <blockquote><pre>{@code
+     *   private final Object method_key_0True =
      *       new org.apache.calcite.rel.metadata.janino.DescriptiveCacheKey("...");
      *   private final Object method_key_0False =
      *       new org.apache.calcite.rel.metadata.janino.DescriptiveCacheKey("...");
      *
-     *   ...
-     *
      *   public java.util.Set getUniqueKeys(
      *       org.apache.calcite.rel.RelNode r,
      *       org.apache.calcite.rel.metadata.RelMetadataQuery mq,
@@ -334,7 +335,8 @@ class CacheGeneratorUtil {
      *     key = a2 ? method_key_0True : method_key_0False;
      *     final Object v = mq.map.get(r, key);
      *     ...
-     * </code>
+     *   }
+     * }</pre></blockquote>
      */
     BOOLEAN_ARG {
       @Override void cacheKeyBlock(StringBuilder buff, Method method, int methodIndex) {
diff --git a/core/src/main/java/org/apache/calcite/rel/mutable/MutableRel.java b/core/src/main/java/org/apache/calcite/rel/mutable/MutableRel.java
index f61eb52e16..1bbb849b82 100644
--- a/core/src/main/java/org/apache/calcite/rel/mutable/MutableRel.java
+++ b/core/src/main/java/org/apache/calcite/rel/mutable/MutableRel.java
@@ -39,7 +39,7 @@ import java.util.Objects;
  * than their {@code RelNode} counterparts.
  * But, you don't need to copy a {@code MutableRel} in order to change it.
  * For this reason, you should use {@code MutableRel} for short-lived
- * operations, and transcribe back to {@code RelNode} when you are done.</p>
+ * operations, and transcribe back to {@code RelNode} when you are done.
  */
 public abstract class MutableRel {
 
diff --git a/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java b/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java
index 1f5fa0fca0..f04a5a11cf 100644
--- a/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java
+++ b/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java
@@ -532,7 +532,7 @@ public abstract class SqlImplementor {
   }
 
   /** Wraps a node in a SELECT statement that has no clauses:
-   *  "SELECT ... FROM (node)". */
+   * "SELECT ... FROM (node)". */
   SqlSelect wrapSelect(SqlNode node) {
     assert node instanceof SqlJoin
         || node instanceof SqlIdentifier
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/AbstractJoinExtractFilterRule.java b/core/src/main/java/org/apache/calcite/rel/rules/AbstractJoinExtractFilterRule.java
index 93bc014afa..ad3c3a6a8a 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/AbstractJoinExtractFilterRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/AbstractJoinExtractFilterRule.java
@@ -34,7 +34,7 @@ import org.apache.calcite.tools.RelBuilder;
  * the <code>FennelCartesianJoinRule</code> applicable.
  *
  * <p>The constructor is parameterized to allow any sub-class of
- * {@link org.apache.calcite.rel.core.Join}.</p>
+ * {@link org.apache.calcite.rel.core.Join}.
  */
 public abstract class AbstractJoinExtractFilterRule
     extends RelRule<AbstractJoinExtractFilterRule.Config>
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/AggregateJoinRemoveRule.java b/core/src/main/java/org/apache/calcite/rel/rules/AggregateJoinRemoveRule.java
index 2440cfbb75..f4c6c4b97c 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/AggregateJoinRemoveRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/AggregateJoinRemoveRule.java
@@ -45,7 +45,7 @@ import java.util.Set;
  * provided that the join is a left join or right join and it computes no
  * aggregate functions or all the aggregate calls have distinct.
  *
- * <p>For instance,</p>
+ * <p>For instance,
  *
  * <blockquote>
  * <pre>select distinct s.product_id from
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/CoreRules.java b/core/src/main/java/org/apache/calcite/rel/rules/CoreRules.java
index 074bb4f635..54ad1ae8cd 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/CoreRules.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/CoreRules.java
@@ -417,7 +417,7 @@ public class CoreRules {
       SubQueryRemoveRule.Config.JOIN.toRule();
 
   /** Rule that transforms a {@link Project}
-   *  into a mixture of {@code LogicalProject}
+   * into a mixture of {@code LogicalProject}
    * and {@link LogicalWindow}. */
   public static final ProjectToWindowRule.ProjectToLogicalProjectAndWindowRule
       PROJECT_TO_LOGICAL_PROJECT_AND_WINDOW =
@@ -471,7 +471,7 @@ public class CoreRules {
       ProjectMultiJoinMergeRule.Config.DEFAULT.toRule();
 
   /** Rule that, given a {@link Project} node that merely returns its input,
-   *  converts the node into its input. */
+   * converts the node into its input. */
   public static final ProjectRemoveRule PROJECT_REMOVE =
       ProjectRemoveRule.Config.DEFAULT.toRule();
 
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/FilterFlattenCorrelatedConditionRule.java b/core/src/main/java/org/apache/calcite/rel/rules/FilterFlattenCorrelatedConditionRule.java
index d625fd32ad..391ac86e7b 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/FilterFlattenCorrelatedConditionRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/FilterFlattenCorrelatedConditionRule.java
@@ -33,21 +33,24 @@ import java.util.ArrayList;
 import java.util.List;
 
 /**
- * Planner rule that matches a {@link Filter} expression with correlated variables, and rewrites the
- * condition in a simpler form that is more convenient for the decorrelation logic.
+ * Planner rule that matches a {@link Filter} expression with correlated
+ * variables, and rewrites the condition in a simpler form that is more
+ * convenient for the decorrelation logic.
  *
- * <p>Uncorrelated calls below a comparison operator are turned into input references by extracting
- * the computation in a {@link org.apache.calcite.rel.core.Project} expression. An additional
- * projection may be added on top of the new filter to retain expression equivalence.</p>
+ * <p>Uncorrelated calls below a comparison operator are turned into input
+ * references by extracting the computation in a
+ * {@link org.apache.calcite.rel.core.Project} expression. An additional
+ * projection may be added on top of the new filter to retain expression
+ * equivalence.
  *
- * <p>Sub-plan before</p>
+ * <p>Sub-plan before
  * <pre>
  * LogicalProject($f0=[true])
  *   LogicalFilter(condition=[=($cor0.DEPTNO, +($7, 30))])
  *     LogicalTableScan(table=[[CATALOG, SALES, EMP]])
  * </pre>
  *
- * <p>Sub-plan after</p>
+ * <p>Sub-plan after
  * <pre>
  * LogicalProject($f0=[true])
  *   LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2],..., COMM=[$6], DEPTNO=[$7], SLACKER=[$8])
@@ -56,10 +59,11 @@ import java.util.List;
  *         LogicalTableScan(table=[[CATALOG, SALES, EMP]])
  * </pre>
  *
- * <p>The rule should be used in conjunction with other rules and transformations to have a positive
- * impact on the plan. At the moment it is tightly connected with the decorrelation logic and may
- * not be useful in a broader context. Projects may implement decorrelation differently so they may
- * choose to use this rule or not.</p>
+ * <p>The rule should be used in conjunction with other rules and
+ * transformations to have a positive impact on the plan. At the moment it is
+ * tightly connected with the decorrelation logic and may not be useful in a
+ * broader context. Projects may implement decorrelation differently so they may
+ * choose to use this rule or not.
  */
 @API(since = "1.27", status = API.Status.EXPERIMENTAL)
 @Value.Enclosing
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/FilterJoinRule.java b/core/src/main/java/org/apache/calcite/rel/rules/FilterJoinRule.java
index b66c0cd484..f9b64bc1ce 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/FilterJoinRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/FilterJoinRule.java
@@ -237,7 +237,7 @@ public abstract class FilterJoinRule<C extends FilterJoinRule.Config>
   /**
    * Infers more equal conditions for the join condition.
    *
-   * <p> For example, in {@code SELECT * FROM T1, T2, T3 WHERE T1.id = T3.id AND T2.id = T3.id},
+   * <p>For example, in {@code SELECT * FROM T1, T2, T3 WHERE T1.id = T3.id AND T2.id = T3.id},
    * we can infer {@code T1.id = T2.id} for the first Join node from second Join node's condition:
    * {@code T1.id = T3.id AND T2.id = T3.id}.
    *
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/IntersectToDistinctRule.java b/core/src/main/java/org/apache/calcite/rel/rules/IntersectToDistinctRule.java
index ab6b6fb03c..35d359bd8b 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/IntersectToDistinctRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/IntersectToDistinctRule.java
@@ -40,7 +40,7 @@ import java.math.BigDecimal;
  * {@link org.apache.calcite.rel.core.Union},
  * {@link org.apache.calcite.rel.core.Aggregate}, etc.
  *
- * <p> Rewrite: (GB-Union All-GB)-GB-UDTF (on all attributes)
+ * <p>Rewrite: (GB-Union All-GB)-GB-UDTF (on all attributes)
  *
  * <h2>Example</h2>
  *
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/JoinAssociateRule.java b/core/src/main/java/org/apache/calcite/rel/rules/JoinAssociateRule.java
index 66b18c4a4f..3730406991 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/JoinAssociateRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/JoinAssociateRule.java
@@ -38,7 +38,7 @@ import java.util.List;
 /**
  * Planner rule that changes a join based on the associativity rule.
  *
- * <p>((a JOIN b) JOIN c) &rarr; (a JOIN (b JOIN c))</p>
+ * <p>((a JOIN b) JOIN c) &rarr; (a JOIN (b JOIN c))
  *
  * <p>We do not need a rule to convert (a JOIN (b JOIN c)) &rarr;
  * ((a JOIN b) JOIN c) because we have
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/JoinCommuteRule.java b/core/src/main/java/org/apache/calcite/rel/rules/JoinCommuteRule.java
index 541c31f955..f95d4b122e 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/JoinCommuteRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/JoinCommuteRule.java
@@ -189,7 +189,7 @@ public class JoinCommuteRule
    * <p>If the field index is less than leftFieldCount, it must be from the
    * left, and so has rightFieldCount added to it; if the field index is
    * greater than leftFieldCount, it must be from the right, so we subtract
-   * leftFieldCount from it.</p>
+   * leftFieldCount from it.
    */
   private static class VariableReplacer extends RexShuttle {
     private final RexBuilder rexBuilder;
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/JoinPushThroughJoinRule.java b/core/src/main/java/org/apache/calcite/rel/rules/JoinPushThroughJoinRule.java
index be1ad08f09..c020bffbb7 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/JoinPushThroughJoinRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/JoinPushThroughJoinRule.java
@@ -61,7 +61,7 @@ import java.util.List;
  * on p.product_class_id = pc.product_class_id</pre></blockquote>
  *
  * <p>Before the rule, one join has two conditions and the other has none
- * ({@code ON TRUE}). After the rule, each join has one condition.</p>
+ * ({@code ON TRUE}). After the rule, each join has one condition.
  */
 @Value.Enclosing
 public class JoinPushThroughJoinRule
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/JoinToCorrelateRule.java b/core/src/main/java/org/apache/calcite/rel/rules/JoinToCorrelateRule.java
index 296433e356..49c2428996 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/JoinToCorrelateRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/JoinToCorrelateRule.java
@@ -41,16 +41,16 @@ import org.immutables.value.Value;
  * into a {@link org.apache.calcite.rel.logical.LogicalCorrelate}, which can
  * then be implemented using nested loops.
  *
- * <p>For example,</p>
+ * <p>For example,
  *
  * <blockquote><code>select * from emp join dept on emp.deptno =
  * dept.deptno</code></blockquote>
  *
  * <p>becomes a Correlator which restarts LogicalTableScan("DEPT") for each
- * row read from LogicalTableScan("EMP").</p>
+ * row read from LogicalTableScan("EMP").
  *
  * <p>This rule is not applicable if for certain types of outer join. For
- * example,</p>
+ * example,
  *
  * <blockquote><code>select * from emp right join dept on emp.deptno =
  * dept.deptno</code></blockquote>
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/JoinToMultiJoinRule.java b/core/src/main/java/org/apache/calcite/rel/rules/JoinToMultiJoinRule.java
index 4504e0ceab..c07b8ea302 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/JoinToMultiJoinRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/JoinToMultiJoinRule.java
@@ -101,7 +101,7 @@ import static java.util.Objects.requireNonNull;
  *
  * <p>The constructor is parameterized to allow any sub-class of
  * {@link org.apache.calcite.rel.core.Join}, not just
- * {@link org.apache.calcite.rel.logical.LogicalJoin}.</p>
+ * {@link org.apache.calcite.rel.logical.LogicalJoin}.
  *
  * @see org.apache.calcite.rel.rules.FilterMultiJoinMergeRule
  * @see org.apache.calcite.rel.rules.ProjectMultiJoinMergeRule
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/MultiJoinOptimizeBushyRule.java b/core/src/main/java/org/apache/calcite/rel/rules/MultiJoinOptimizeBushyRule.java
index ab2044ecd6..755df10ab2 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/MultiJoinOptimizeBushyRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/MultiJoinOptimizeBushyRule.java
@@ -320,9 +320,9 @@ public class MultiJoinOptimizeBushyRule
   /** Returns the index within a list at which compares least according to a
    * comparator.
    *
-   * <p>In the case of a tie, returns the earliest such element.</p>
+   * <p>In the case of a tie, returns the earliest such element.
    *
-   * <p>If the list is empty, returns -1.</p>
+   * <p>If the list is empty, returns -1.
    */
   static <E> int minPos(List<E> list, Comparator<E> fn) {
     if (list.isEmpty()) {
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/MultiJoinProjectTransposeRule.java b/core/src/main/java/org/apache/calcite/rel/rules/MultiJoinProjectTransposeRule.java
index 4a27b65be3..832b522ced 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/MultiJoinProjectTransposeRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/MultiJoinProjectTransposeRule.java
@@ -43,9 +43,10 @@ import org.immutables.value.Value;
  *
  * <p>For example, if we have the following sub-query:
  *
- * <blockquote><pre>
- * (select X.x1, Y.y1 from X, Y
- *  where X.x2 = Y.y2 and X.x3 = 1 and Y.y3 = 2)</pre></blockquote>
+ * <blockquote><pre>{@code
+ *   (select X.x1, Y.y1
+ *    from X, Y
+ *    where X.x2 = Y.y2 and X.x3 = 1 and Y.y3 = 2)}</pre></blockquote>
  *
  * <p>The {@link MultiJoin} associated with (X, Y) associates x1 with X and
  * y1 with Y. Although x3 and y3 need to be read due to the filters, they are
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/ProjectJoinJoinRemoveRule.java b/core/src/main/java/org/apache/calcite/rel/rules/ProjectJoinJoinRemoveRule.java
index e59641ff06..f88f54a17b 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/ProjectJoinJoinRemoveRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/ProjectJoinJoinRemoveRule.java
@@ -43,7 +43,7 @@ import java.util.stream.Collectors;
  * on a {@link org.apache.calcite.rel.core.Join} and removes the left input
  * of the join provided that the left input is also a left join if possible.
  *
- * <p>For instance,</p>
+ * <p>For instance,
  *
  * <blockquote>
  * <pre>select s.product_id, pc.product_id
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/ProjectRemoveRule.java b/core/src/main/java/org/apache/calcite/rel/rules/ProjectRemoveRule.java
index b298f4a48c..551cae2086 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/ProjectRemoveRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/ProjectRemoveRule.java
@@ -31,7 +31,7 @@ import org.immutables.value.Value;
  * merely returns its input, converts the node into its child.
  *
  * <p>For example, <code>Project(ArrayReader(a), {$input0})</code> becomes
- * <code>ArrayReader(a)</code>.</p>
+ * <code>ArrayReader(a)</code>.
  *
  * @see CalcRemoveRule
  * @see ProjectMergeRule
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/PruneEmptyRules.java b/core/src/main/java/org/apache/calcite/rel/rules/PruneEmptyRules.java
index b32d6525fe..ff208a9ccd 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/PruneEmptyRules.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/PruneEmptyRules.java
@@ -262,6 +262,7 @@ public abstract class PruneEmptyRules {
 
   /**
    * Rule that converts a {@link Correlate} to empty if its right child is empty.
+   *
    * <p>Examples:
    * <ul>
    * <li>Correlate(Scan(Emp), Empty, INNER) becomes Empty</li>
@@ -282,16 +283,19 @@ public abstract class PruneEmptyRules {
 
   /**
    * Rule that converts a relation into empty.
-   * <p>
-   * The users can control the application of the rule by:</p>
+   *
+   * <p>The users can control the application of the rule by:
+   *
    * <ul>
-   *   <li>calling the appropriate constructor and passing the necessary configuration;</li>
-   *   <li>extending the class through inheritance and overriding
-   *   {@link RemoveEmptySingleRule#matches(RelOptRuleCall)}).</li>
+   * <li>calling the appropriate constructor and passing the necessary
+   * configuration;
+   *
+   * <li>extending the class through inheritance and overriding
+   * {@link RemoveEmptySingleRule#matches(RelOptRuleCall)}).
    * </ul>
    *
-   * <p>When using the deprecated constructors it is only possible to convert relations
-   * which strictly have a single input ({@link SingleRel}).</p>*/
+   * <p>When using the deprecated constructors it is only possible to convert
+   * relations which strictly have a single input ({@link SingleRel}). */
   public static class RemoveEmptySingleRule extends PruneEmptyRule {
     /** Creates a RemoveEmptySingleRule. */
     RemoveEmptySingleRule(PruneEmptyRule.Config config) {
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/PushProjector.java b/core/src/main/java/org/apache/calcite/rel/rules/PushProjector.java
index 6ac717d7a6..d3717d6cb6 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/PushProjector.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/PushProjector.java
@@ -68,7 +68,7 @@ import static java.util.Objects.requireNonNull;
  * <p>Sometimes an expression needs to be split before it can be pushed down.
  * To flag that an expression cannot be split, specify a rule that it must be
  * <dfn>preserved</dfn>. Such an expression will be pushed down intact to one
- * of the inputs, or not pushed down at all.</p>
+ * of the inputs, or not pushed down at all.
  */
 public class PushProjector {
   //~ Instance fields --------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/SubstitutionRule.java b/core/src/main/java/org/apache/calcite/rel/rules/SubstitutionRule.java
index 6f720fa8bd..edc3e764ae 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/SubstitutionRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/SubstitutionRule.java
@@ -29,7 +29,7 @@ public interface SubstitutionRule extends TransformationRule {
    * there is at least 1 equivalent rel generated by the rule.
    *
    * <p>Default is false, the user needs to prune the old node
-   * manually in the rule.</p>
+   * manually in the rule.
    */
   default boolean autoPruneOld() {
     return false;
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/TransformationRule.java b/core/src/main/java/org/apache/calcite/rel/rules/TransformationRule.java
index e5095be2f6..df35febca8 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/TransformationRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/TransformationRule.java
@@ -31,7 +31,7 @@ import org.apache.calcite.rel.PhysicalNode;
  * <p>But in {@link VolcanoPlanner}, {@link TransformationRule} doesn't match
  * with physical operator that implements {@link PhysicalNode}. It is not
  * allowed to generate physical operators in {@link TransformationRule},
- * unless you are using it in {@link HepPlanner}.</p>
+ * unless you are using it in {@link HepPlanner}.
  *
  * @see VolcanoPlanner
  * @see SubstitutionRule
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/ValuesReduceRule.java b/core/src/main/java/org/apache/calcite/rel/rules/ValuesReduceRule.java
index eedc22b524..488e10fe9c 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/ValuesReduceRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/ValuesReduceRule.java
@@ -54,12 +54,12 @@ import static java.util.Objects.requireNonNull;
  * <p>Returns a simplified {@code Values}, perhaps containing zero tuples
  * if all rows are filtered away.
  *
- * <p>For example,</p>
+ * <p>For example,
  *
  * <blockquote><code>select a - b from (values (1, 2), (3, 5), (7, 11)) as t (a,
  * b) where a + b &gt; 4</code></blockquote>
  *
- * <p>becomes</p>
+ * <p>becomes
  *
  * <blockquote><code>select x from (values (-2), (-4))</code></blockquote>
  *
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/materialize/MaterializedViewRule.java b/core/src/main/java/org/apache/calcite/rel/rules/materialize/MaterializedViewRule.java
index e2aa969c4a..4a7f101e23 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/materialize/MaterializedViewRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/materialize/MaterializedViewRule.java
@@ -506,6 +506,7 @@ public abstract class MaterializedViewRule<C extends MaterializedViewRule.Config
    *
    * <p>Rules implementing the method should follow different approaches depending on the
    * operators they rewrite.
+   *
    * @return ViewPartialRewriting, or null if the rewrite can't be done
    */
   protected abstract @Nullable ViewPartialRewriting compensateViewPartial(
diff --git a/core/src/main/java/org/apache/calcite/rel/type/RelCrossType.java b/core/src/main/java/org/apache/calcite/rel/type/RelCrossType.java
index f39f2b6773..5423676b64 100644
--- a/core/src/main/java/org/apache/calcite/rel/type/RelCrossType.java
+++ b/core/src/main/java/org/apache/calcite/rel/type/RelCrossType.java
@@ -26,7 +26,7 @@ import java.util.List;
  * Type of the cartesian product of two or more sets of records.
  *
  * <p>Its fields are those of its constituent records, but unlike a
- * {@link RelRecordType}, those fields' names are not necessarily distinct.</p>
+ * {@link RelRecordType}, those fields' names are not necessarily distinct.
  */
 public class RelCrossType extends RelDataTypeImpl {
   //~ Instance fields --------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/rel/type/RelDataType.java b/core/src/main/java/org/apache/calcite/rel/type/RelDataType.java
index 60df7f16e7..437a2a0f85 100644
--- a/core/src/main/java/org/apache/calcite/rel/type/RelDataType.java
+++ b/core/src/main/java/org/apache/calcite/rel/type/RelDataType.java
@@ -92,7 +92,7 @@ public interface RelDataType {
   /**
    * Looks up a field by name.
    *
-   * <p>NOTE: Be careful choosing the value of {@code caseSensitive}:</p>
+   * <p>NOTE: Be careful choosing the value of {@code caseSensitive}:
    * <ul>
    * <li>If the field name was supplied by an end-user (e.g. as a column alias
    * in SQL), use your session's case-sensitivity setting.</li>
@@ -173,7 +173,7 @@ public interface RelDataType {
    * for an INTEGER type.
    *
    * <p>Returns {@link #PRECISION_NOT_SPECIFIED} (-1) if precision is not
-   * applicable for this type.</p>
+   * applicable for this type.
    *
    * @return number of decimal digits for exact numeric types; number of
    * decimal digits in mantissa for approximate numeric types; number of
diff --git a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactory.java b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactory.java
index cf24db0b1b..da1b3c399a 100644
--- a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactory.java
+++ b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactory.java
@@ -240,7 +240,7 @@ public interface RelDataTypeFactory {
   /**
    * Creates a SQL type that represents the "unknown" type.
    * It is only equal to itself, and is distinct from the NULL type.
-
+   *
    * @return unknown type
    */
   RelDataType createUnknownType();
diff --git a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactoryImpl.java b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactoryImpl.java
index bdf963f207..87a1e50452 100644
--- a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactoryImpl.java
+++ b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactoryImpl.java
@@ -443,7 +443,7 @@ public abstract class RelDataTypeFactoryImpl implements RelDataTypeFactory {
    *
    * <p>This approach allows us to use a cheap temporary key. A permanent
    * key is more expensive, because it must be immutable and not hold
-   * references into other data structures.</p>
+   * references into other data structures.
    */
   protected RelDataType canonize(final StructKind kind,
       final List<String> names,
diff --git a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeImpl.java b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeImpl.java
index 274a6b72c8..9891ee304a 100644
--- a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeImpl.java
+++ b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeImpl.java
@@ -47,7 +47,7 @@ import static java.util.Objects.requireNonNull;
  * {@link RelDataType}.
  *
  * <p>Identity is based upon the {@link #digest} field, which each derived class
- * should set during construction.</p>
+ * should set during construction.
  */
 public abstract class RelDataTypeImpl
     implements RelDataType, RelDataTypeFamily {
@@ -358,7 +358,7 @@ public abstract class RelDataTypeImpl
    * that will create a type {@code typeName}.
    *
    * <p>For example, {@code proto(SqlTypeName.DATE), false}
-   * will create {@code DATE NOT NULL}.</p>
+   * will create {@code DATE NOT NULL}.
    *
    * @param typeName Type name
    * @param nullable Whether nullable
@@ -377,7 +377,7 @@ public abstract class RelDataTypeImpl
    * that will create a type {@code typeName(precision)}.
    *
    * <p>For example, {@code proto(SqlTypeName.VARCHAR, 100, false)}
-   * will create {@code VARCHAR(100) NOT NULL}.</p>
+   * will create {@code VARCHAR(100) NOT NULL}.
    *
    * @param typeName Type name
    * @param precision Precision
@@ -397,7 +397,7 @@ public abstract class RelDataTypeImpl
    * that will create a type {@code typeName(precision, scale)}.
    *
    * <p>For example, {@code proto(SqlTypeName.DECIMAL, 7, 2, false)}
-   * will create {@code DECIMAL(7, 2) NOT NULL}.</p>
+   * will create {@code DECIMAL(7, 2) NOT NULL}.
    *
    * @param typeName Type name
    * @param precision Precision
diff --git a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypePrecedenceList.java b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypePrecedenceList.java
index 919a5fac67..867cc9318b 100644
--- a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypePrecedenceList.java
+++ b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypePrecedenceList.java
@@ -38,7 +38,7 @@ public interface RelDataTypePrecedenceList {
   /**
    * Compares the precedence of two types.
    *
-   * <p>The list must contain both types.</p>
+   * <p>The list must contain both types.
    *
    * @param type1 first type to compare
    * @param type2 second type to compare
diff --git a/core/src/main/java/org/apache/calcite/rel/type/RelRecordType.java b/core/src/main/java/org/apache/calcite/rel/type/RelRecordType.java
index 7fc4ebba26..cd94c8f09d 100644
--- a/core/src/main/java/org/apache/calcite/rel/type/RelRecordType.java
+++ b/core/src/main/java/org/apache/calcite/rel/type/RelRecordType.java
@@ -48,6 +48,7 @@ public class RelRecordType extends RelDataTypeImpl implements Serializable {
   /**
    * Creates a <code>RecordType</code>. This should only be called from a
    * factory method.
+   *
    * @param kind Name resolution policy
    * @param fields List of fields
    * @param nullable Whether this record type allows null values
diff --git a/core/src/main/java/org/apache/calcite/rex/RexBuilder.java b/core/src/main/java/org/apache/calcite/rex/RexBuilder.java
index df55de6b04..7efea7b94e 100644
--- a/core/src/main/java/org/apache/calcite/rex/RexBuilder.java
+++ b/core/src/main/java/org/apache/calcite/rex/RexBuilder.java
@@ -84,7 +84,7 @@ import static java.util.Objects.requireNonNull;
 /**
  * Factory for row expressions.
  *
- * <p>Some common literal values (NULL, TRUE, FALSE, 0, 1, '') are cached.</p>
+ * <p>Some common literal values (NULL, TRUE, FALSE, 0, 1, '') are cached.
  */
 public class RexBuilder {
   /**
@@ -180,7 +180,7 @@ public class RexBuilder {
    * SQL), use your session's case-sensitivity setting.
    * Only hard-code {@code true} if you are sure that the field name is
    * internally generated.
-   * Hard-coding {@code false} is almost certainly wrong.</p>
+   * Hard-coding {@code false} is almost certainly wrong.
    *
    * @param expr      Expression yielding a record
    * @param fieldName Name of field in record
@@ -261,7 +261,7 @@ public class RexBuilder {
    *
    * <p>If you already know the return type of the call, then
    * {@link #makeCall(org.apache.calcite.rel.type.RelDataType, org.apache.calcite.sql.SqlOperator, java.util.List)}
-   * is preferred.</p>
+   * is preferred.
    */
   public RexNode makeCall(
       SqlOperator op,
@@ -301,7 +301,7 @@ public class RexBuilder {
    * Creates a reference to an aggregate call, checking for repeated calls.
    *
    * <p>Argument types help to optimize for repeated aggregates.
-   * For instance count(42) is equivalent to count(*).</p>
+   * For instance count(42) is equivalent to count(*).
    *
    * @param aggCall aggregate call to be added
    * @param groupCount number of groups in the aggregate relation
@@ -1497,7 +1497,7 @@ public class RexBuilder {
   /**
    * Creates a literal of the default value for the given type.
    *
-   * <p>This value is:</p>
+   * <p>This value is:
    *
    * <ul>
    * <li>0 for numeric types;
diff --git a/core/src/main/java/org/apache/calcite/rex/RexCall.java b/core/src/main/java/org/apache/calcite/rex/RexCall.java
index 2526d7df5d..c2d7b332d3 100644
--- a/core/src/main/java/org/apache/calcite/rex/RexCall.java
+++ b/core/src/main/java/org/apache/calcite/rex/RexCall.java
@@ -50,7 +50,7 @@ import static java.util.Objects.requireNonNull;
  * <p>It's not often necessary to sub-class this class. The smarts should be in
  * the operator, rather than the call. Any extra information about the call can
  * often be encoded as extra arguments. (These don't need to be hidden, because
- * no one is going to be generating source code from this tree.)</p>
+ * no one is going to be generating source code from this tree.)
  */
 public class RexCall extends RexNode {
 
diff --git a/core/src/main/java/org/apache/calcite/rex/RexCorrelVariable.java b/core/src/main/java/org/apache/calcite/rex/RexCorrelVariable.java
index e7c056271a..101ca1c67b 100644
--- a/core/src/main/java/org/apache/calcite/rex/RexCorrelVariable.java
+++ b/core/src/main/java/org/apache/calcite/rex/RexCorrelVariable.java
@@ -29,7 +29,7 @@ import java.util.Objects;
  *
  * <p>Correlating variables are introduced when performing nested loop joins.
  * Each row is received from one side of the join, a correlating variable is
- * assigned a value, and the other side of the join is restarted.</p>
+ * assigned a value, and the other side of the join is restarted.
  */
 public class RexCorrelVariable extends RexVariable {
   public final CorrelationId id;
diff --git a/core/src/main/java/org/apache/calcite/rex/RexInputRef.java b/core/src/main/java/org/apache/calcite/rex/RexInputRef.java
index 788b44dc06..2c8e6530bb 100644
--- a/core/src/main/java/org/apache/calcite/rex/RexInputRef.java
+++ b/core/src/main/java/org/apache/calcite/rex/RexInputRef.java
@@ -29,14 +29,14 @@ import java.util.List;
  * Variable which references a field of an input relational expression.
  *
  * <p>Fields of the input are 0-based. If there is more than one input, they are
- * numbered consecutively. For example, if the inputs to a join are</p>
+ * numbered consecutively. For example, if the inputs to a join are
  *
  * <ul>
  * <li>Input #0: EMP(EMPNO, ENAME, DEPTNO) and</li>
  * <li>Input #1: DEPT(DEPTNO AS DEPTNO2, DNAME)</li>
  * </ul>
  *
- * <p>then the fields are:</p>
+ * <p>then the fields are:
  *
  * <ul>
  * <li>Field #0: EMPNO</li>
@@ -47,7 +47,7 @@ import java.util.List;
  * </ul>
  *
  * <p>So <code>RexInputRef(3, Integer)</code> is the correct reference for the
- * field DEPTNO2.</p>
+ * field DEPTNO2.
  */
 public class RexInputRef extends RexSlot {
   //~ Static fields/initializers ---------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/rex/RexLiteral.java b/core/src/main/java/org/apache/calcite/rex/RexLiteral.java
index 7c6bf04962..b5231b66b7 100644
--- a/core/src/main/java/org/apache/calcite/rex/RexLiteral.java
+++ b/core/src/main/java/org/apache/calcite/rex/RexLiteral.java
@@ -73,16 +73,16 @@ import static java.util.Objects.requireNonNull;
  * Constant value in a row-expression.
  *
  * <p>There are several methods for creating literals in {@link RexBuilder}:
- * {@link RexBuilder#makeLiteral(boolean)} and so forth.</p>
+ * {@link RexBuilder#makeLiteral(boolean)} and so forth.
  *
  * <p>How is the value stored? In that respect, the class is somewhat of a black
  * box. There is a {@link #getValue} method which returns the value as an
  * object, but the type of that value is implementation detail, and it is best
  * that your code does not depend upon that knowledge. It is better to use
  * task-oriented methods such as {@link #getValue2} and
- * {@link #toJavaString}.</p>
+ * {@link #toJavaString}.
  *
- * <p>The allowable types and combinations are:</p>
+ * <p>The allowable types and combinations are:
  *
  * <table>
  * <caption>Allowable types for RexLiteral instances</caption>
@@ -446,6 +446,7 @@ public class RexLiteral extends RexNode {
 
   /**
    * Computes if data type can be omitted from the digest.
+   *
    * <p>For instance, {@code 1:BIGINT} has to keep data type while {@code 1:INT}
    * should be represented as just {@code 1}.
    *
@@ -608,7 +609,7 @@ public class RexLiteral extends RexNode {
    * Appends the specified value in the provided destination as a Java string. The value must be
    * consistent with the type, as per {@link #valueMatchesType}.
    *
-   * <p>Typical return values:</p>
+   * <p>Typical return values:
    *
    * <ul>
    * <li>true</li>
diff --git a/core/src/main/java/org/apache/calcite/rex/RexNode.java b/core/src/main/java/org/apache/calcite/rex/RexNode.java
index a3a841fb78..9db8c867a5 100644
--- a/core/src/main/java/org/apache/calcite/rex/RexNode.java
+++ b/core/src/main/java/org/apache/calcite/rex/RexNode.java
@@ -36,9 +36,9 @@ import static java.util.Objects.requireNonNull;
  * <p>Some common row-expressions are: {@link RexLiteral} (constant value),
  * {@link RexVariable} (variable), {@link RexCall} (call to operator with
  * operands). Expressions are generally created using a {@link RexBuilder}
- * factory.</p>
+ * factory.
  *
- * <p>All sub-classes of RexNode are immutable.</p>
+ * <p>All sub-classes of RexNode are immutable.
  */
 public abstract class RexNode {
 
diff --git a/core/src/main/java/org/apache/calcite/rex/RexNormalize.java b/core/src/main/java/org/apache/calcite/rex/RexNormalize.java
index 713a1f7887..95ffc9fb63 100644
--- a/core/src/main/java/org/apache/calcite/rex/RexNormalize.java
+++ b/core/src/main/java/org/apache/calcite/rex/RexNormalize.java
@@ -154,7 +154,7 @@ public class RexNormalize {
     return x != 0 ? x : operand1.hashCode() - operand0.hashCode();
   }
 
-  /** Returns whether a call is symmetrical. **/
+  /** Returns whether a call is symmetrical. */
   private static boolean isSymmetricalCall(
       SqlOperator operator,
       RexNode operand0,
@@ -164,10 +164,9 @@ public class RexNormalize {
             && SqlTypeUtil.equalSansNullability(operand0.getType(), operand1.getType());
   }
 
-  /** Compute a hash that is symmetric in its arguments - that is a hash
-   *  where the order of appearance of elements does not matter.
-   *  This is useful for hashing symmetrical rex calls, for example.
-   */
+  /** Computes a hash that is symmetric in its arguments - that is, a hash
+   * where the order of appearance of elements does not matter.
+   * This is useful for hashing symmetrical rex calls, for example. */
   private static int unorderedHash(List<?> xs) {
     int a = 0;
     int b = 0;
diff --git a/core/src/main/java/org/apache/calcite/rex/RexProgram.java b/core/src/main/java/org/apache/calcite/rex/RexProgram.java
index d001e49f18..623475c1a1 100644
--- a/core/src/main/java/org/apache/calcite/rex/RexProgram.java
+++ b/core/src/main/java/org/apache/calcite/rex/RexProgram.java
@@ -109,7 +109,7 @@ public class RexProgram {
    * Creates a program.
    *
    * <p>The expressions must be valid: they must not contain common expressions,
-   * forward references, or non-trivial aggregates.</p>
+   * forward references, or non-trivial aggregates.
    *
    * @param inputRowType  Input row type
    * @param exprs         Common expressions
@@ -517,7 +517,7 @@ public class RexProgram {
    *
    * <p>Like {@link RexUtil#isNull(RexNode)}, null literals are null, and
    * casts of null literals are null. But this method also regards references
-   * to null expressions as null.</p>
+   * to null expressions as null.
    *
    * @param expr Expression
    * @return Whether expression always evaluates to null
diff --git a/core/src/main/java/org/apache/calcite/rex/RexProgramBuilder.java b/core/src/main/java/org/apache/calcite/rex/RexProgramBuilder.java
index e1a3bce3c6..99bd7551eb 100644
--- a/core/src/main/java/org/apache/calcite/rex/RexProgramBuilder.java
+++ b/core/src/main/java/org/apache/calcite/rex/RexProgramBuilder.java
@@ -269,7 +269,7 @@ public class RexProgramBuilder {
    * Sets the condition of the program.
    *
    * <p>The expression must be specified in terms of the input fields. If
-   * not, call {@link #registerOutput(RexNode)} first.</p>
+   * not, call {@link #registerOutput(RexNode)} first.
    */
   public void addCondition(RexNode expr) {
     assert expr != null;
@@ -294,9 +294,9 @@ public class RexProgramBuilder {
   /**
    * Registers an expression in the list of common sub-expressions, and
    * returns a reference to that expression.
-
+   *
    * <p>The expression must be expressed in terms of the <em>inputs</em> of
-   * this program.</p>
+   * this program.
    */
   public RexLocalRef registerInput(RexNode expr) {
     final RexShuttle shuttle = new RegisterInputShuttle(true);
@@ -739,7 +739,7 @@ public class RexProgramBuilder {
    *             6: ($2 = 6)  // c = 6
    * </pre></blockquote>
    *
-   * <p>Another example:</p>
+   * <p>Another example:
    *
    * <blockquote>
    * <pre>SELECT *
@@ -826,7 +826,7 @@ public class RexProgramBuilder {
   /**
    * Removes all project items.
    *
-   * <p>After calling this method, you may need to re-normalize.</p>
+   * <p>After calling this method, you may need to re-normalize.
    */
   public void clearProjects() {
     projectRefList.clear();
@@ -836,7 +836,7 @@ public class RexProgramBuilder {
   /**
    * Clears the condition.
    *
-   * <p>After calling this method, you may need to re-normalize.</p>
+   * <p>After calling this method, you may need to re-normalize.
    */
   public void clearCondition() {
     conditionRef = null;
diff --git a/core/src/main/java/org/apache/calcite/rex/RexRangeRef.java b/core/src/main/java/org/apache/calcite/rex/RexRangeRef.java
index 1cdb19e41f..1abac5d19a 100644
--- a/core/src/main/java/org/apache/calcite/rex/RexRangeRef.java
+++ b/core/src/main/java/org/apache/calcite/rex/RexRangeRef.java
@@ -29,16 +29,16 @@ import java.util.Objects;
  * {@link org.apache.calcite.sql.SqlNode SQL} tree to a
  * {@link org.apache.calcite.rel.RelNode rel}/{@link RexNode rex}
  * tree. <em>Regular {@link RexNode rex} trees do not contain this
- * construct.</em></p>
+ * construct.</em>
  *
  * <p>While translating a join of EMP(EMPNO, ENAME, DEPTNO) to DEPT(DEPTNO2,
  * DNAME) we create <code>RexRangeRef(DeptType,3)</code> to represent the pair
  * of columns (DEPTNO2, DNAME) which came from DEPT. The type has 2 columns, and
- * therefore the range represents columns {3, 4} of the input.</p>
+ * therefore the range represents columns {3, 4} of the input.
  *
  * <p>Suppose we later create a reference to the DNAME field of this
  * RexRangeRef; it will return a <code>{@link RexInputRef}(5,Integer)</code>,
- * and the {@link org.apache.calcite.rex.RexRangeRef} will disappear.</p>
+ * and the {@link org.apache.calcite.rex.RexRangeRef} will disappear.
  */
 public class RexRangeRef extends RexNode {
   //~ Instance fields --------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/rex/RexShuttle.java b/core/src/main/java/org/apache/calcite/rex/RexShuttle.java
index 718d361591..a300e9a8c7 100644
--- a/core/src/main/java/org/apache/calcite/rex/RexShuttle.java
+++ b/core/src/main/java/org/apache/calcite/rex/RexShuttle.java
@@ -33,7 +33,7 @@ import static java.util.Objects.requireNonNull;
  * <p>Like {@link RexVisitor}, this is an instance of the
  * {@link org.apache.calcite.util.Glossary#VISITOR_PATTERN Visitor Pattern}. Use
  * <code> RexShuttle</code> if you would like your methods to return a
- * value.</p>
+ * value.
  */
 public class RexShuttle implements RexVisitor<RexNode> {
   //~ Methods ----------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/rex/RexSimplify.java b/core/src/main/java/org/apache/calcite/rex/RexSimplify.java
index c95752b80c..b22ec3a77f 100644
--- a/core/src/main/java/org/apache/calcite/rex/RexSimplify.java
+++ b/core/src/main/java/org/apache/calcite/rex/RexSimplify.java
@@ -204,7 +204,7 @@ public class RexSimplify {
   /**
    * Simplifies a boolean expression.
    *
-   * <p>In particular:</p>
+   * <p>In particular:
    * <ul>
    * <li>{@code simplify(x = 1 OR NOT x = 1 OR x IS NULL)}
    * returns {@code TRUE}</li>
diff --git a/core/src/main/java/org/apache/calcite/rex/RexSubQuery.java b/core/src/main/java/org/apache/calcite/rex/RexSubQuery.java
index 3bb6f2892d..609a4a5a01 100644
--- a/core/src/main/java/org/apache/calcite/rex/RexSubQuery.java
+++ b/core/src/main/java/org/apache/calcite/rex/RexSubQuery.java
@@ -61,7 +61,7 @@ public class RexSubQuery extends RexCall {
    * If {@code comparison} is {@code >}
    * then {@code negated-comparison} is {@code <=}, and so forth.
    *
-   * <p>Also =SOME is rewritten into IN</p> */
+   * <p>Also =SOME is rewritten into IN */
   public static RexSubQuery some(RelNode rel, ImmutableList<RexNode> nodes,
       SqlQuantifyOperator op) {
     assert op.kind == SqlKind.SOME;
diff --git a/core/src/main/java/org/apache/calcite/rex/RexUnaryBiVisitor.java b/core/src/main/java/org/apache/calcite/rex/RexUnaryBiVisitor.java
index 7f4ca0ea66..227325d347 100644
--- a/core/src/main/java/org/apache/calcite/rex/RexUnaryBiVisitor.java
+++ b/core/src/main/java/org/apache/calcite/rex/RexUnaryBiVisitor.java
@@ -31,7 +31,7 @@ public class RexUnaryBiVisitor<@Nullable R> extends RexBiVisitorImpl<R, R> {
   }
 
   /** Called as the last action of, and providing the result for,
-   *  each {@code visitXxx} method; derived classes may override. */
+   * each {@code visitXxx} method; derived classes may override. */
   protected R end(RexNode e, R arg) {
     return arg;
   }
diff --git a/core/src/main/java/org/apache/calcite/rex/RexUtil.java b/core/src/main/java/org/apache/calcite/rex/RexUtil.java
index 1f4a99ff79..bc4d280e00 100644
--- a/core/src/main/java/org/apache/calcite/rex/RexUtil.java
+++ b/core/src/main/java/org/apache/calcite/rex/RexUtil.java
@@ -1603,7 +1603,7 @@ public class RexUtil {
    * would be considered "flat".
    *
    * <p>For example, {@code isFlat([w, AND[x, y], z, AND)} returns false;
-   * <p>{@code isFlat([w, x, y, z], AND)} returns true.</p>
+   * {@code isFlat([w, x, y, z], AND)} returns true.
    */
   private static boolean isFlat(
       List<? extends RexNode> exprs, final SqlOperator op) {
@@ -1645,6 +1645,7 @@ public class RexUtil {
    *
    * <p>The implementation of this method does not return false positives.
    * However, it is not complete.
+   *
    * @param node input node to verify if it represents a loss-less cast
    * @return true iff the node is a loss-less cast
    */
@@ -1666,6 +1667,7 @@ public class RexUtil {
    *
    * <p>The implementation of this method does not return false positives.
    * However, it is not complete.
+   *
    * @param source source type
    * @param target target type
    * @return true iff the conversion is a loss-less cast
@@ -1959,7 +1961,7 @@ public class RexUtil {
    * Simplifies a boolean expression,
    * using the default executor.
    *
-   * <p>In particular:</p>
+   * <p>In particular:
    * <ul>
    * <li>{@code simplify(x = 1 AND y = 2 AND NOT x = 1)}
    * returns {@code y = 2}</li>
diff --git a/core/src/main/java/org/apache/calcite/rex/RexWindowBound.java b/core/src/main/java/org/apache/calcite/rex/RexWindowBound.java
index 7ad7247a3f..e2d0d7fd2a 100644
--- a/core/src/main/java/org/apache/calcite/rex/RexWindowBound.java
+++ b/core/src/main/java/org/apache/calcite/rex/RexWindowBound.java
@@ -38,6 +38,7 @@ public abstract class RexWindowBound {
 
   /**
    * Returns if the bound is unbounded.
+   *
    * @return if the bound is unbounded
    */
   @Pure
@@ -49,6 +50,7 @@ public abstract class RexWindowBound {
 
   /**
    * Returns if the bound is PRECEDING.
+   *
    * @return if the bound is PRECEDING
    */
   public boolean isPreceding() {
@@ -57,6 +59,7 @@ public abstract class RexWindowBound {
 
   /**
    * Returns if the bound is FOLLOWING.
+   *
    * @return if the bound is FOLLOWING
    */
   public boolean isFollowing() {
@@ -65,6 +68,7 @@ public abstract class RexWindowBound {
 
   /**
    * Returns if the bound is CURRENT ROW.
+   *
    * @return if the bound is CURRENT ROW
    */
   @Pure
diff --git a/core/src/main/java/org/apache/calcite/rex/package-info.java b/core/src/main/java/org/apache/calcite/rex/package-info.java
index 7352cc51a8..57bd7f4c39 100644
--- a/core/src/main/java/org/apache/calcite/rex/package-info.java
+++ b/core/src/main/java/org/apache/calcite/rex/package-info.java
@@ -24,22 +24,22 @@
  * parse tree consisting of {@link org.apache.calcite.sql.SqlNode} objects into
  * a relational expression ({@link org.apache.calcite.rel.RelNode}). Several
  * kinds of nodes in this tree have row expressions
- * ({@link org.apache.calcite.rex.RexNode}).</p>
+ * ({@link org.apache.calcite.rex.RexNode}).
  *
  * <p>After the relational expression has been optimized, a
  * {@link org.apache.calcite.adapter.enumerable.JavaRelImplementor} converts it
  * into to a plan. If the plan is a Java parse tree, row-expressions are
- * translated into equivalent Java expressions.</p>
+ * translated into equivalent Java expressions.
  *
  * <h2>Expressions</h2>
  *
  *
  * <p>Every row-expression has a type. (Compare with
  * {@link org.apache.calcite.sql.SqlNode}, which is created before validation,
- * and therefore types may not be available.)</p>
+ * and therefore types may not be available.)
  *
  * <p>Every node in the parse tree is a {@link org.apache.calcite.rex.RexNode}.
- *     Sub-types are:</p>
+ *     Sub-types are:
  * <ul>
  *     <li>{@link org.apache.calcite.rex.RexLiteral} represents a boolean,
  *         numeric, string, or date constant, or the value <code>NULL</code>.
@@ -67,7 +67,7 @@
  * </ul>
  *
  * <p>Expressions are generally
- *     created using a {@link org.apache.calcite.rex.RexBuilder} factory.</p>
+ *     created using a {@link org.apache.calcite.rex.RexBuilder} factory.
  *
  * <h2>Related packages</h2>
  * <ul>
diff --git a/core/src/main/java/org/apache/calcite/runtime/BinarySearch.java b/core/src/main/java/org/apache/calcite/runtime/BinarySearch.java
index 0c1e2f71a1..536920c0ab 100644
--- a/core/src/main/java/org/apache/calcite/runtime/BinarySearch.java
+++ b/core/src/main/java/org/apache/calcite/runtime/BinarySearch.java
@@ -38,6 +38,7 @@ public class BinarySearch {
    * It is assumed that the array is sorted.
    * The method is guaranteed to return the minimal index of the element that is
    * greater or equal to the given key.
+   *
    * @param a array that holds the values
    * @param key element to look for
    * @param comparator comparator that compares keys
@@ -57,6 +58,7 @@ public class BinarySearch {
    * It is assumed that the array is sorted.
    * The method is guaranteed to return the maximal index of the element that is
    * less or equal to the given key.
+   *
    * @param a array that holds the values
    * @param key element to look for
    * @param comparator comparator that compares keys
@@ -77,6 +79,7 @@ public class BinarySearch {
    * It is assumed that the array is sorted.
    * The method is guaranteed to return the minimal index of the element that is
    * greater or equal to the given key.
+   *
    * @param a array that holds the values
    * @param key element to look for
    * @param keySelector function that transforms array contents to the type
@@ -100,6 +103,7 @@ public class BinarySearch {
    * It is assumed that the array is sorted.
    * The method is guaranteed to return the maximal index of the element that is
    * less or equal to the given key.
+   *
    * @param a array that holds the values
    * @param key element to look for
    * @param keySelector function that transforms array contents to the type
@@ -122,6 +126,7 @@ public class BinarySearch {
    * It is assumed that the array is sorted.
    * The method is guaranteed to return the minimal index of the element that is
    * greater or equal to the given key.
+   *
    * @param a array that holds the values
    * @param key element to look for
    * @param imin the minimal index (inclusive) to look for
@@ -144,6 +149,7 @@ public class BinarySearch {
    * It is assumed that the array is sorted.
    * The method is guaranteed to return the maximal index of the element that is
    * less or equal to the given key.
+   *
    * @param a array that holds the values
    * @param key element to look for
    * @param imin the minimal index (inclusive) to look for
diff --git a/core/src/main/java/org/apache/calcite/runtime/Hook.java b/core/src/main/java/org/apache/calcite/runtime/Hook.java
index 5909e4ce91..b76b94a4ef 100644
--- a/core/src/main/java/org/apache/calcite/runtime/Hook.java
+++ b/core/src/main/java/org/apache/calcite/runtime/Hook.java
@@ -34,7 +34,7 @@ import static org.apache.calcite.linq4j.Nullness.castNonNull;
  * Collection of hooks that can be set by observers and are executed at various
  * parts of the query preparation process.
  *
- * <p>For testing and debugging rather than for end-users.</p>
+ * <p>For testing and debugging rather than for end-users.
  */
 public enum Hook {
   /** Called to get the current time. Use this to return a predictable time
@@ -116,7 +116,7 @@ public enum Hook {
   /** Adds a handler for this Hook.
    *
    * <p>Returns a {@link Hook.Closeable} so that you can use the following
-   * try-finally pattern to prevent leaks:</p>
+   * try-finally pattern to prevent leaks:
    *
    * <blockquote><pre>
    *     final Hook.Closeable closeable = Hook.FOO.add(HANDLER);
@@ -126,6 +126,7 @@ public enum Hook {
    *         closeable.close();
    *     }</pre>
    * </blockquote>
+   *
    * @deprecated this installs a global hook (cross-thread), so it might have greater impact
    *     than expected. Use with caution. Prefer thread-local hooks.
    * @see #addThread(Consumer)
diff --git a/core/src/main/java/org/apache/calcite/runtime/Matcher.java b/core/src/main/java/org/apache/calcite/runtime/Matcher.java
index fd864b0eef..64668165e5 100644
--- a/core/src/main/java/org/apache/calcite/runtime/Matcher.java
+++ b/core/src/main/java/org/apache/calcite/runtime/Matcher.java
@@ -40,6 +40,7 @@ import java.util.stream.Collectors;
 
 /**
  * Workspace that partialMatches patterns against an automaton.
+ *
  * @param <E> Type of rows matched by this automaton
  */
 public class Matcher<E> {
diff --git a/core/src/main/java/org/apache/calcite/runtime/Resources.java b/core/src/main/java/org/apache/calcite/runtime/Resources.java
index 03bff3d54a..e6716533d9 100644
--- a/core/src/main/java/org/apache/calcite/runtime/Resources.java
+++ b/core/src/main/java/org/apache/calcite/runtime/Resources.java
@@ -124,10 +124,10 @@ public class Resources {
    * <p>Suppose that base = "com.example.MyResource" and the current locale is
    * "en_US". A method
    *
-   * <blockquote>
+   * <blockquote><pre><code>
    *     &#64;BaseMessage("Illegal binary string {0}")
    *     ExInst&lt;IllegalArgumentException&gt; illegalBinaryString(String a0);
-   * </blockquote>
+   * </code></pre></blockquote>
    *
    * <p>will look up a resource "IllegalBinaryString" from the resource file
    * "com/example/MyResource_en_US.properties", and substitute in the parameter
@@ -910,7 +910,7 @@ public class Resources {
    * the class is created, it loads a properties file with the same name as the
    * class.
    *
-   * <p> In the standard scheme (see {@link ResourceBundle}), if
+   * <p>In the standard scheme (see {@link ResourceBundle}), if
    * you call <code>{@link ResourceBundle#getBundle}("foo.MyResource")</code>,
    * it first looks for a class called <code>foo.MyResource</code>, then
    * looks for a file called <code>foo/MyResource.properties</code>. If it finds
@@ -919,15 +919,16 @@ public class Resources {
    * into a dedicated class; <code>ShadowResourceBundle</code> helps with this
    * case.
    *
-   * <p> You should create a class as follows:<blockquote>
+   * <p>You should create a class as follows:
    *
-   * <pre>package foo;
-   *class MyResource extends ShadowResourceBundle {
-   *    public MyResource() throws java.io.IOException {
-   *    }
-   *}</pre>
+   * <blockquote><pre><code>
+   * package foo;
    *
-   * </blockquote>
+   * class MyResource extends ShadowResourceBundle {
+   *   public MyResource() throws java.io.IOException {
+   *   }
+   * }
+   * </code></pre></blockquote>
    *
    * <p>Then when you call
    * {@link ResourceBundle#getBundle ResourceBundle.getBundle("foo.MyResource")},
@@ -1013,9 +1014,10 @@ public class Resources {
      * for the given locale.
      *
      * <p> This method should be called from a derived class, with the proper
-     * casting:<blockquote>
+     * casting:
      *
-     * <pre>class MyResource extends ShadowResourceBundle {
+     * <blockquote><pre><code>
+     * class MyResource extends ShadowResourceBundle {
      *    ...
      *
      *    /&#42;&#42;
@@ -1028,7 +1030,8 @@ public class Resources {
      *           ResourceBundle.getBundle(MyResource.class.getName(), locale));
      *    }
      *    ...
-     * }</pre></blockquote>
+     * }
+     * </code></pre></blockquote>
      *
      * @param baseName Base name
      * @param locale Locale
diff --git a/core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java b/core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java
index d9621c5c1b..8a5d633360 100644
--- a/core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java
+++ b/core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java
@@ -1039,7 +1039,7 @@ public class SqlFunctions {
   }
 
   /** SQL <code>&lt;gt;</code> operator applied to Object values (at least one
-   *  operand has ANY type, including String; neither may be null). */
+   * operand has ANY type, including String; neither may be null). */
   public static boolean neAny(Object b0, Object b1) {
     return !eqAny(b0, b1);
   }
diff --git a/core/src/main/java/org/apache/calcite/runtime/Unit.java b/core/src/main/java/org/apache/calcite/runtime/Unit.java
index 77d2847a91..babe434d6a 100644
--- a/core/src/main/java/org/apache/calcite/runtime/Unit.java
+++ b/core/src/main/java/org/apache/calcite/runtime/Unit.java
@@ -19,7 +19,7 @@ package org.apache.calcite.runtime;
 /**
  * Synthetic record with zero fields.
  *
- * <p>Since all instances are identical, {@code Unit} is a singleton.</p>
+ * <p>Since all instances are identical, {@code Unit} is a singleton.
  */
 public class Unit implements Comparable<Unit> {
   public static final Unit INSTANCE = new Unit();
diff --git a/core/src/main/java/org/apache/calcite/schema/CustomColumnResolvingTable.java b/core/src/main/java/org/apache/calcite/schema/CustomColumnResolvingTable.java
index 9ce0193c4d..adc1cbfa55 100644
--- a/core/src/main/java/org/apache/calcite/schema/CustomColumnResolvingTable.java
+++ b/core/src/main/java/org/apache/calcite/schema/CustomColumnResolvingTable.java
@@ -29,10 +29,10 @@ import java.util.List;
  *
  * <p>It is optional for a Table to implement this interface. If Table does
  * not implement this interface, column resolving will be performed in the
- * default way.</p>
+ * default way.
  *
  * <p><strong>NOTE: This class is experimental and subject to
- * change/removal without notice</strong>.</p>
+ * change/removal without notice</strong>.
  */
 public interface CustomColumnResolvingTable extends Table {
 
diff --git a/core/src/main/java/org/apache/calcite/schema/Function.java b/core/src/main/java/org/apache/calcite/schema/Function.java
index 8349056df8..8d9df7837e 100644
--- a/core/src/main/java/org/apache/calcite/schema/Function.java
+++ b/core/src/main/java/org/apache/calcite/schema/Function.java
@@ -23,11 +23,11 @@ import java.util.List;
  *
  * <p>The application may occur at compile time (for a macro) or at run time
  * (for a regular function). The result may be a relation, and so might any of
- * the parameters.</p>
+ * the parameters.
  *
  * <p>Functions are registered in a {@link Schema}, and may be queried by name
  * ({@link Schema#getFunctions(String)}) then overloads resolved based on
- * parameter types.</p>
+ * parameter types.
  *
  * @see TableMacro
  * @see ScalarFunction
diff --git a/core/src/main/java/org/apache/calcite/schema/FunctionParameter.java b/core/src/main/java/org/apache/calcite/schema/FunctionParameter.java
index f675399aa4..90498fa435 100644
--- a/core/src/main/java/org/apache/calcite/schema/FunctionParameter.java
+++ b/core/src/main/java/org/apache/calcite/schema/FunctionParameter.java
@@ -23,7 +23,7 @@ import org.apache.calcite.rel.type.RelDataTypeFactory;
  * Parameter to a {@link Function}.
  *
  * <p>NOTE: We'd have called it {@code Parameter} but the overlap with
- * {@link java.lang.reflect.Parameter} was too confusing.</p>
+ * {@link java.lang.reflect.Parameter} was too confusing.
  */
 public interface FunctionParameter {
   /**
diff --git a/core/src/main/java/org/apache/calcite/schema/ImplementableFunction.java b/core/src/main/java/org/apache/calcite/schema/ImplementableFunction.java
index 5f16cb8cec..fecfb85cd1 100644
--- a/core/src/main/java/org/apache/calcite/schema/ImplementableFunction.java
+++ b/core/src/main/java/org/apache/calcite/schema/ImplementableFunction.java
@@ -27,6 +27,7 @@ import org.apache.calcite.adapter.enumerable.CallImplementor;
 public interface ImplementableFunction extends Function {
   /**
    * Returns implementor that translates the function to linq4j expression.
+   *
    * @return implementor that translates the function to linq4j expression.
    */
   CallImplementor getImplementor();
diff --git a/core/src/main/java/org/apache/calcite/schema/Member.java b/core/src/main/java/org/apache/calcite/schema/Member.java
index 8e37a08842..b7f24e8af6 100644
--- a/core/src/main/java/org/apache/calcite/schema/Member.java
+++ b/core/src/main/java/org/apache/calcite/schema/Member.java
@@ -28,23 +28,23 @@ import java.util.List;
  *
  * <p>Several kinds of members crop up in real life. They all implement the
  * {@code Member} interface, but tend to be treated differently by the
- * back-end system if not by Calcite.</p>
+ * back-end system if not by Calcite.
  *
  * <p>A member that has zero arguments and a type that is a collection of
  * records is referred to as a <i>relation</i>. In schemas backed by a
- * relational database, tables and views will appear as relations.</p>
+ * relational database, tables and views will appear as relations.
  *
  * <p>A member that has one or more arguments and a type that is a collection
  * of records is referred to as a <i>parameterized relation</i>. Some relational
  * databases support these; for example, Oracle calls them "table
- * functions".</p>
+ * functions".
  *
  * <p>Members may be also more typical of programming-language functions:
- * they take zero or more arguments, and return a result of arbitrary type.</p>
+ * they take zero or more arguments, and return a result of arbitrary type.
  *
  * <p>From the above definitions, you can see that a member is a special
  * kind of function. This makes sense, because even though it has no
- * arguments, it is "evaluated" each time it is used in a query.</p>
+ * arguments, it is "evaluated" each time it is used in a query.
  */
 public interface Member {
   /**
diff --git a/core/src/main/java/org/apache/calcite/schema/ModifiableTable.java b/core/src/main/java/org/apache/calcite/schema/ModifiableTable.java
index 1037baf78a..3b49b54805 100644
--- a/core/src/main/java/org/apache/calcite/schema/ModifiableTable.java
+++ b/core/src/main/java/org/apache/calcite/schema/ModifiableTable.java
@@ -32,7 +32,7 @@ import java.util.List;
  * A table that can be modified.
  *
  * <p>NOTE: The current API is inefficient and experimental. It will change
- * without notice.</p>
+ * without notice.
  *
  * @see ModifiableView
  */
diff --git a/core/src/main/java/org/apache/calcite/schema/ModifiableView.java b/core/src/main/java/org/apache/calcite/schema/ModifiableView.java
index 44bfff61c9..9731cf3fa8 100644
--- a/core/src/main/java/org/apache/calcite/schema/ModifiableView.java
+++ b/core/src/main/java/org/apache/calcite/schema/ModifiableView.java
@@ -39,7 +39,7 @@ import org.apache.calcite.util.ImmutableIntList;
  * and column mapping is {@code [0, 2]}.
  *
  * <p>NOTE: The current API is inefficient and experimental. It will change
- * without notice.</p>
+ * without notice.
  */
 public interface ModifiableView extends Table {
   /** Returns a constraint that each candidate row must satisfy.
diff --git a/core/src/main/java/org/apache/calcite/schema/ProjectableFilterableTable.java b/core/src/main/java/org/apache/calcite/schema/ProjectableFilterableTable.java
index 366536312f..fa8fab08f3 100644
--- a/core/src/main/java/org/apache/calcite/schema/ProjectableFilterableTable.java
+++ b/core/src/main/java/org/apache/calcite/schema/ProjectableFilterableTable.java
@@ -30,7 +30,7 @@ import java.util.List;
  * without creating an intermediate relational expression.
  *
  * <p>If you wish to write a table that can apply projects but not filters,
- * simply decline all filters.</p>
+ * simply decline all filters.
  *
  * @see ScannableTable
  * @see FilterableTable
@@ -47,7 +47,7 @@ public interface ProjectableFilterableTable extends Table {
    * Any filters remaining will be implemented by the consuming Calcite
    * operator.
    *
-   * <p>The projects are zero-based.</p>
+   * <p>The projects are zero-based.
    *
    * @param root Execution context
    * @param filters Mutable list of filters. The method should keep in the
diff --git a/core/src/main/java/org/apache/calcite/schema/Schema.java b/core/src/main/java/org/apache/calcite/schema/Schema.java
index fa5994379d..5e034b1da9 100644
--- a/core/src/main/java/org/apache/calcite/schema/Schema.java
+++ b/core/src/main/java/org/apache/calcite/schema/Schema.java
@@ -30,30 +30,30 @@ import java.util.Set;
  * <p>A schema can also contain sub-schemas, to any level of nesting. Most
  * providers have a limited number of levels; for example, most JDBC databases
  * have either one level ("schemas") or two levels ("database" and
- * "catalog").</p>
+ * "catalog").
  *
  * <p>There may be multiple overloaded functions with the same name but
  * different numbers or types of parameters.
  * For this reason, {@link #getFunctions} returns a list of all
  * members with the same name. Calcite will call
  * {@link Schemas#resolve(org.apache.calcite.rel.type.RelDataTypeFactory, String, java.util.Collection, java.util.List)}
- * to choose the appropriate one.</p>
+ * to choose the appropriate one.
  *
  * <p>The most common and important type of member is the one with no
  * arguments and a result type that is a collection of records. This is called a
  * <dfn>relation</dfn>. It is equivalent to a table in a relational
- * database.</p>
+ * database.
  *
- * <p>For example, the query</p>
+ * <p>For example, the query
  *
  * <blockquote>select * from sales.emps</blockquote>
  *
  * <p>is valid if "sales" is a registered
  * schema and "emps" is a member with zero parameters and a result type
- * of <code>Collection(Record(int: "empno", String: "name"))</code>.</p>
+ * of <code>Collection(Record(int: "empno", String: "name"))</code>.
  *
  * <p>A schema may be nested within another schema; see
- * {@link Schema#getSubSchema(String)}.</p>
+ * {@link Schema#getSubSchema(String)}.
  */
 public interface Schema {
   /**
diff --git a/core/src/main/java/org/apache/calcite/schema/SchemaVersion.java b/core/src/main/java/org/apache/calcite/schema/SchemaVersion.java
index 49eb5c9d43..b1985ea84d 100644
--- a/core/src/main/java/org/apache/calcite/schema/SchemaVersion.java
+++ b/core/src/main/java/org/apache/calcite/schema/SchemaVersion.java
@@ -34,6 +34,7 @@ public interface SchemaVersion {
 
   /**
    * Returns if this Version happens before the other Version.
+   *
    * @param other the other Version object
    */
   boolean isBefore(SchemaVersion other);
diff --git a/core/src/main/java/org/apache/calcite/schema/Statistic.java b/core/src/main/java/org/apache/calcite/schema/Statistic.java
index 2e4307f68f..7d494f2835 100644
--- a/core/src/main/java/org/apache/calcite/schema/Statistic.java
+++ b/core/src/main/java/org/apache/calcite/schema/Statistic.java
@@ -28,7 +28,7 @@ import java.util.List;
 /**
  * Statistics about a {@link Table}.
  *
- * <p>Each of the methods may return {@code null} meaning "not known".</p>
+ * <p>Each of the methods may return {@code null} meaning "not known".
  *
  * @see Statistics
  */
diff --git a/core/src/main/java/org/apache/calcite/schema/Table.java b/core/src/main/java/org/apache/calcite/schema/Table.java
index d8d53d8e16..bd422ff027 100644
--- a/core/src/main/java/org/apache/calcite/schema/Table.java
+++ b/core/src/main/java/org/apache/calcite/schema/Table.java
@@ -31,13 +31,13 @@ import org.checkerframework.checker.nullness.qual.Nullable;
  * user-defined schema in order to validate names appearing in a SQL query.
  * Calcite finds the schema by calling {@link Schema#getSubSchema(String)} on
  * the connection's root schema, then gets a table by calling
- * {@link Schema#getTable(String)}.</p>
+ * {@link Schema#getTable(String)}.
  *
  * <p>Note that a table does not know its name. It is in fact possible for
  * a table to be used more than once, perhaps under multiple names or under
  * multiple schemas. (Compare with the
  * <a href="http://en.wikipedia.org/wiki/Inode">i-node</a> concept in the UNIX
- * filesystem.)</p>
+ * filesystem.)
  *
  * <p>A particular table instance may also implement {@link Wrapper},
  * to give access to sub-objects.
@@ -48,11 +48,11 @@ public interface Table {
   /** Returns this table's row type.
    *
    * <p>This is a struct type whose
-   * fields describe the names and types of the columns in this table.</p>
+   * fields describe the names and types of the columns in this table.
    *
    * <p>The implementer must use the type factory provided. This ensures that
    * the type is converted into a canonical form; other equal types in the same
-   * query will use the same object.</p>
+   * query will use the same object.
    *
    * @param typeFactory Type factory with which to create the type
    * @return Row type
diff --git a/core/src/main/java/org/apache/calcite/schema/TableFactory.java b/core/src/main/java/org/apache/calcite/schema/TableFactory.java
index 780bf2e681..011cd63498 100644
--- a/core/src/main/java/org/apache/calcite/schema/TableFactory.java
+++ b/core/src/main/java/org/apache/calcite/schema/TableFactory.java
@@ -27,7 +27,7 @@ import java.util.Map;
  *
  * <p>A table factory allows you to include custom tables in a model file.
  * For example, here is a model that contains a custom table that generates
- * a range of integers.</p>
+ * a range of integers.
  *
  * <blockquote><pre>{
  *   version: '1.0',
@@ -51,11 +51,11 @@ import java.util.Map;
  *   ]
  * }</pre></blockquote>
  *
- * <p>Given that schema, the query</p>
+ * <p>Given that schema, the query
  *
  * <blockquote><pre>SELECT * FROM math.integers</pre></blockquote>
  *
- * <p>returns</p>
+ * <p>returns
  *
  * <blockquote><pre>
  * +---+
@@ -69,7 +69,7 @@ import java.util.Map;
  * </pre></blockquote>
  *
  * <p>A class that implements TableFactory specified in a schema must have a
- * public default constructor.</p>
+ * public default constructor.
  *
  * @param <T> Sub-type of table created by this factory
  */
diff --git a/core/src/main/java/org/apache/calcite/schema/TableMacro.java b/core/src/main/java/org/apache/calcite/schema/TableMacro.java
index b6befaa247..84c3c0b697 100644
--- a/core/src/main/java/org/apache/calcite/schema/TableMacro.java
+++ b/core/src/main/java/org/apache/calcite/schema/TableMacro.java
@@ -25,7 +25,7 @@ import java.util.List;
  *
  * <p>As the name "macro" implies, this is invoked at "compile time", that is,
  * during query preparation. Compile-time expansion of table expressions allows
- * for some very powerful query-optimizations.</p>
+ * for some very powerful query-optimizations.
  */
 public interface TableMacro extends Function {
   /**
diff --git a/core/src/main/java/org/apache/calcite/schema/impl/AbstractSchema.java b/core/src/main/java/org/apache/calcite/schema/impl/AbstractSchema.java
index 04072f4cd9..a7b050a504 100644
--- a/core/src/main/java/org/apache/calcite/schema/impl/AbstractSchema.java
+++ b/core/src/main/java/org/apache/calcite/schema/impl/AbstractSchema.java
@@ -41,7 +41,7 @@ import static java.util.Objects.requireNonNull;
 /**
  * Abstract implementation of {@link Schema}.
  *
- * <p>Behavior is as follows:</p>
+ * <p>Behavior is as follows:
  * <ul>
  *   <li>The schema has no tables unless you override
  *       {@link #getTableMap()}.</li>
@@ -78,7 +78,7 @@ public class AbstractSchema implements Schema {
    * <p>The implementations of {@link #getTableNames()}
    * and {@link #getTable(String)} depend on this map.
    * The default implementation of this method returns the empty map.
-   * Override this method to change their behavior.</p>
+   * Override this method to change their behavior.
    *
    * @return Map of tables in this schema by name
    */
@@ -101,7 +101,7 @@ public class AbstractSchema implements Schema {
    * <p>The implementations of {@link #getTypeNames()}
    * and {@link #getType(String)} depend on this map.
    * The default implementation of this method returns the empty map.
-   * Override this method to change their behavior.</p>
+   * Override this method to change their behavior.
    *
    * @return Map of types in this schema by name
    */
@@ -127,7 +127,7 @@ public class AbstractSchema implements Schema {
    * <p>The implementations of {@link #getFunctionNames()}
    * and {@link Schema#getFunctions(String)} depend on this map.
    * The default implementation of this method returns the empty multi-map.
-   * Override this method to change their behavior.</p>
+   * Override this method to change their behavior.
    *
    * @return Multi-map of functions in this schema by name
    */
@@ -149,7 +149,7 @@ public class AbstractSchema implements Schema {
    * <p>The implementations of {@link #getSubSchemaNames()}
    * and {@link #getSubSchema(String)} depend on this map.
    * The default implementation of this method returns the empty map.
-   * Override this method to change their behavior.</p>
+   * Override this method to change their behavior.
    *
    * @return Map of sub-schemas in this schema by name
    */
diff --git a/core/src/main/java/org/apache/calcite/schema/impl/AbstractTableQueryable.java b/core/src/main/java/org/apache/calcite/schema/impl/AbstractTableQueryable.java
index 8247c89a5a..9ae41230b2 100644
--- a/core/src/main/java/org/apache/calcite/schema/impl/AbstractTableQueryable.java
+++ b/core/src/main/java/org/apache/calcite/schema/impl/AbstractTableQueryable.java
@@ -32,7 +32,7 @@ import java.util.Iterator;
  * {@link QueryableTable}.
  *
  * <p>Not to be confused with
- * {@link org.apache.calcite.adapter.java.AbstractQueryableTable}.</p>
+ * {@link org.apache.calcite.adapter.java.AbstractQueryableTable}.
  *
  * @param <T> element type
  */
diff --git a/core/src/main/java/org/apache/calcite/schema/impl/ListTransientTable.java b/core/src/main/java/org/apache/calcite/schema/impl/ListTransientTable.java
index 653a66f3ea..a80556ceef 100644
--- a/core/src/main/java/org/apache/calcite/schema/impl/ListTransientTable.java
+++ b/core/src/main/java/org/apache/calcite/schema/impl/ListTransientTable.java
@@ -53,7 +53,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
  * {@link TransientTable} backed by a Java list. It will be automatically added to the
  * current schema when {@link #scan(DataContext)} method gets called.
  *
- * <p>NOTE: The current API is experimental and subject to change without notice.</p>
+ * <p>NOTE: The current API is experimental and subject to change without notice.
  */
 @Experimental
 public class ListTransientTable extends AbstractQueryableTable
diff --git a/core/src/main/java/org/apache/calcite/schema/impl/MaterializedViewTable.java b/core/src/main/java/org/apache/calcite/schema/impl/MaterializedViewTable.java
index f878bc9fd8..125693ee9a 100644
--- a/core/src/main/java/org/apache/calcite/schema/impl/MaterializedViewTable.java
+++ b/core/src/main/java/org/apache/calcite/schema/impl/MaterializedViewTable.java
@@ -45,7 +45,7 @@ import static java.util.Objects.requireNonNull;
  * <p>It can exist in two states: materialized and not materialized. Over time,
  * a given materialized view may switch states. How it is expanded depends upon
  * its current state. State is managed by
- * {@link org.apache.calcite.materialize.MaterializationService}.</p>
+ * {@link org.apache.calcite.materialize.MaterializationService}.
  */
 public class MaterializedViewTable extends ViewTable {
 
diff --git a/core/src/main/java/org/apache/calcite/schema/impl/ReflectiveFunctionBase.java b/core/src/main/java/org/apache/calcite/schema/impl/ReflectiveFunctionBase.java
index c3a0211342..ef28da6631 100644
--- a/core/src/main/java/org/apache/calcite/schema/impl/ReflectiveFunctionBase.java
+++ b/core/src/main/java/org/apache/calcite/schema/impl/ReflectiveFunctionBase.java
@@ -100,6 +100,7 @@ public abstract class ReflectiveFunctionBase implements Function {
 
   /**
    * Finds a method in a given class by name.
+   *
    * @param clazz class to search method in
    * @param name name of the method to find
    * @return the first method with matching name or null when no method found
diff --git a/core/src/main/java/org/apache/calcite/schema/impl/StarTable.java b/core/src/main/java/org/apache/calcite/schema/impl/StarTable.java
index 27d4d4c779..97a17ec0db 100644
--- a/core/src/main/java/org/apache/calcite/schema/impl/StarTable.java
+++ b/core/src/main/java/org/apache/calcite/schema/impl/StarTable.java
@@ -50,11 +50,11 @@ import static org.apache.calcite.linq4j.Nullness.castNonNull;
  *
  * <p>Star tables do not occur in end-user queries. They are introduced by the
  * optimizer to help matching queries to materializations, and used only
- * during the planning process.</p>
+ * during the planning process.
  *
  * <p>When a materialization is defined, if it involves a join, it is converted
  * to a query on top of a star table. Queries that are candidates to map onto
- * the materialization are mapped onto the same star table.</p>
+ * the materialization are mapped onto the same star table.
  */
 public class StarTable extends AbstractTable implements TranslatableTable {
   public final Lattice lattice;
diff --git a/core/src/main/java/org/apache/calcite/schema/impl/ViewTable.java b/core/src/main/java/org/apache/calcite/schema/impl/ViewTable.java
index c055ab1dbe..2f683520d8 100644
--- a/core/src/main/java/org/apache/calcite/schema/impl/ViewTable.java
+++ b/core/src/main/java/org/apache/calcite/schema/impl/ViewTable.java
@@ -43,7 +43,7 @@ import java.util.List;
 /**
  * Table whose contents are defined using an SQL statement.
  *
- * <p>It is not evaluated; it is expanded during query planning.</p>
+ * <p>It is not evaluated; it is expanded during query planning.
  */
 public class ViewTable
     extends AbstractQueryableTable
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlBasicFunction.java b/core/src/main/java/org/apache/calcite/sql/SqlBasicFunction.java
index a811228bea..0230bdf3ca 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlBasicFunction.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlBasicFunction.java
@@ -98,8 +98,8 @@ public class SqlBasicFunction extends SqlFunction {
   }
 
   /** Creates a {@code SqlBasicFunction}
-   *  with kind {@link SqlKind#OTHER_FUNCTION}
-   *  and category {@link SqlFunctionCategory#NUMERIC}. */
+   * with kind {@link SqlKind#OTHER_FUNCTION}
+   * and category {@link SqlFunctionCategory#NUMERIC}. */
   public static SqlBasicFunction create(String name,
       SqlReturnTypeInference returnTypeInference,
       SqlOperandTypeChecker operandTypeChecker) {
@@ -110,7 +110,7 @@ public class SqlBasicFunction extends SqlFunction {
   }
 
   /** Creates a {@code SqlBasicFunction}
-   *  with kind {@link SqlKind#OTHER_FUNCTION}. */
+   * with kind {@link SqlKind#OTHER_FUNCTION}. */
   public static SqlBasicFunction create(String name,
       SqlReturnTypeInference returnTypeInference,
       SqlOperandTypeChecker operandTypeChecker, SqlFunctionCategory category) {
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlCall.java b/core/src/main/java/org/apache/calcite/sql/SqlCall.java
index 7cc66e7ec7..3f64e5757d 100755
--- a/core/src/main/java/org/apache/calcite/sql/SqlCall.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlCall.java
@@ -78,18 +78,23 @@ public abstract class SqlCall extends SqlNode {
   public abstract SqlOperator getOperator();
 
   /**
-   * Returns the list of operands. The set and order of operands is call-specific.
+   * Returns the list of operands. The set and order of operands is
+   * call-specific.
+   *
    * <p>Note: the proper type would be {@code List<@Nullable SqlNode>}, however,
-   * it would trigger too many changes to the current codebase.</p>
+   * it would trigger too many changes to the current codebase.
+   *
    * @return the list of call operands, never null, the operands can be null
    */
   public abstract List</*Nullable*/ SqlNode> getOperandList();
 
   /**
    * Returns i-th operand (0-based).
+   *
    * <p>Note: the result might be null, so the proper signature would be
-   * {@code <S extends @Nullable SqlNode>}, however, it would trigger to many changes to the current
-   * codebase.</p>
+   * {@code <S extends @Nullable SqlNode>}, however, it would trigger to many
+   * changes to the current codebase.
+   *
    * @param i operand index (0-based)
    * @param <S> type of the result
    * @return i-th operand (0-based), the result might be null
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlDataTypeSpec.java b/core/src/main/java/org/apache/calcite/sql/SqlDataTypeSpec.java
index 8c41e3001e..3dec2a2c2f 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlDataTypeSpec.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlDataTypeSpec.java
@@ -34,7 +34,7 @@ import java.util.TimeZone;
  * Represents a SQL data type specification in a parse tree.
  *
  * <p>A <code>SqlDataTypeSpec</code> is immutable; once created, you cannot
- * change any of the fields.</p>
+ * change any of the fields.
  *
  * <p>We support the following data type expressions:
  *
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlDialect.java b/core/src/main/java/org/apache/calcite/sql/SqlDialect.java
index ffb12c3629..31e96bf943 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlDialect.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlDialect.java
@@ -724,18 +724,18 @@ public class SqlDialect {
   /**
    * Returns whether the dialect supports GROUP BY literals.
    *
-   * <p>For instance, in {@link DatabaseProduct#REDSHIFT}, the following queries are illegal.</p>
-   * <pre>{@code
+   * <p>For instance, in {@link DatabaseProduct#REDSHIFT}, the following queries
+   * are illegal:
+   *
+   * <blockquote><pre>{@code
    * select avg(salary)
    * from emp
    * group by true
-   * }</pre>
    *
-   *  <pre>{@code
    * select avg(salary)
    * from emp
    * group by 'a', DATE '2022-01-01'
-   * }</pre>
+   * }</pre></blockquote>
    */
   public boolean supportsGroupByLiteral() {
     return true;
@@ -851,7 +851,7 @@ public class SqlDialect {
   }
 
   /** Rewrite SINGLE_VALUE into expression based on database variants
-   *  E.g. HSQLDB, MYSQL, ORACLE, etc
+   * E.g. HSQLDB, MYSQL, ORACLE, etc.
    */
   public SqlNode rewriteSingleValueExpr(SqlNode aggCall) {
     LOGGER.debug("SINGLE_VALUE rewrite not supported for {}", databaseProduct);
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlFilterOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlFilterOperator.java
index 9a34873326..03ecb00606 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlFilterOperator.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlFilterOperator.java
@@ -33,7 +33,7 @@ import static org.apache.calcite.util.Static.RESOURCE;
  * An operator that applies a filter before rows are included in an aggregate
  * function.
  *
- * <p>Operands are as follows:</p>
+ * <p>Operands are as follows:
  *
  * <ul>
  * <li>0: a call to an aggregate function ({@link SqlCall})
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlIntervalLiteral.java b/core/src/main/java/org/apache/calcite/sql/SqlIntervalLiteral.java
index 7cf370a8fe..c9a2d335d7 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlIntervalLiteral.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlIntervalLiteral.java
@@ -37,9 +37,9 @@ import static org.apache.calcite.linq4j.Nullness.castNonNull;
  * <li>INTERVAL '3:4' YEAR TO MONTH</li>
  * </ul>
  *
- * <p>YEAR/MONTH intervals are not implemented yet.</p>
+ * <p>YEAR/MONTH intervals are not implemented yet.
  *
- * <p>The interval string, such as '1:00:05.345', is not parsed yet.</p>
+ * <p>The interval string, such as '1:00:05.345', is not parsed yet.
  */
 public class SqlIntervalLiteral extends SqlLiteral {
   //~ Constructors -----------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlIntervalQualifier.java b/core/src/main/java/org/apache/calcite/sql/SqlIntervalQualifier.java
index 0dce371574..508aaaf307 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlIntervalQualifier.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlIntervalQualifier.java
@@ -266,7 +266,7 @@ public class SqlIntervalQualifier extends SqlNode {
   }
 
   /** Whether this qualifier represents {@code WEEK}, {@code ISOWEEK},
-   *  or {@code WEEK(}<i>weekday</i>{@code )}
+   * or {@code WEEK(}<i>weekday</i>{@code )}
    * (for <i>weekday</i> in {@code SUNDAY} .. {@code SATURDAY}). */
   public boolean isWeek() {
     return timeUnitRange == TimeUnitRange.WEEK
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlKind.java b/core/src/main/java/org/apache/calcite/sql/SqlKind.java
index b34c9d2b15..fa86e306eb 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlKind.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlKind.java
@@ -30,7 +30,7 @@ import java.util.Set;
  *
  * <p>The values are immutable, canonical constants, so you can use Kinds to
  * find particular types of expressions quickly. To identity a call to a common
- * operator such as '=', use {@link org.apache.calcite.sql.SqlNode#isA}:</p>
+ * operator such as '=', use {@link org.apache.calcite.sql.SqlNode#isA}:
  *
  * <blockquote>
  * exp.{@link org.apache.calcite.sql.SqlNode#isA isA}({@link #EQUALS})
@@ -38,9 +38,9 @@ import java.util.Set;
  *
  * <p>Only commonly-used nodes have their own type; other nodes are of type
  * {@link #OTHER}. Some of the values, such as {@link #SET_QUERY}, represent
- * aggregates.</p>
+ * aggregates.
  *
- * <p>To quickly choose between a number of options, use a switch statement:</p>
+ * <p>To quickly choose between a number of options, use a switch statement:
  *
  * <blockquote>
  * <pre>switch (exp.getKind()) {
@@ -54,12 +54,12 @@ import java.util.Set;
  * </blockquote>
  *
  * <p>Note that we do not even have to check that a {@code SqlNode} is a
- * {@link SqlCall}.</p>
+ * {@link SqlCall}.
  *
  * <p>To identify a category of expressions, use {@code SqlNode.isA} with
  * an aggregate SqlKind. The following expression will return <code>true</code>
  * for calls to '=' and '&gt;=', but <code>false</code> for the constant '5', or
- * a call to '+':</p>
+ * a call to '+':
  *
  * <blockquote>
  * <pre>exp.isA({@link #COMPARISON SqlKind.COMPARISON})</pre>
@@ -67,16 +67,16 @@ import java.util.Set;
  *
  * <p>RexNode also has a {@code getKind} method; {@code SqlKind} values are
  * preserved during translation from {@code SqlNode} to {@code RexNode}, where
- * applicable.</p>
+ * applicable.
  *
  * <p>There is no water-tight definition of "common", but that's OK. There will
  * always be operators that don't have their own kind, and for these we use the
  * {@code SqlOperator}. But for really the common ones, e.g. the many places
  * where we are looking for {@code AND}, {@code OR} and {@code EQUALS}, the enum
- * helps.</p>
+ * helps.
  *
  * <p>(If we were using Scala, {@link SqlOperator} would be a case
- * class, and we wouldn't need {@code SqlKind}. But we're not.)</p>
+ * class, and we wouldn't need {@code SqlKind}. But we're not.)
  */
 public enum SqlKind {
   //~ Static fields/initializers ---------------------------------------------
@@ -110,7 +110,7 @@ public enum SqlKind {
    *
    * <p>A FROM clause with more than one table is represented as if it were a
    * join. For example, "FROM x, y, z" is represented as
-   * "JOIN(x, JOIN(x, y))".</p>
+   * "JOIN(x, JOIN(x, y))".
    */
   JOIN,
 
@@ -581,42 +581,42 @@ public enum SqlKind {
    * The field access operator, ".".
    *
    * <p>(Only used at the RexNode level; at
-   * SqlNode level, a field-access is part of an identifier.)</p>
+   * SqlNode level, a field-access is part of an identifier.)
    */
   FIELD_ACCESS,
 
   /**
    * Reference to an input field.
    *
-   * <p>(Only used at the RexNode level.)</p>
+   * <p>(Only used at the RexNode level.)
    */
   INPUT_REF,
 
   /**
    * Reference to an input field, with a qualified name and an identifier.
    *
-   * <p>(Only used at the RexNode level.)</p>
+   * <p>(Only used at the RexNode level.)
    */
   TABLE_INPUT_REF,
 
   /**
    * Reference to an input field, with pattern var as modifier.
    *
-   * <p>(Only used at the RexNode level.)</p>
+   * <p>(Only used at the RexNode level.)
    */
   PATTERN_INPUT_REF,
   /**
    * Reference to a sub-expression computed within the current relational
    * operator.
    *
-   * <p>(Only used at the RexNode level.)</p>
+   * <p>(Only used at the RexNode level.)
    */
   LOCAL_REF,
 
   /**
    * Reference to correlation variable.
    *
-   * <p>(Only used at the RexNode level.)</p>
+   * <p>(Only used at the RexNode level.)
    */
   CORREL_VARIABLE,
 
@@ -1361,25 +1361,27 @@ public enum SqlKind {
   /**
    * Category of operators that do not depend on the argument order.
    *
-   * <p>For instance: {@link #AND}, {@link #OR}, {@link #EQUALS}, {@link #LEAST}</p>
-   * <p>Note: {@link #PLUS} does depend on the argument oder if argument types are different</p>
+   * <p>For instance: {@link #AND}, {@link #OR}, {@link #EQUALS},
+   * {@link #LEAST}.
+   *
+   * <p>Note: {@link #PLUS} does depend on the argument oder if argument types
+   * are different.
    */
   @API(since = "1.22", status = API.Status.EXPERIMENTAL)
   public static final Set<SqlKind> SYMMETRICAL =
-      EnumSet.of(
-          AND, OR, EQUALS, NOT_EQUALS,
+      EnumSet.of(AND, OR, EQUALS, NOT_EQUALS,
           IS_DISTINCT_FROM, IS_NOT_DISTINCT_FROM,
           GREATEST, LEAST);
 
   /**
-   * Category of operators that do not depend on the argument order if argument types are equal.
+   * Category of operators that do not depend on the argument order if argument
+   * types are equal.
    *
-   * <p>For instance: {@link #PLUS}, {@link #TIMES}</p>
+   * <p>For instance: {@link #PLUS}, {@link #TIMES}.
    */
   @API(since = "1.22", status = API.Status.EXPERIMENTAL)
   public static final Set<SqlKind> SYMMETRICAL_SAME_ARG_TYPE =
-      EnumSet.of(
-          PLUS, TIMES);
+      EnumSet.of(PLUS, TIMES);
 
   /**
    * Simple binary operators are those operators which expects operands from the same Domain.
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlLiteral.java b/core/src/main/java/org/apache/calcite/sql/SqlLiteral.java
index 4c9884ea2e..8ce572495a 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlLiteral.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlLiteral.java
@@ -61,11 +61,11 @@ import static java.util.Objects.requireNonNull;
  * object, but the type of that value is implementation detail, and it is best
  * that your code does not depend upon that knowledge. It is better to use
  * task-oriented methods such as {@link #toSqlString(SqlDialect)} and
- * {@link #toValue}.</p>
+ * {@link #toValue}.
  *
  * <p>If you really need to access the value directly, you should switch on the
  * value of the {@link #typeName} field, rather than making assumptions about
- * the runtime type of the {@link #value}.</p>
+ * the runtime type of the {@link #value}.
  *
  * <p>The allowable types and combinations are:
  *
@@ -527,6 +527,7 @@ public class SqlLiteral extends SqlNode {
   /**
    * Converts a chained string literals into regular literals; returns regular
    * literals unchanged.
+   *
    * @throws IllegalArgumentException if {@code node} is not a string literal
    * and cannot be unchained.
    */
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlOperator.java
index 43a23795ff..6a85eb6df4 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlOperator.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlOperator.java
@@ -784,7 +784,7 @@ public abstract class SqlOperator {
    * <p>Similar to {@link #checkOperandCount}, but some operators may have
    * different valid operands in {@link SqlNode} and {@code RexNode} formats
    * (some examples are CAST and AND), and this method throws internal errors,
-   * not user errors.</p>
+   * not user errors.
    */
   public boolean validRexOperands(int count, Litmus litmus) {
     return true;
@@ -838,11 +838,11 @@ public abstract class SqlOperator {
    * <dfn>window functions</dfn>.
    * Every aggregate function (e.g. SUM) is also a window function.
    * There are window functions that are not aggregate functions, e.g. RANK,
-   * NTILE, LEAD, FIRST_VALUE.</p>
+   * NTILE, LEAD, FIRST_VALUE.
    *
    * <p>Collectively, aggregate and window functions are called <dfn>analytic
    * functions</dfn>. Despite its name, this method returns true for every
-   * analytic function.</p>
+   * analytic function.
    *
    * @see #requiresOrder()
    *
@@ -876,7 +876,7 @@ public abstract class SqlOperator {
    *
    * <p>Per SQL:2011, 2, 6.10: "If &lt;ntile function&gt;, &lt;lead or lag
    * function&gt;, RANK or DENSE_RANK is specified, then the window ordering
-   * clause shall be present."</p>
+   * clause shall be present."
    *
    * @see #isAggregator()
    */
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlOperatorBinding.java b/core/src/main/java/org/apache/calcite/sql/SqlOperatorBinding.java
index 578c1ee505..439ddb6ead 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlOperatorBinding.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlOperatorBinding.java
@@ -66,9 +66,9 @@ public abstract class SqlOperatorBinding {
    * GROUP BY deptno, gender", returns 2.
    *
    * <p>Returns 0 if the query is implicitly "GROUP BY ()" because of an
-   * aggregate expression. For example, "SELECT sum(sal) FROM emp".</p>
+   * aggregate expression. For example, "SELECT sum(sal) FROM emp".
    *
-   * <p>Returns -1 if the query is not an aggregate query.</p>
+   * <p>Returns -1 if the query is not an aggregate query.
    */
   public int getGroupCount() {
     return -1;
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlOrderBy.java b/core/src/main/java/org/apache/calcite/sql/SqlOrderBy.java
index 25227e6c60..c0c88240f8 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlOrderBy.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlOrderBy.java
@@ -29,7 +29,7 @@ import java.util.List;
  *
  * <p>It is a purely syntactic operator, and is eliminated by
  * {@link org.apache.calcite.sql.validate.SqlValidatorImpl#performUnconditionalRewrites}
- * and replaced with the ORDER_OPERAND of SqlSelect.</p>
+ * and replaced with the ORDER_OPERAND of SqlSelect.
  */
 public class SqlOrderBy extends SqlCall {
   public static final SqlSpecialOperator OPERATOR = new Operator() {
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlOverOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlOverOperator.java
index beed7f11b1..c04b986b42 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlOverOperator.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlOverOperator.java
@@ -30,7 +30,7 @@ import static org.apache.calcite.util.Static.RESOURCE;
 /**
  * An operator describing a window function specification.
  *
- * <p>Operands are as follows:</p>
+ * <p>Operands are as follows:
  *
  * <ul>
  * <li>0: name of window function ({@link org.apache.calcite.sql.SqlCall})</li>
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlSampleSpec.java b/core/src/main/java/org/apache/calcite/sql/SqlSampleSpec.java
index 7f4a6f0d49..974c23d6f4 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlSampleSpec.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlSampleSpec.java
@@ -21,14 +21,14 @@ import org.apache.calcite.sql.dialect.CalciteSqlDialect;
 /**
  * Specification of a SQL sample.
  *
- * <p>For example, the query</p>
+ * <p>For example, the query
  *
  * <blockquote>
  * <pre>SELECT *
  * FROM emp TABLESAMPLE SUBSTITUTE('medium')</pre>
  * </blockquote>
  *
- * <p>declares a sample which is created using {@link #createNamed}.</p>
+ * <p>declares a sample which is created using {@link #createNamed}.
  *
  * <p>A sample is not a {@link SqlNode}. To include it in a parse tree, wrap it
  * as a literal, viz:
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlSelectOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlSelectOperator.java
index d6bd88dc40..0ced990139 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlSelectOperator.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlSelectOperator.java
@@ -34,7 +34,7 @@ import static java.util.Objects.requireNonNull;
 /**
  * An operator describing a query. (Not a query itself.)
  *
- * <p>Operands are:</p>
+ * <p>Operands are:
  *
  * <ul>
  * <li>0: distinct ({@link SqlLiteral})</li>
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlTableRef.java b/core/src/main/java/org/apache/calcite/sql/SqlTableRef.java
index 51907f2149..1d4896d584 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlTableRef.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlTableRef.java
@@ -27,10 +27,10 @@ import java.util.List;
 import static java.util.Objects.requireNonNull;
 
 /**
- *  A <code>SqlTableRef</code> is a node of a parse tree which represents
- *  a table reference.
+ * A <code>SqlTableRef</code> is a node of a parse tree which represents
+ * a table reference.
  *
- *  <p>It can be attached with a sql hint statement, see {@link SqlHint} for details.
+ * <p>It can be attached with a sql hint statement, see {@link SqlHint} for details.
  */
 public class SqlTableRef extends SqlCall {
 
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlTypeConstructorFunction.java b/core/src/main/java/org/apache/calcite/sql/SqlTypeConstructorFunction.java
index 99798557c3..216ebc783d 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlTypeConstructorFunction.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlTypeConstructorFunction.java
@@ -23,7 +23,7 @@ import org.apache.calcite.sql.type.ExplicitOperandTypeChecker;
  * Type Constructor function.
  *
  * <p>Created by the parser, then it is rewritten to proper SqlFunction by
- * the validator to a function defined in a Calcite schema.</p>
+ * the validator to a function defined in a Calcite schema.
  */
 public class SqlTypeConstructorFunction extends SqlFunction {
 
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlUnresolvedFunction.java b/core/src/main/java/org/apache/calcite/sql/SqlUnresolvedFunction.java
index 9ea781f402..d1f3d796a9 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlUnresolvedFunction.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlUnresolvedFunction.java
@@ -31,7 +31,7 @@ import java.util.List;
  * Placeholder for an unresolved function.
  *
  * <p>Created by the parser, then it is rewritten to proper SqlFunction by
- * the validator to a function defined in a Calcite schema.</p>
+ * the validator to a function defined in a Calcite schema.
  */
 public class SqlUnresolvedFunction extends SqlFunction {
   /**
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlUtil.java b/core/src/main/java/org/apache/calcite/sql/SqlUtil.java
index 26362e9f41..d5e0b7e419 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlUtil.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlUtil.java
@@ -842,6 +842,7 @@ public abstract class SqlUtil {
 
   /**
    * Whether the alias is generated by calcite.
+   *
    * @param alias not null
    * @return true if alias is generated by calcite, otherwise false
    */
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlWindow.java b/core/src/main/java/org/apache/calcite/sql/SqlWindow.java
index 848fad0d76..198b9961c3 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlWindow.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlWindow.java
@@ -47,7 +47,7 @@ import static org.apache.calcite.util.Static.RESOURCE;
 /**
  * SQL window specification.
  *
- * <p>For example, the query</p>
+ * <p>For example, the query
  *
  * <blockquote>
  * <pre>SELECT sum(a) OVER (w ROWS 3 PRECEDING)
@@ -57,7 +57,7 @@ import static org.apache.calcite.util.Static.RESOURCE;
  * </blockquote>
  *
  * <p>declares windows w and w1, and uses a window in an OVER clause. It thus
- * contains 3 {@link SqlWindow} objects.</p>
+ * contains 3 {@link SqlWindow} objects.
  */
 public class SqlWindow extends SqlCall {
   /**
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlWindowTableFunction.java b/core/src/main/java/org/apache/calcite/sql/SqlWindowTableFunction.java
index a17a1eb181..f826fdce09 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlWindowTableFunction.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlWindowTableFunction.java
@@ -70,8 +70,8 @@ public class SqlWindowTableFunction extends SqlFunction
    * and two additional fields. The fields are as follows:
    *
    * <ol>
-   *  <li>{@code window_start}: TIMESTAMP type to indicate a window's start
-   *  <li>{@code window_end}: TIMESTAMP type to indicate a window's end
+   * <li>{@code window_start}: TIMESTAMP type to indicate a window's start
+   * <li>{@code window_end}: TIMESTAMP type to indicate a window's end
    * </ol>
    */
   public static final SqlReturnTypeInference ARG0_TABLE_FUNCTION_WINDOWING =
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlWithinGroupOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlWithinGroupOperator.java
index d335948322..f542c6b97a 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlWithinGroupOperator.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlWithinGroupOperator.java
@@ -34,7 +34,7 @@ import static org.apache.calcite.util.Static.RESOURCE;
 /**
  * An operator that applies a sort operation before rows are included in an aggregate function.
  *
- * <p>Operands are as follows:</p>
+ * <p>Operands are as follows:
  *
  * <ul>
  * <li>0: a call to an aggregate function ({@link SqlCall})
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlWriter.java b/core/src/main/java/org/apache/calcite/sql/SqlWriter.java
index 9f84632302..47a400f417 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlWriter.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlWriter.java
@@ -106,7 +106,7 @@ public interface SqlWriter {
     /**
      * Function call or datatype declaration.
      *
-     * <p>Examples:</p>
+     * <p>Examples:
      * <ul>
      * <li><code>SUBSTRING('foobar' FROM 1 + 2 TO 4)</code></li>
      * <li><code>DECIMAL(10, 5)</code></li>
@@ -117,7 +117,7 @@ public interface SqlWriter {
     /**
      * Window specification.
      *
-     * <p>Examples:</p>
+     * <p>Examples:
      * <ul>
      * <li><code>SUM(x) OVER (ORDER BY hireDate ROWS 3 PRECEDING)</code></li>
      * <li><code>WINDOW w1 AS (ORDER BY hireDate), w2 AS (w1 PARTITION BY gender
@@ -136,7 +136,7 @@ public interface SqlWriter {
     /**
      * ORDER BY list.
      *
-     * <p>Example:</p>
+     * <p>Example:
      * <ul>
      * <li><code>ORDER BY x, y DESC, z</code></li>
      * </ul>
@@ -157,7 +157,7 @@ public interface SqlWriter {
     /**
      * OFFSET clause.
      *
-     * <p>Example:</p>
+     * <p>Example:
      * <ul>
      * <li><code>OFFSET 10 ROWS</code></li>
      * </ul>
@@ -167,7 +167,7 @@ public interface SqlWriter {
     /**
      * FETCH clause.
      *
-     * <p>Example:</p>
+     * <p>Example:
      * <ul>
      * <li><code>FETCH FIRST 3 ROWS ONLY</code></li>
      * </ul>
@@ -177,7 +177,7 @@ public interface SqlWriter {
     /**
      * GROUP BY list.
      *
-     * <p>Example:</p>
+     * <p>Example:
      * <ul>
      * <li><code>GROUP BY x, FLOOR(y)</code></li>
      * </ul>
@@ -188,7 +188,7 @@ public interface SqlWriter {
      * Sub-query list. Encloses a SELECT, UNION, EXCEPT, INTERSECT query
      * with optional ORDER BY.
      *
-     * <p>Example:</p>
+     * <p>Example:
      * <ul>
      * <li><code>GROUP BY x, FLOOR(y)</code></li>
      * </ul>
@@ -198,7 +198,7 @@ public interface SqlWriter {
     /**
      * Set operation.
      *
-     * <p>Example:</p>
+     * <p>Example:
      * <ul>
      * <li><code>SELECT * FROM a UNION SELECT * FROM b</code></li>
      * </ul>
@@ -233,7 +233,7 @@ public interface SqlWriter {
     /**
      * Compound identifier.
      *
-     * <p>Example:</p>
+     * <p>Example:
      * <ul>
      * <li><code>"A"."B"."C"</code></li>
      * </ul>
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlWriterConfig.java b/core/src/main/java/org/apache/calcite/sql/SqlWriterConfig.java
index 2e3f50a392..038201bbd1 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlWriterConfig.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlWriterConfig.java
@@ -425,6 +425,7 @@ public interface SqlWriterConfig {
 
   /**
    * Create a default SqlWriterConfig object.
+   *
    * @return The config.
    */
   static SqlWriterConfig of() {
diff --git a/core/src/main/java/org/apache/calcite/sql/TableCharacteristic.java b/core/src/main/java/org/apache/calcite/sql/TableCharacteristic.java
index c4afe53843..245a965494 100644
--- a/core/src/main/java/org/apache/calcite/sql/TableCharacteristic.java
+++ b/core/src/main/java/org/apache/calcite/sql/TableCharacteristic.java
@@ -23,7 +23,7 @@ import java.util.Objects;
 /**
  * A table-valued input parameter of a table function is classified by three
  * characteristics.
-
+ *
  * <p>The first characteristic is semantics. The table has either
  * row semantics or set semantics.
  *
diff --git a/core/src/main/java/org/apache/calcite/sql/advise/SqlAdvisor.java b/core/src/main/java/org/apache/calcite/sql/advise/SqlAdvisor.java
index b81170988d..572cb8f159 100644
--- a/core/src/main/java/org/apache/calcite/sql/advise/SqlAdvisor.java
+++ b/core/src/main/java/org/apache/calcite/sql/advise/SqlAdvisor.java
@@ -225,6 +225,7 @@ public class SqlAdvisor {
    * Returns casing which is preferred for replacement.
    * For instance, {@code en => ename, EN => ENAME}.
    * When input has mixed case, {@code Casing.UNCHANGED} is returned.
+   *
    * @param word input word
    * @return preferred casing when replacing input word
    */
diff --git a/core/src/main/java/org/apache/calcite/sql/advise/package-info.java b/core/src/main/java/org/apache/calcite/sql/advise/package-info.java
index 9ecc39e657..2b2726e430 100644
--- a/core/src/main/java/org/apache/calcite/sql/advise/package-info.java
+++ b/core/src/main/java/org/apache/calcite/sql/advise/package-info.java
@@ -19,7 +19,7 @@
  * Provides hints and corrections for editing SQL statements.
  *
  * <p>The SQL statement might be partially-formed SQL statement or
- * invalid. It is edited in a SQL editor user-interface.</p>
+ * invalid. It is edited in a SQL editor user-interface.
  *
  * <p>The advisor uses the validation and parser framework set up in
  * <code>org.apache.calcite.sql.validate</code> package.
diff --git a/core/src/main/java/org/apache/calcite/sql/dialect/BigQuerySqlDialect.java b/core/src/main/java/org/apache/calcite/sql/dialect/BigQuerySqlDialect.java
index f2a3f7fc26..e7a91dea2e 100644
--- a/core/src/main/java/org/apache/calcite/sql/dialect/BigQuerySqlDialect.java
+++ b/core/src/main/java/org/apache/calcite/sql/dialect/BigQuerySqlDialect.java
@@ -251,7 +251,7 @@ public class BigQuerySqlDialect extends SqlDialect {
   /**
    * For usage of TRIM, LTRIM and RTRIM in BQ see
    * <a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#trim">
-   *  BQ Trim Function</a>.
+   * BQ Trim Function</a>.
    */
   private static void unparseTrim(SqlWriter writer, SqlCall call, int leftPrec,
       int rightPrec) {
diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlCaseOperator.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlCaseOperator.java
index ffb11eb071..0c547fb876 100644
--- a/core/src/main/java/org/apache/calcite/sql/fun/SqlCaseOperator.java
+++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlCaseOperator.java
@@ -71,7 +71,7 @@ import static java.util.Objects.requireNonNull;
  *
  * <p>The switched form of the <code>CASE</code> statement is normalized to the
  * simple form by inserting calls to the <code>=</code> operator. For
- * example,</p>
+ * example,
  *
  * <blockquote><pre><code>CASE x + y
  *   WHEN 1 THEN 'fee'
@@ -79,7 +79,7 @@ import static java.util.Objects.requireNonNull;
  *   ELSE 'foe'
  * END</code></pre></blockquote>
  *
- * <p>becomes</p>
+ * <p>becomes
  *
  * <blockquote><pre><code>CASE
  * WHEN Equals(x + y, 1) THEN 'fee'
@@ -88,9 +88,9 @@ import static java.util.Objects.requireNonNull;
  * END</code></pre></blockquote>
  *
  * <p>REVIEW jhyde 2004/3/19 Does <code>Equals</code> handle NULL semantics
- * correctly?</p>
+ * correctly?
  *
- * <p><code>COALESCE(x, y, z)</code> becomes</p>
+ * <p><code>COALESCE(x, y, z)</code> becomes
  *
  * <blockquote><pre><code>CASE
  * WHEN x IS NOT NULL THEN x
@@ -98,7 +98,7 @@ import static java.util.Objects.requireNonNull;
  * ELSE z
  * END</code></pre></blockquote>
  *
- * <p><code>NULLIF(x, -1)</code> becomes</p>
+ * <p><code>NULLIF(x, -1)</code> becomes
  *
  * <blockquote><pre><code>CASE
  * WHEN x = -1 THEN NULL
@@ -109,7 +109,7 @@ import static java.util.Objects.requireNonNull;
  * This may make it more difficult to write optimizer rules (because the rules
  * will have to deduce that expressions are equivalent). It also requires that
  * some part of the planning process (probably the generator of the calculator
- * program) does common sub-expression elimination.</p>
+ * program) does common sub-expression elimination.
  *
  * <p>REVIEW jhyde 2004/3/19. Expanding expressions at parse time has some other
  * drawbacks. It is more difficult to give meaningful validation errors: given
@@ -119,9 +119,9 @@ import static java.util.Objects.requireNonNull;
  * but there's now no way to represent a call to COALESCE or NULLIF. All in all,
  * it would be better to have operators for COALESCE, NULLIF, and both simple
  * and switched forms of CASE, then translate to simple CASE when building the
- * {@link org.apache.calcite.rex.RexNode} tree.</p>
+ * {@link org.apache.calcite.rex.RexNode} tree.
  *
- * <p>The arguments are physically represented as follows:</p>
+ * <p>The arguments are physically represented as follows:
  *
  * <ul>
  * <li>The <i>when</i> expressions are stored in a {@link SqlNodeList}
diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlJsonValueFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlJsonValueFunction.java
index 878aefd3f3..5cc542bb49 100644
--- a/core/src/main/java/org/apache/calcite/sql/fun/SqlJsonValueFunction.java
+++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlJsonValueFunction.java
@@ -88,7 +88,7 @@ public class SqlJsonValueFunction extends SqlFunction {
     return SqlOperandCountRanges.between(2, 10);
   }
 
-  /** Returns the optional explicit returning type specification. **/
+  /** Returns the optional explicit returning type specification. */
   private static Optional<RelDataType> explicitTypeSpec(SqlOperatorBinding opBinding) {
     if (opBinding.getOperandCount() > 2
         && opBinding.isOperandLiteral(2, false)
diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java
index 01c16396c3..4da7dd1e33 100644
--- a/core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java
+++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java
@@ -159,7 +159,7 @@ public abstract class SqlLibraryOperators {
               OperandHandlers.of(SqlLibraryOperators::transformConvert));
 
   /** Transforms a call binding of {@code CONVERT} to an equivalent binding for
-   *  {@code CAST}. */
+   * {@code CAST}. */
   private static SqlCallBinding transformConvert(SqlOperatorBinding opBinding) {
     // Guaranteed to be a SqlCallBinding, with 2 or 3 arguments
     final SqlCallBinding binding = (SqlCallBinding) opBinding;
@@ -168,7 +168,7 @@ public abstract class SqlLibraryOperators {
   }
 
   /** Transforms a call to {@code CONVERT} to an equivalent call to
-   *  {@code CAST}. */
+   * {@code CAST}. */
   private static SqlCall transformConvert(SqlValidator validator, SqlCall call) {
     return SqlStdOperatorTable.CAST.createCall(call.getParserPosition(),
         call.operand(1), call.operand(0));
diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlMapQueryConstructor.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlMapQueryConstructor.java
index 3daee84751..bb8840889d 100644
--- a/core/src/main/java/org/apache/calcite/sql/fun/SqlMapQueryConstructor.java
+++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlMapQueryConstructor.java
@@ -23,7 +23,7 @@ import org.apache.calcite.sql.type.SqlTypeTransforms;
  * Definition of the MAP query constructor, <code>
  * MAP (&lt;query&gt;)</code>.
  *
- * <p>Like the MAP type, not standard SQL.</p>
+ * <p>Like the MAP type, not standard SQL.
  */
 public class SqlMapQueryConstructor extends SqlMultisetQueryConstructor {
   //~ Constructors -----------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlMapValueConstructor.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlMapValueConstructor.java
index c0dc72b807..d3c4e5840e 100644
--- a/core/src/main/java/org/apache/calcite/sql/fun/SqlMapValueConstructor.java
+++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlMapValueConstructor.java
@@ -37,7 +37,7 @@ import static java.util.Objects.requireNonNull;
  * Definition of the MAP constructor,
  * <code>MAP [&lt;key&gt;, &lt;value&gt;, ...]</code>.
  *
- * <p>This is an extension to standard SQL.</p>
+ * <p>This is an extension to standard SQL.
  */
 public class SqlMapValueConstructor extends SqlMultisetValueConstructor {
   public SqlMapValueConstructor() {
diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlMultisetValueConstructor.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlMultisetValueConstructor.java
index ccf681f3ee..8efd45a3eb 100644
--- a/core/src/main/java/org/apache/calcite/sql/fun/SqlMultisetValueConstructor.java
+++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlMultisetValueConstructor.java
@@ -42,7 +42,7 @@ import static java.util.Objects.requireNonNull;
  * Definition of the SQL:2003 standard MULTISET constructor, <code>MULTISET
  * [&lt;expr&gt;, ...]</code>.
  *
- * <p>Derived classes construct other kinds of collections.</p>
+ * <p>Derived classes construct other kinds of collections.
  *
  * @see SqlMultisetQueryConstructor
  */
diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java
index 9332de3c5b..f245320958 100644
--- a/core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java
+++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java
@@ -197,7 +197,7 @@ public class SqlStdOperatorTable extends ReflectiveSqlOperatorTable {
   public static final SqlSpecialOperator DEFAULT = new SqlDefaultOperator();
 
   /** <code>FILTER</code> operator filters which rows are included in an
-   *  aggregate function. */
+   * aggregate function. */
   public static final SqlFilterOperator FILTER = new SqlFilterOperator();
 
   /** <code>WITHIN_GROUP</code> operator performs aggregations on ordered data input. */
@@ -1307,7 +1307,7 @@ public class SqlStdOperatorTable extends ReflectiveSqlOperatorTable {
    * &lt;interval qualifier&gt;</code></blockquote>
    *
    * <p>This operator is special since it needs to hold the
-   * additional interval qualifier specification.</p>
+   * additional interval qualifier specification.
    */
   public static final SqlDatetimeSubtractionOperator MINUS_DATE =
       new SqlDatetimeSubtractionOperator("-", ReturnTypes.ARG2_NULLABLE);
@@ -1972,17 +1972,17 @@ public class SqlStdOperatorTable extends ReflectiveSqlOperatorTable {
    * <p>When the CAST operator is applies as a {@link SqlCall}, it has two
    * arguments: the expression and the type. The type must not include a
    * constraint, so <code>CAST(x AS INTEGER NOT NULL)</code>, for instance, is
-   * invalid.</p>
+   * invalid.
    *
    * <p>When the CAST operator is applied as a <code>RexCall</code>, the
    * target type is simply stored as the return type, not an explicit operand.
    * For example, the expression <code>CAST(1 + 2 AS DOUBLE)</code> will
    * become a call to <code>CAST</code> with the expression <code>1 + 2</code>
-   * as its only operand.</p>
+   * as its only operand.
    *
    * <p>The <code>RexCall</code> form can also have a type which contains a
    * <code>NOT NULL</code> constraint. When this expression is implemented, if
-   * the value is NULL, an exception will be thrown.</p>
+   * the value is NULL, an exception will be thrown.
    */
   public static final SqlFunction CAST = new SqlCastFunction();
 
@@ -2108,9 +2108,9 @@ public class SqlStdOperatorTable extends ReflectiveSqlOperatorTable {
    * <p>The SQL standard calls the ARRAY variant a
    * &lt;array element reference&gt;. Index is 1-based. The standard says
    * to raise "data exception - array element error" but we currently return
-   * null.</p>
+   * null.
    *
-   * <p>MAP is not standard SQL.</p>
+   * <p>MAP is not standard SQL.
    */
   public static final SqlOperator ITEM =
       new SqlItemOperator("ITEM", OperandTypes.ARRAY_OR_MAP, 1, true);
@@ -2162,11 +2162,11 @@ public class SqlStdOperatorTable extends ReflectiveSqlOperatorTable {
    * to keep types consistent. For example, <code>ELEMENT(MULTISET [5])</code>
    * is translated to <code>$ELEMENT_SLICE(MULTISET (VALUES ROW (5
    * EXPR$0))</code> It is translated away when the multiset type is converted
-   * back to scalar values.</p>
+   * back to scalar values.
    *
    * <p>NOTE: jhyde, 2006/1/9: Usages of this operator are commented out, but
    * I'm not deleting the operator, because some multiset tests are disabled,
-   * and we may need this operator to get them working!</p>
+   * and we may need this operator to get them working!
    */
   public static final SqlInternalOperator ELEMENT_SLICE =
       new SqlInternalOperator(
diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlThrowOperator.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlThrowOperator.java
index ef4c8efac7..82245750cb 100644
--- a/core/src/main/java/org/apache/calcite/sql/fun/SqlThrowOperator.java
+++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlThrowOperator.java
@@ -27,10 +27,10 @@ import org.apache.calcite.sql.type.ReturnTypes;
  * An internal operator that throws an exception.
  *
  * <p>The exception is thrown with a (localized) error message which is the only
- * input parameter to the operator.</p>
+ * input parameter to the operator.
  *
  * <p>The return type is defined as a <code>BOOLEAN</code> to facilitate the use
- * of it in constructs such as the following:</p>
+ * of it in constructs such as the following:
  *
  * <blockquote><code>CASE<br>
  * WHEN &lt;condition&gt; THEN true<br>
diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlTranslateFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlTranslateFunction.java
index 82c1d2eb35..03ee525d67 100644
--- a/core/src/main/java/org/apache/calcite/sql/fun/SqlTranslateFunction.java
+++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlTranslateFunction.java
@@ -36,15 +36,18 @@ import java.util.List;
 import static org.apache.calcite.util.Static.RESOURCE;
 
 /**
- * Common base for the <code>TRANSLATE(USING) and CONVERT(USING)</code> function,
- * which is different from {@link SqlLibraryOperators#TRANSLATE3} and {@link SqlLibraryOperators#MSSQL_CONVERT}.
+ * Common base for the <code>TRANSLATE(USING)</code> and
+ * <code>CONVERT(USING)</code> function, which is different from
+ * {@link SqlLibraryOperators#TRANSLATE3} and
+ * {@link SqlLibraryOperators#MSSQL_CONVERT}.
+ *
  * <p>The SQL syntax is
  *
  * <blockquote><pre>
  *   {@code TRANSLATE(characterString USING transcodingName)}
  * </pre></blockquote>
  *
- * or
+ * <p>or
  *
  * <blockquote><pre>
  *   {@code CONVERT(characterString USING transcodingName)}
diff --git a/core/src/main/java/org/apache/calcite/sql/fun/package-info.java b/core/src/main/java/org/apache/calcite/sql/fun/package-info.java
index bfde0de26e..0bf59f3963 100644
--- a/core/src/main/java/org/apache/calcite/sql/fun/package-info.java
+++ b/core/src/main/java/org/apache/calcite/sql/fun/package-info.java
@@ -25,6 +25,6 @@
  * function; if other custom code is needed for an operator, it should be
  * implemented in a top-level class within this package instead.  Operators
  * which are not row-level (e.g. select and join) should be defined in package
- * {@link org.apache.calcite.sql} instead.</p>
+ * {@link org.apache.calcite.sql} instead.
  */
 package org.apache.calcite.sql.fun;
diff --git a/core/src/main/java/org/apache/calcite/sql/package-info.java b/core/src/main/java/org/apache/calcite/sql/package-info.java
index 5f9131ad4a..eb1e52b367 100644
--- a/core/src/main/java/org/apache/calcite/sql/package-info.java
+++ b/core/src/main/java/org/apache/calcite/sql/package-info.java
@@ -25,12 +25,12 @@
  * <h2>Parser</h2>
  *
  * <p>{@link org.apache.calcite.sql.parser.SqlParser} parses a SQL string to a
- *     parse tree. It only performs the most basic syntactic validation.</p>
+ *     parse tree. It only performs the most basic syntactic validation.
  *
  * <h2>Object model</h2>
  *
  * <p>Every node in the parse tree is a {@link org.apache.calcite.sql.SqlNode}.
- *     Sub-types are:</p>
+ *     Sub-types are:
  * <ul>
  *
  *     <li>{@link org.apache.calcite.sql.SqlLiteral} represents a boolean,
@@ -56,7 +56,7 @@
  *     {@link org.apache.calcite.sql.SqlCall} into a SQL string.  It is
  *     important to note that operators are metadata, not data: there is only
  *     one <code>SqlOperator</code> instance representing the '=' operator, even
- *     though there may be many calls to it.</p>
+ *     though there may be many calls to it.
  *
  * <p><code>SqlOperator</code> has several derived classes which make it easy to
  *     define new operators: {@link org.apache.calcite.sql.SqlFunction},
@@ -69,11 +69,11 @@
  *     special operators even have their own sub-types of
  *     {@link org.apache.calcite.sql.SqlCall}:
  *     {@link org.apache.calcite.sql.SqlSelect} and
- *     {@link org.apache.calcite.sql.SqlJoin}.)</p>
+ *     {@link org.apache.calcite.sql.SqlJoin}.)
  *
  * <p>A {@link org.apache.calcite.sql.SqlOperatorTable} is a collection of
  *     operators. By supplying your own operator table, you can customize the
- *     dialect of SQL without modifying the parser.</p>
+ *     dialect of SQL without modifying the parser.
  *
  * <h2>Validation</h2>
  *
@@ -83,13 +83,13 @@
  *     {@link org.apache.calcite.sql.SqlOperatorTable} to describe the available
  *     functions and operators, and a
  *     {@link org.apache.calcite.sql.validate.SqlValidatorCatalogReader} for
- *     access to the database's catalog.</p>
+ *     access to the database's catalog.
  *
  * <h2>Generating SQL</h2>
  *
  * <p>A {@link org.apache.calcite.sql.SqlWriter} converts a tree of
  * {@link org.apache.calcite.sql.SqlNode}s into a SQL string. A
- * {@link org.apache.calcite.sql.SqlDialect} defines how this happens.</p>
+ * {@link org.apache.calcite.sql.SqlDialect} defines how this happens.
  */
 @DefaultQualifier(value = NonNull.class, locations = TypeUseLocation.FIELD)
 @DefaultQualifier(value = NonNull.class, locations = TypeUseLocation.PARAMETER)
diff --git a/core/src/main/java/org/apache/calcite/sql/parser/SqlParserImplFactory.java b/core/src/main/java/org/apache/calcite/sql/parser/SqlParserImplFactory.java
index 4ad1d332db..d249bd2dda 100644
--- a/core/src/main/java/org/apache/calcite/sql/parser/SqlParserImplFactory.java
+++ b/core/src/main/java/org/apache/calcite/sql/parser/SqlParserImplFactory.java
@@ -27,7 +27,7 @@ import java.io.Reader;
  *
  * <p>A parser factory allows you to include a custom parser in
  * {@link org.apache.calcite.tools.Planner} created through
- * {@link org.apache.calcite.tools.Frameworks}.</p>
+ * {@link org.apache.calcite.tools.Frameworks}.
  */
 @FunctionalInterface
 public interface SqlParserImplFactory {
diff --git a/core/src/main/java/org/apache/calcite/sql/parser/SqlParserPos.java b/core/src/main/java/org/apache/calcite/sql/parser/SqlParserPos.java
index 00f57aef61..97c6b88bd1 100644
--- a/core/src/main/java/org/apache/calcite/sql/parser/SqlParserPos.java
+++ b/core/src/main/java/org/apache/calcite/sql/parser/SqlParserPos.java
@@ -42,7 +42,7 @@ public class SqlParserPos implements Serializable {
    */
   public static final SqlParserPos ZERO = new SqlParserPos(0, 0);
 
-  /** Same as {@link #ZERO} but always quoted. **/
+  /** Same as {@link #ZERO} but always quoted. */
   public static final SqlParserPos QUOTED_ZERO = new QuotedParserPos(0, 0, 0, 0);
 
   private static final long serialVersionUID = 1L;
diff --git a/core/src/main/java/org/apache/calcite/sql/pretty/SqlPrettyWriter.java b/core/src/main/java/org/apache/calcite/sql/pretty/SqlPrettyWriter.java
index 3a5d380e72..ee1c52d9b8 100644
--- a/core/src/main/java/org/apache/calcite/sql/pretty/SqlPrettyWriter.java
+++ b/core/src/main/java/org/apache/calcite/sql/pretty/SqlPrettyWriter.java
@@ -101,7 +101,7 @@ import static java.util.Objects.requireNonNull;
  *
  * <tr>
  * <td>{@link SqlWriterConfig#alwaysUseParentheses AlwaysUseParentheses}</td>
- * <td><p>Whether to enclose all expressions in parentheses, even if the
+ * <td>Whether to enclose all expressions in parentheses, even if the
  * operator has high enough precedence that the parentheses are not required.
  *
  * <p>For example, the parentheses are required in the expression
diff --git a/core/src/main/java/org/apache/calcite/sql/type/ReturnTypes.java b/core/src/main/java/org/apache/calcite/sql/type/ReturnTypes.java
index e25e3b6c96..09d23db838 100644
--- a/core/src/main/java/org/apache/calcite/sql/type/ReturnTypes.java
+++ b/core/src/main/java/org/apache/calcite/sql/type/ReturnTypes.java
@@ -832,13 +832,13 @@ public abstract class ReturnTypes {
    * For example,
    *
    * <p>concat(cast('a' as varchar(2)), cast('b' as varchar(3)),cast('c' as varchar(2)))
-   * returns varchar(7).</p>
+   * returns varchar(7).
    *
    * <p>concat(cast('a' as varchar), cast('b' as varchar(2), cast('c' as varchar(2))))
-   * returns varchar.</p>
+   * returns varchar.
    *
    * <p>concat(cast('a' as varchar(65535)), cast('b' as varchar(2)), cast('c' as varchar(2)))
-   * returns varchar.</p>
+   * returns varchar.
    */
   public static final SqlReturnTypeInference MULTIVALENT_STRING_SUM_PRECISION =
       opBinding -> {
diff --git a/core/src/main/java/org/apache/calcite/sql/type/SqlReturnTypeInferenceChain.java b/core/src/main/java/org/apache/calcite/sql/type/SqlReturnTypeInferenceChain.java
index 825bb0133f..6be969eef2 100644
--- a/core/src/main/java/org/apache/calcite/sql/type/SqlReturnTypeInferenceChain.java
+++ b/core/src/main/java/org/apache/calcite/sql/type/SqlReturnTypeInferenceChain.java
@@ -41,7 +41,7 @@ public class SqlReturnTypeInferenceChain implements SqlReturnTypeInference {
    * Creates a SqlReturnTypeInferenceChain from an array of rules.
    *
    * <p>Package-protected.
-   * Use {@link org.apache.calcite.sql.type.ReturnTypes#chain}.</p>
+   * Use {@link org.apache.calcite.sql.type.ReturnTypes#chain}.
    */
   SqlReturnTypeInferenceChain(SqlReturnTypeInference... rules) {
     Preconditions.checkArgument(rules.length > 1);
diff --git a/core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java b/core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java
index 169e9e3577..2fdd95b34e 100644
--- a/core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java
+++ b/core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java
@@ -181,6 +181,7 @@ public abstract class SqlTypeUtil {
 
   /**
    * Derives type of the call via its binding.
+   *
    * @param binding binding to derive the type from
    * @return datatype of the call
    */
@@ -191,6 +192,7 @@ public abstract class SqlTypeUtil {
 
   /**
    * Derives type of the given call under given binding.
+   *
    * @param binding binding to derive the type from
    * @param node node type to derive
    * @return datatype of the given node
@@ -203,6 +205,7 @@ public abstract class SqlTypeUtil {
 
   /**
    * Derives types for the list of nodes.
+   *
    * @param binding binding to derive the type from
    * @param nodes the list of nodes to derive types from
    * @return the list of types of the given nodes
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/GroupByScope.java b/core/src/main/java/org/apache/calcite/sql/validate/GroupByScope.java
index 7db2e49224..951ecf86dc 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/GroupByScope.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/GroupByScope.java
@@ -24,13 +24,13 @@ import org.apache.calcite.sql.SqlSelect;
  * Represents the name-resolution context for expressions in an GROUP BY clause.
  *
  * <p>In some dialects of SQL, the GROUP BY clause can reference column aliases
- * in the SELECT clause. For example, the query</p>
+ * in the SELECT clause. For example, the query
  *
  * <blockquote><code>SELECT empno AS x<br>
  * FROM emp<br>
  * GROUP BY x</code></blockquote>
  *
- * <p>is valid.</p>
+ * <p>is valid.
  */
 public class GroupByScope extends DelegatingScope {
   //~ Instance fields --------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/JoinScope.java b/core/src/main/java/org/apache/calcite/sql/validate/JoinScope.java
index d73b16800f..af41321b56 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/JoinScope.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/JoinScope.java
@@ -31,7 +31,7 @@ import static java.util.Objects.requireNonNull;
  *
  * <p>Consider "SELECT * FROM (A JOIN B ON {exp1}) JOIN C ON {exp2}". {exp1} is
  * resolved in the join scope for "A JOIN B", which contains A and B but not
- * C.</p>
+ * C.
  */
 public class JoinScope extends ListScope {
   //~ Instance fields --------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/OrderByScope.java b/core/src/main/java/org/apache/calcite/sql/validate/OrderByScope.java
index 0cbe802d33..87539e49d9 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/OrderByScope.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/OrderByScope.java
@@ -34,13 +34,13 @@ import static org.apache.calcite.util.Static.RESOURCE;
  * Represents the name-resolution context for expressions in an ORDER BY clause.
  *
  * <p>In some dialects of SQL, the ORDER BY clause can reference column aliases
- * in the SELECT clause. For example, the query</p>
+ * in the SELECT clause. For example, the query
  *
  * <blockquote><code>SELECT empno AS x<br>
  * FROM emp<br>
  * ORDER BY x</code></blockquote>
  *
- * <p>is valid.</p>
+ * <p>is valid.
  */
 public class OrderByScope extends DelegatingScope {
   //~ Instance fields --------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/OverScope.java b/core/src/main/java/org/apache/calcite/sql/validate/OverScope.java
index 25bad3b315..fd603199eb 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/OverScope.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/OverScope.java
@@ -28,7 +28,7 @@ import java.util.List;
  * the parameters found on the left side of the over clause, and objects
  * inherited from the parent scope.
  *
- * <p>This object is both a {@link SqlValidatorScope} only. In the query</p>
+ * <p>This object is both a {@link SqlValidatorScope} only. In the query
  *
  * <blockquote>
  * <pre>SELECT name FROM (
@@ -40,7 +40,7 @@ import java.util.List;
  * </blockquote>
  *
  * <p>We need to use the {@link OverScope} as a {@link SqlValidatorNamespace}
- * when resolving names used in the window specification.</p>
+ * when resolving names used in the window specification.
  */
 public class OverScope extends ListScope {
   //~ Instance fields --------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SelectScope.java b/core/src/main/java/org/apache/calcite/sql/validate/SelectScope.java
index 83306732c2..b35384a6eb 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SelectScope.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SelectScope.java
@@ -41,7 +41,7 @@ import static java.util.Objects.requireNonNull;
  *
  *
  * <p>This object is both a {@link SqlValidatorScope} and a
- * {@link SqlValidatorNamespace}. In the query</p>
+ * {@link SqlValidatorNamespace}. In the query
  *
  * <blockquote>
  * <pre>SELECT name FROM (
@@ -51,11 +51,11 @@ import static java.util.Objects.requireNonNull;
  *
  * <p>we need to use the {@link SelectScope} as a
  * {@link SqlValidatorNamespace} when resolving 'name', and
- * as a {@link SqlValidatorScope} when resolving 'gender'.</p>
+ * as a {@link SqlValidatorScope} when resolving 'gender'.
  *
  * <h2>Scopes</h2>
  *
- * <p>In the query</p>
+ * <p>In the query
  *
  * <blockquote>
  * <pre>
@@ -67,7 +67,7 @@ import static java.util.Objects.requireNonNull;
  * ORDER BY expr4</pre>
  * </blockquote>
  *
- * <p>The scopes available at various points of the query are as follows:</p>
+ * <p>The scopes available at various points of the query are as follows:
  *
  * <ul>
  * <li>expr1 can see t1, t2, q3</li>
@@ -79,7 +79,7 @@ import static java.util.Objects.requireNonNull;
  *
  * <h2>Namespaces</h2>
  *
- * <p>In the above query, there are 4 namespaces:</p>
+ * <p>In the above query, there are 4 namespaces:
  *
  * <ul>
  * <li>t1</li>
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlConformance.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlConformance.java
index 0a400da21a..b8501f02f1 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlConformance.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlConformance.java
@@ -348,6 +348,7 @@ public interface SqlConformance {
 
   /**
    * Whether to allow SQL syntax "{@code ROW(expr1, expr2, expr3)}".
+   *
    * <p>The equivalent syntax in standard SQL is
    * "{@code (expr1, expr2, expr3)}".
    *
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedAggFunction.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedAggFunction.java
index 3384ec6365..d24d2d6df4 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedAggFunction.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedAggFunction.java
@@ -35,7 +35,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
  * User-defined aggregate function.
  *
  * <p>Created by the validator, after resolving a function call to a function
- * defined in a Calcite schema.</p>
+ * defined in a Calcite schema.
  */
 public class SqlUserDefinedAggFunction extends SqlAggFunction {
   public final AggregateFunction function;
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedFunction.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedFunction.java
index b8717a6021..1ff463eef6 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedFunction.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedFunction.java
@@ -37,7 +37,7 @@ import java.util.List;
 * User-defined scalar function.
  *
  * <p>Created by the validator, after resolving a function call to a function
- * defined in a Calcite schema.</p>
+ * defined in a Calcite schema.
 */
 public class SqlUserDefinedFunction extends SqlFunction {
   public final Function function;
@@ -84,6 +84,7 @@ public class SqlUserDefinedFunction extends SqlFunction {
 
   /**
    * Returns function that implements given operator call.
+   *
    * @return function that implements given operator call
    */
   public Function getFunction() {
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedTableFunction.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedTableFunction.java
index 9e811ea15b..818e9fff52 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedTableFunction.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedTableFunction.java
@@ -69,6 +69,7 @@ public class SqlUserDefinedTableFunction extends SqlUserDefinedFunction
 
   /**
    * Returns function that implements given operator call.
+   *
    * @return function that implements given operator call
    */
   @Override public TableFunction getFunction() {
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidator.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidator.java
index d20d9f4a49..23b8115c1b 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidator.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidator.java
@@ -103,17 +103,17 @@ import java.util.function.UnaryOperator;
  * which implement {@link SqlValidatorNamespace}, so don't try to cast your
  * namespace or use <code>instanceof</code>; use
  * {@link SqlValidatorNamespace#unwrap(Class)} and
- * {@link SqlValidatorNamespace#isWrapperFor(Class)} instead.</p>
+ * {@link SqlValidatorNamespace#isWrapperFor(Class)} instead.
  *
  * <p>The validator builds the map by making a quick scan over the query when
  * the root {@link SqlNode} is first provided. Thereafter, it supplies the
- * correct scope or namespace object when it calls validation methods.</p>
+ * correct scope or namespace object when it calls validation methods.
  *
  * <p>The methods {@link #getSelectScope}, {@link #getFromScope},
  * {@link #getWhereScope}, {@link #getGroupScope}, {@link #getHavingScope},
  * {@link #getOrderScope} and {@link #getJoinScope} get the correct scope
  * to resolve
- * names in a particular clause of a SQL statement.</p>
+ * names in a particular clause of a SQL statement.
  */
 @Value.Enclosing
 public interface SqlValidator {
@@ -363,7 +363,7 @@ public interface SqlValidator {
    * <p>Note that the input exception is checked (it derives from
    * {@link Exception}) and the output exception is unchecked (it derives from
    * {@link RuntimeException}). This is intentional -- it should remind code
-   * authors to provide context for their validation errors.</p>
+   * authors to provide context for their validation errors.
    *
    * @param node The place where the exception occurred, not null
    * @param e    The validation error
@@ -520,7 +520,7 @@ public interface SqlValidator {
    * Returns the appropriate scope for validating a particular clause of a
    * SELECT statement.
    *
-   * <p>Consider</p>
+   * <p>Consider
    *
    * <blockquote><pre><code>SELECT *
    * FROM foo
@@ -532,7 +532,7 @@ public interface SqlValidator {
    *    GROUP BY deptno
    *    ORDER BY x)</code></pre></blockquote>
    *
-   * <p>What objects can be seen in each part of the sub-query?</p>
+   * <p>What objects can be seen in each part of the sub-query?
    *
    * <ul>
    * <li>In FROM ({@link #getFromScope} , you can only see 'foo'.
@@ -960,6 +960,7 @@ public interface SqlValidator {
     }
 
     /** Returns the SQL conformance.
+     *
      * @deprecated Use {@link #conformance()} */
     @Deprecated // to be removed before 2.0
     default SqlConformance sqlConformance() {
@@ -970,6 +971,7 @@ public interface SqlValidator {
     Config withConformance(SqlConformance conformance);
 
     /** Sets the SQL conformance of the validator.
+     *
      * @deprecated Use {@link #conformance()} */
     @Deprecated // to be removed before 2.0
     default Config withSqlConformance(SqlConformance conformance) {
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java
index 9e42e9dca9..b7ca08bcc6 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java
@@ -1306,6 +1306,7 @@ public class SqlValidatorImpl implements SqlValidatorWithHints {
 
   /**
    * Namespace for the given node.
+   *
    * @param node node to compute the namespace for
    * @return namespace for the given node, never null
    * @see #getNamespace(SqlNode)
@@ -1319,6 +1320,7 @@ public class SqlValidatorImpl implements SqlValidatorWithHints {
 
   /**
    * Namespace for the given node.
+   *
    * @param node node to compute the namespace for
    * @param scope namespace scope
    * @return namespace for the given node, never null
@@ -1334,6 +1336,7 @@ public class SqlValidatorImpl implements SqlValidatorWithHints {
 
   /**
    * Namespace for the given node.
+   *
    * @param id identifier to resolve
    * @param scope namespace scope
    * @return namespace for the given node, never null
@@ -5029,7 +5032,7 @@ public class SqlValidatorImpl implements SqlValidatorWithHints {
   }
 
   /** Returns whether a query uses {@code DEFAULT} to populate a given
-   *  column. */
+   * column. */
   private static boolean isValuesWithDefault(SqlNode source, int column) {
     switch (source.getKind()) {
     case VALUES:
@@ -7482,15 +7485,15 @@ public class SqlValidatorImpl implements SqlValidatorWithHints {
      * For example:
      *
      * <blockquote><pre>{@code
-     *  SELECT a + a as twoA
-     *  GROUP BY twoA
+     * SELECT a + a as twoA
+     * GROUP BY twoA
      * }</pre></blockquote>
      *
      * <p>turns into
      *
      * <blockquote><pre>{@code
-     *  SELECT a + a as twoA
-     *  GROUP BY a + a
+     * SELECT a + a as twoA
+     * GROUP BY a + a
      * }</pre></blockquote>
      *
      * <p>This is determined both by the clause and the config.
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorNamespace.java
index 432b3fff1a..3de29d403e 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorNamespace.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorNamespace.java
@@ -47,7 +47,7 @@ import java.util.List;
  * {@link SqlValidatorNamespace}. Your SelectNamespace will be there somewhere,
  * but might be one or two levels deep.  Don't try to cast the namespace or use
  * <code>instanceof</code>; use {@link SqlValidatorNamespace#unwrap(Class)} and
- * {@link SqlValidatorNamespace#isWrapperFor(Class)} instead.</p>
+ * {@link SqlValidatorNamespace#isWrapperFor(Class)} instead.
  *
  * @see SqlValidator
  * @see SqlValidatorScope
@@ -87,11 +87,11 @@ public interface SqlValidatorNamespace {
    * Sets the type of this namespace.
    *
    * <p>Allows the type for the namespace to be explicitly set, but usually is
-   * called during {@link #validate(RelDataType)}.</p>
+   * called during {@link #validate(RelDataType)}.
    *
    * <p>Implicitly also sets the row type. If the type is not a struct, then
    * the row type is the type wrapped as a struct with a single column,
-   * otherwise the type and row type are the same.</p>
+   * otherwise the type and row type are the same.
    */
   void setType(RelDataType type);
 
@@ -105,10 +105,10 @@ public interface SqlValidatorNamespace {
   /**
    * Validates this namespace.
    *
-   * <p>If the scope has already been validated, does nothing.</p>
+   * <p>If the scope has already been validated, does nothing.
    *
    * <p>Please call {@link SqlValidatorImpl#validateNamespace} rather than
-   * calling this method directly.</p>
+   * calling this method directly.
    *
    * @param targetRowType Desired row type, must not be null, may be the data
    *                      type 'unknown'.
@@ -200,10 +200,10 @@ public interface SqlValidatorNamespace {
    *
    * <p>A {@code WITH}) clause defines table names that resolve to queries
    * (the body of the with-item). An {@link IdentifierNamespace} typically
-   * resolves to a {@link TableNamespace}.</p>
+   * resolves to a {@link TableNamespace}.
    *
    * <p>You must not call this method before {@link #validate(RelDataType)} has
-   * completed.</p> */
+   * completed. */
   SqlValidatorNamespace resolve();
 
   /** Returns whether this namespace is capable of giving results of the desired
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorUtil.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorUtil.java
index ef52904d0d..ac53fe9de3 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorUtil.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorUtil.java
@@ -214,7 +214,9 @@ public class SqlValidatorUtil {
   }
 
   /**
-   * Gets the bit-set to the column ordinals in the source for columns that intersect in the target.
+   * Gets the bit-set to the column ordinals in the source for columns that
+   * intersect in the target.
+   *
    * @param sourceRowType The source upon which to ordinate the bit set.
    * @param targetRowType The target to overlay on the source to create the bit set.
    */
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/WithScope.java b/core/src/main/java/org/apache/calcite/sql/validate/WithScope.java
index fa9ff77454..58d26a6f1e 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/WithScope.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/WithScope.java
@@ -27,14 +27,14 @@ import java.util.List;
 /** Scope providing the objects that are available after evaluating an item
  * in a WITH clause.
  *
- * <p>For example, in</p>
+ * <p>For example, in
  *
  * <blockquote>{@code WITH t1 AS (q1) t2 AS (q2) q3}</blockquote>
  *
  * <p>{@code t1} provides a scope that is used to validate {@code q2}
  * (and therefore {@code q2} may reference {@code t1}),
  * and {@code t2} provides a scope that is used to validate {@code q3}
- * (and therefore q3 may reference {@code t1} and {@code t2}).</p>
+ * (and therefore q3 may reference {@code t1} and {@code t2}).
  */
 class WithScope extends ListScope {
   private final SqlWithItem withItem;
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercion.java b/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercion.java
index 04c3536b96..e3a6176486 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercion.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercion.java
@@ -47,7 +47,7 @@ import java.util.List;
  * </ul>
  *
  * <p>REFERENCE: <a href="https://docs.microsoft.com/en-us/sql/t-sql/data-types/data-type-conversion-database-engine?">SQL-SERVER</a>
- * <a href="https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types">HIVE</a></p>
+ * <a href="https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types">HIVE</a>
  */
 public interface TypeCoercion {
   /**
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercionImpl.java b/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercionImpl.java
index e51da487dc..23ae94f7ff 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercionImpl.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercionImpl.java
@@ -175,9 +175,8 @@ public class TypeCoercionImpl extends AbstractTypeCoercion {
     return coerced;
   }
 
-  /**
-   * For NUMERIC and STRING operands, cast STRING to data type of the other operand.
-   **/
+  /** For NUMERIC and STRING operands, cast STRING to data type of the other
+   * operand. */
   protected boolean binaryArithmeticWithStrings(
       SqlCallBinding binding,
       RelDataType left,
@@ -211,7 +210,7 @@ public class TypeCoercionImpl extends AbstractTypeCoercion {
   /**
    * Coerces operands in binary comparison expressions.
    *
-   * <p>Rules:</p>
+   * <p>Rules:
    * <ul>
    *   <li>For EQUALS(=) operator: 1. If operands are BOOLEAN and NUMERIC, evaluate
    *   `1=true` and `0=false` all to be true; 2. If operands are datetime and string,
@@ -268,7 +267,7 @@ public class TypeCoercionImpl extends AbstractTypeCoercion {
    * If there are N(more than 2) operands,
    * finds the common type between two operands from left to right:
    *
-   * <p>Rules:</p>
+   * <p>Rules:
    * <pre>
    *   type1     type2    type3
    *    |         |        |
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/implicit/package-info.java b/core/src/main/java/org/apache/calcite/sql/validate/implicit/package-info.java
index 724ba17e51..7e7c87c376 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/implicit/package-info.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/implicit/package-info.java
@@ -60,7 +60,7 @@
  * <p>The supported conversion contexts are:
  * <a href="https://docs.google.com/document/d/1g2RUnLXyp_LjUlO-wbblKuP5hqEu3a_2Mt2k4dh6RwU/edit?usp=sharing">Conversion Expressions</a>
  *
- * <p>Strategies for Finding Common Type:</p>
+ * <p>Strategies for Finding Common Type:
  * <ul>
  *   <li>If the operator has expected data types, just take them as the desired one. i.e. the UDF.
  *   </li>
diff --git a/core/src/main/java/org/apache/calcite/sql2rel/CorrelateProjectExtractor.java b/core/src/main/java/org/apache/calcite/sql2rel/CorrelateProjectExtractor.java
index 3dc7ee839c..2e8029ba3c 100644
--- a/core/src/main/java/org/apache/calcite/sql2rel/CorrelateProjectExtractor.java
+++ b/core/src/main/java/org/apache/calcite/sql2rel/CorrelateProjectExtractor.java
@@ -50,11 +50,13 @@ import java.util.Map;
 import java.util.Set;
 
 /**
- * A visitor for relational expressions that extracts a {@link org.apache.calcite.rel.core.Project}, with a "simple"
- * computation over the correlated variables, from the right side of a correlation
- * ({@link org.apache.calcite.rel.core.Correlate}) and places it on the left side.
+ * A visitor for relational expressions that extracts a
+ * {@link org.apache.calcite.rel.core.Project}, with a "simple" computation over
+ * the correlated variables, from the right side of a correlation
+ * ({@link org.apache.calcite.rel.core.Correlate}) and places it on the left
+ * side.
  *
- * <p>Plan before</p>
+ * <p>Plan before
  * <pre>
  * LogicalCorrelate(correlation=[$cor0], joinType=[left], requiredColumns=[{7}])
  *   LogicalTableScan(table=[[scott, EMP]])
@@ -62,7 +64,7 @@ import java.util.Set;
  *     LogicalTableScan(table=[[scott, DEPT]])
  * </pre>
  *
- * <p>Plan after</p>
+ * <p>Plan after
  * <pre>
  * LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3],... DNAME=[$10], LOC=[$11])
  *   LogicalCorrelate(correlation=[$cor0], joinType=[left], requiredColumns=[{8}])
@@ -72,9 +74,10 @@ import java.util.Set;
  *       LogicalTableScan(table=[[scott, DEPT]])
  * </pre>
  *
- * <p>Essentially this transformation moves the computation over a correlated expression from the
- * inner loop to the outer loop. It materializes the computation on the left side and flattens
- * expressions on correlated variables on the right side.</p>
+ * <p>Essentially this transformation moves the computation over a correlated
+ * expression from the inner loop to the outer loop. It materializes the
+ * computation on the left side and flattens expressions on correlated variables
+ * on the right side.
  */
 @API(since = "1.27", status = API.Status.EXPERIMENTAL)
 public final class CorrelateProjectExtractor extends RelHomogeneousShuttle {
diff --git a/core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java b/core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java
index d40f681799..af342d0f7a 100644
--- a/core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java
+++ b/core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java
@@ -131,7 +131,7 @@ import static java.util.Objects.requireNonNull;
  * from joining the RelNode that produces the corExp with the RelNode that
  * references it.
  *
- * <p>TODO:</p>
+ * <p>TODO:
  * <ul>
  *   <li>replace {@code CorelMap} constructor parameter with a RelNode
  *   <li>make {@link #currentRel} immutable (would require a fresh
diff --git a/core/src/main/java/org/apache/calcite/sql2rel/SqlRexContext.java b/core/src/main/java/org/apache/calcite/sql2rel/SqlRexContext.java
index 6be0882b8a..468e50542d 100644
--- a/core/src/main/java/org/apache/calcite/sql2rel/SqlRexContext.java
+++ b/core/src/main/java/org/apache/calcite/sql2rel/SqlRexContext.java
@@ -50,11 +50,13 @@ public interface SqlRexContext {
    * empty.
    *
    * <p>Returns 0 if the query is implicitly "GROUP BY ()" because of an
-   * aggregate expression. For example, "SELECT sum(sal) FROM emp".</p>
+   * aggregate expression. For example, "SELECT sum(sal) FROM emp".
+   *
+   * <p>Returns -1 if the query is not an aggregate query.
    *
-   * <p>Returns -1 if the query is not an aggregate query.</p>
    * @return 0 if the query is implicitly GROUP BY (), -1 if the query is not
    * and aggregate query
+   *
    * @see org.apache.calcite.sql.SqlOperatorBinding#getGroupCount()
    */
   int getGroupCount();
diff --git a/core/src/main/java/org/apache/calcite/tools/FrameworkConfig.java b/core/src/main/java/org/apache/calcite/tools/FrameworkConfig.java
index 40844f3b79..68f727a318 100644
--- a/core/src/main/java/org/apache/calcite/tools/FrameworkConfig.java
+++ b/core/src/main/java/org/apache/calcite/tools/FrameworkConfig.java
@@ -103,12 +103,12 @@ public interface FrameworkConfig {
    *
    * <p>If the list is not null, the planner first de-registers any
    * existing {@link RelTraitDef}s, then registers the {@code RelTraitDef}s in
-   * this list.</p>
+   * this list.
    *
    * <p>The order of {@code RelTraitDef}s in the list matters if the
    * planner is VolcanoPlanner. The planner calls {@link RelTraitDef#convert} in
    * the order of this list. The most important trait comes first in the list,
-   * followed by the second most important one, etc.</p>
+   * followed by the second most important one, etc.
    */
   @Nullable ImmutableList<RelTraitDef> getTraitDefs();
 
diff --git a/core/src/main/java/org/apache/calcite/tools/Program.java b/core/src/main/java/org/apache/calcite/tools/Program.java
index 0986f9bde5..6a44d67f50 100644
--- a/core/src/main/java/org/apache/calcite/tools/Program.java
+++ b/core/src/main/java/org/apache/calcite/tools/Program.java
@@ -30,8 +30,9 @@ import java.util.List;
  *
  * <p>A planner is a sequence of programs, each of which is sometimes called
  * a "phase".
- * The most typical program is an invocation of the volcano planner with a
- * particular {@link org.apache.calcite.tools.RuleSet}.</p>
+ *
+ * <p>The most typical program is an invocation of the volcano planner with a
+ * particular {@link org.apache.calcite.tools.RuleSet}.
  */
 public interface Program {
   RelNode run(RelOptPlanner planner, RelNode rel,
diff --git a/core/src/main/java/org/apache/calcite/util/BarfingInvocationHandler.java b/core/src/main/java/org/apache/calcite/util/BarfingInvocationHandler.java
index a02cf186c7..50db7bb4bf 100644
--- a/core/src/main/java/org/apache/calcite/util/BarfingInvocationHandler.java
+++ b/core/src/main/java/org/apache/calcite/util/BarfingInvocationHandler.java
@@ -29,7 +29,7 @@ import java.lang.reflect.UndeclaredThrowableException;
  *
  * <p>It is useful when you are prototyping code. You can rapidly create a
  * prototype class which implements the important methods in an interface, then
- * implement other methods as they are called.</p>
+ * implement other methods as they are called.
  *
  * @see DelegatingInvocationHandler
  */
diff --git a/core/src/main/java/org/apache/calcite/util/BitSets.java b/core/src/main/java/org/apache/calcite/util/BitSets.java
index 0ae561c46a..da75bb4fb3 100644
--- a/core/src/main/java/org/apache/calcite/util/BitSets.java
+++ b/core/src/main/java/org/apache/calcite/util/BitSets.java
@@ -307,7 +307,7 @@ public final class BitSets {
   }
 
   /** Populates a {@link BitSet} from an
-   *  {@link ImmutableIntList}. */
+   * {@link ImmutableIntList}. */
   public static void populate(BitSet bitSet, ImmutableIntList list) {
     for (int i = 0; i < list.size(); i++) {
       bitSet.set(list.getInt(i));
diff --git a/core/src/main/java/org/apache/calcite/util/Bug.java b/core/src/main/java/org/apache/calcite/util/Bug.java
index 7bfe470ea0..1ca3a41fb6 100644
--- a/core/src/main/java/org/apache/calcite/util/Bug.java
+++ b/core/src/main/java/org/apache/calcite/util/Bug.java
@@ -39,8 +39,7 @@ package org.apache.calcite.util;
  * the bug. When someone fixes the bug, they will remove the constant and all
  * usages of it. Also, the constant helps track the propagation of the fix: as
  * the fix is integrated into other branches, the constant will be removed from
- * those branches.</p>
- *
+ * those branches.
  */
 public abstract class Bug {
   //~ Static fields/initializers ---------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/util/ChunkList.java b/core/src/main/java/org/apache/calcite/util/ChunkList.java
index 3d29197bb0..7f7ea16250 100644
--- a/core/src/main/java/org/apache/calcite/util/ChunkList.java
+++ b/core/src/main/java/org/apache/calcite/util/ChunkList.java
@@ -34,7 +34,7 @@ import static java.util.Objects.requireNonNull;
  * in chunks of 32 elements.
  *
  * <p>ArrayList has O(n) insertion and deletion into the middle of the list.
- * ChunkList insertion and deletion are O(1).</p>
+ * ChunkList insertion and deletion are O(1).
  *
  * @param <E> element type
  */
diff --git a/core/src/main/java/org/apache/calcite/util/ControlFlowException.java b/core/src/main/java/org/apache/calcite/util/ControlFlowException.java
index bdf19373d1..6da9df1c55 100644
--- a/core/src/main/java/org/apache/calcite/util/ControlFlowException.java
+++ b/core/src/main/java/org/apache/calcite/util/ControlFlowException.java
@@ -21,7 +21,7 @@ package org.apache.calcite.util;
  * use of exceptions which is to signal an error condition.
  *
  * <p>{@code ControlFlowException} does not populate its own stack trace, which
- * makes instantiating one of these (or a sub-class) more efficient.</p>
+ * makes instantiating one of these (or a sub-class) more efficient.
  */
 public class ControlFlowException extends RuntimeException {
   @Override public synchronized Throwable fillInStackTrace() {
diff --git a/core/src/main/java/org/apache/calcite/util/Glossary.java b/core/src/main/java/org/apache/calcite/util/Glossary.java
index 91f7c6c3aa..3ee9c8989c 100644
--- a/core/src/main/java/org/apache/calcite/util/Glossary.java
+++ b/core/src/main/java/org/apache/calcite/util/Glossary.java
@@ -22,7 +22,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
  * A collection of terms.
  *
  * <p>(This is not a real class. It is here so that terms which do not map to
- * classes can be referenced in Javadoc.)</p>
+ * classes can be referenced in Javadoc.)
  */
 public interface Glossary {
   //~ Static fields/initializers ---------------------------------------------
@@ -31,7 +31,7 @@ public interface Glossary {
   /**
    * <p>This table shows how and where the Gang of Four patterns are applied.
    * The table uses information from the GoF book and from a course on
-   * advanced object design taught by Craig Larman.</p>
+   * advanced object design taught by Craig Larman.
    *
    * <p>The patterns are in three groups depicting frequency of use. The
    * patterns in light green are used
@@ -40,7 +40,7 @@ public interface Glossary {
    * <i>infrequently</i> used. The GoF column gives the original Gang Of Four
    * category for the pattern. The Problem and Pattern columns are from
    * Craig's refinement of the type of problems they apply to and a refinement
-   * of the original three pattern categories.</p>
+   * of the original three pattern categories.
    *
    * <table style="border-spacing:0px;padding:3px;border:1px">
    * <caption>
@@ -122,6 +122,7 @@ public interface Glossary {
    * <td>Access Control<br>
    * &nbsp;
    * <hr>
+   *
    * <p>Structural Decomposition of Objects or Subsystems</td>
    * <td>Wrap Many</td>
    * <td><a href="#SingletonPattern">Singleton</a> with <a
@@ -146,6 +147,7 @@ public interface Glossary {
    * <td>Traversal Algorithm<br>
    * &nbsp;
    * <hr>
+   *
    * <p>Access Control</td>
    * <td>Low Coupling</td>
    * <td style="text-align:middle">-</td>
@@ -159,6 +161,7 @@ public interface Glossary {
    * <td>Event Response<br>
    * &nbsp;
    * <hr>
+   *
    * <p>Organization or Communication of Work</td>
    * <td>Low Coupling</td>
    * <td style="text-align:middle">-</td>
@@ -249,6 +252,7 @@ public interface Glossary {
    * <td>Single Algorithm<br>
    * &nbsp;
    * <hr>
+   *
    * <p>Organization or Communication of Work</td>
    * <td>Low Coupling</td>
    * <td style="text-align:middle">-</td>
@@ -271,6 +275,7 @@ public interface Glossary {
    * <td>Interaction between Objects<br>
    * &nbsp;
    * <hr>
+   *
    * <p>Organization or Communication of Work</td>
    * <td>Low Coupling</td>
    * <td style="text-align:middle">-</td>
@@ -361,7 +366,7 @@ public interface Glossary {
    * <p>Note that a common way of implementing a singleton, the so-called <a
    * href="http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html">
    * double-checked locking pattern</a>, is fatally flawed in Java. Don't use
-   * it!</p>
+   * it!
    */
   @Nullable Glossary SINGLETON_PATTERN = null;
 
diff --git a/core/src/main/java/org/apache/calcite/util/Holder.java b/core/src/main/java/org/apache/calcite/util/Holder.java
index ebda064b92..bc5567e8c0 100644
--- a/core/src/main/java/org/apache/calcite/util/Holder.java
+++ b/core/src/main/java/org/apache/calcite/util/Holder.java
@@ -23,9 +23,9 @@ import java.util.function.UnaryOperator;
 /**
  * A mutable slot that can contain one object.
  *
- * <p>A holder is useful for implementing OUT or IN-OUT parameters.</p>
+ * <p>A holder is useful for implementing OUT or IN-OUT parameters.
  *
- * <p>It is possible to sub-class to receive events on get or set.</p>
+ * <p>It is possible to sub-class to receive events on get or set.
  *
  * @param <E> Element type
  */
diff --git a/core/src/main/java/org/apache/calcite/util/ImmutableBitSet.java b/core/src/main/java/org/apache/calcite/util/ImmutableBitSet.java
index 0a46f13748..cd688476f8 100644
--- a/core/src/main/java/org/apache/calcite/util/ImmutableBitSet.java
+++ b/core/src/main/java/org/apache/calcite/util/ImmutableBitSet.java
@@ -499,7 +499,7 @@ public class ImmutableBitSet
    * ordering.
    *
    * <p>Bit sets {@code (), (0), (0, 1), (0, 1, 3), (1), (2, 3)} are in sorted
-   * order.</p>
+   * order.
    */
   @Override public int compareTo(ImmutableBitSet o) {
     int i = 0;
diff --git a/core/src/main/java/org/apache/calcite/util/ImmutableNullableList.java b/core/src/main/java/org/apache/calcite/util/ImmutableNullableList.java
index 2d88c11bf6..34b2ce948d 100644
--- a/core/src/main/java/org/apache/calcite/util/ImmutableNullableList.java
+++ b/core/src/main/java/org/apache/calcite/util/ImmutableNullableList.java
@@ -33,7 +33,7 @@ import java.util.List;
  * An immutable list that may contain null values.
  *
  * <p>If the list cannot contain null values, use
- * {@link com.google.common.collect.ImmutableList}.</p>
+ * {@link com.google.common.collect.ImmutableList}.
  *
  * @param <E> Element type
  */
@@ -52,7 +52,7 @@ public class ImmutableNullableList<E> extends AbstractList<E> {
    *
    * <p>Behavior as
    * {@link com.google.common.collect.ImmutableList#copyOf(java.util.Collection)}
-   * except that this list allows nulls.</p>
+   * except that this list allows nulls.
    */
   public static <E> List<E> copyOf(Collection<? extends E> elements) {
     if (elements instanceof ImmutableNullableList
@@ -107,7 +107,7 @@ public class ImmutableNullableList<E> extends AbstractList<E> {
    *
    * <p>Behavior as
    * {@link com.google.common.collect.ImmutableList#copyOf(Object[])}
-   * except that this list allows nulls.</p>
+   * except that this list allows nulls.
    */
   public static <E> List<E> copyOf(E[] elements) {
     // Check for nulls.
diff --git a/core/src/main/java/org/apache/calcite/util/IntegerIntervalSet.java b/core/src/main/java/org/apache/calcite/util/IntegerIntervalSet.java
index 00ad88c262..207af86e57 100644
--- a/core/src/main/java/org/apache/calcite/util/IntegerIntervalSet.java
+++ b/core/src/main/java/org/apache/calcite/util/IntegerIntervalSet.java
@@ -66,7 +66,7 @@ public class IntegerIntervalSet extends AbstractSet<Integer> {
    * hyphen). For example, "1,2,3-20,-7,-10-15,12".
    *
    * <p>Inclusions and exclusions are performed in the order that they are
-   * seen. For example, "1-10,-2-9,3-7,-4-6"</p> does contain 3, because it is
+   * seen. For example, "1-10,-2-9,3-7,-4-6" does contain 3, because it is
    * included by "1-10", excluded by "-2-9" and last included by "3-7". But it
    * does not include 4.
    *
diff --git a/core/src/main/java/org/apache/calcite/util/JsonBuilder.java b/core/src/main/java/org/apache/calcite/util/JsonBuilder.java
index eeb59699cf..600dbd1459 100644
--- a/core/src/main/java/org/apache/calcite/util/JsonBuilder.java
+++ b/core/src/main/java/org/apache/calcite/util/JsonBuilder.java
@@ -108,7 +108,7 @@ public class JsonBuilder {
    * string.
    *
    * <p>We should use a JSON library such as Jackson when Mondrian needs
-   * one elsewhere.</p>
+   * one elsewhere.
    */
   public String toJsonString(Object o) {
     StringBuilder buf = new StringBuilder();
diff --git a/core/src/main/java/org/apache/calcite/util/Pair.java b/core/src/main/java/org/apache/calcite/util/Pair.java
index 01b07f9fd3..1366018840 100644
--- a/core/src/main/java/org/apache/calcite/util/Pair.java
+++ b/core/src/main/java/org/apache/calcite/util/Pair.java
@@ -170,7 +170,7 @@ public class Pair<T1 extends @Nullable Object, T2 extends @Nullable Object>
    * Converts two lists into a list of {@link Pair}s.
    *
    * <p>The length of the combined list is the lesser of the lengths of the
-   * source lists. But typically the source lists will be the same length.</p>
+   * source lists. But typically the source lists will be the same length.
    *
    * @param ks     Left list
    * @param vs     Right list
@@ -198,7 +198,7 @@ public class Pair<T1 extends @Nullable Object, T2 extends @Nullable Object>
    * Converts two iterables into an iterable of {@link Pair}s.
    *
    * <p>The resulting iterator ends whenever the first of the input iterators
-   * ends. But typically the source iterators will be the same length.</p>
+   * ends. But typically the source iterators will be the same length.
    *
    * @param ks Left iterable
    * @param vs Right iterable
@@ -220,7 +220,7 @@ public class Pair<T1 extends @Nullable Object, T2 extends @Nullable Object>
    *
    * <p>The length of the combined list is the lesser of the lengths of the
    * source arrays. But typically the source arrays will be the same
-   * length.</p>
+   * length.
    *
    * @param ks Left array
    * @param vs Right array
@@ -336,7 +336,7 @@ public class Pair<T1 extends @Nullable Object, T2 extends @Nullable Object>
   /**
    * Returns an iterator that iterates over (i, i + 1) pairs in an iterable.
    *
-   * <p>For example, {@code adjacents([3, 5, 7])} returns [(3, 5), (5, 7)].</p>
+   * <p>For example, {@code adjacents([3, 5, 7])} returns [(3, 5), (5, 7)].
    *
    * @param iterable Source collection
    * @param <T> Element type
@@ -356,7 +356,7 @@ public class Pair<T1 extends @Nullable Object, T2 extends @Nullable Object>
    * Returns an iterator that iterates over (0, i) pairs in an iterable for
    * i &gt; 0.
    *
-   * <p>For example, {@code firstAnd([3, 5, 7])} returns [(3, 5), (3, 7)].</p>
+   * <p>For example, {@code firstAnd([3, 5, 7])} returns [(3, 5), (3, 7)].
    *
    * @param iterable Source collection
    * @param <T> Element type
diff --git a/core/src/main/java/org/apache/calcite/util/PartiallyOrderedSet.java b/core/src/main/java/org/apache/calcite/util/PartiallyOrderedSet.java
index c77ac7f66b..3689f8d8f6 100644
--- a/core/src/main/java/org/apache/calcite/util/PartiallyOrderedSet.java
+++ b/core/src/main/java/org/apache/calcite/util/PartiallyOrderedSet.java
@@ -45,7 +45,7 @@ import static java.util.Objects.requireNonNull;
  *
  * <p>When you create a partially-ordered set ('poset' for short) you must
  * provide an {@link Ordering} that determines the order relation. The
- * ordering must be:</p>
+ * ordering must be:
  *
  * <ul>
  *     <li>reflexive: e.lte(e) returns true;</li>
@@ -56,17 +56,17 @@ import static java.util.Objects.requireNonNull;
  * </ul>
  *
  * <p>Note that not all pairs of elements are related. It is OK if e.lte(f)
- * returns false and f.lte(e) returns false also.</p>
+ * returns false and f.lte(e) returns false also.
  *
  * <p>In addition to the usual set methods, there are methods to determine the
  * immediate parents and children of an element in the set, and method to find
  * all elements which have no parents or no children (i.e. "root" and "leaf"
- * elements).</p>
+ * elements).
  *
  * <p>A lattice is a special kind of poset where there is a unique top and
  * bottom element. You can use a PartiallyOrderedSet for a lattice also. It may
  * be helpful to add the top and bottom elements to the poset on
- * construction.</p>
+ * construction.
  *
  * @param <E> Element type
  */
@@ -806,7 +806,7 @@ public class PartiallyOrderedSet<E> extends AbstractSet<E> {
    * <p>We deliberately do not override {@link #hashCode} or
    * {@link #equals(Object)}. A canonizing map ensures that within a
    * given PartiallyOrderedSet, two nodes are identical if and only if they
-   * contain the same value.</p>
+   * contain the same value.
    *
    * @param <E> Element type
    */
@@ -848,14 +848,14 @@ public class PartiallyOrderedSet<E> extends AbstractSet<E> {
    *
    * <p>To obey the constraints of the partially-ordered set, the function
    * must be consistent with the reflexive, anti-symmetric, and transitive
-   * properties required by a partially ordered set.</p>
+   * properties required by a partially ordered set.
    *
    * <p>For instance, if {@code ordering(foo, foo)} returned false for any
-   * not-null value of foo, it would violate the reflexive property.</p>
+   * not-null value of foo, it would violate the reflexive property.
    *
    * <p>If an ordering violates any of these required properties, the behavior
    * of a {@link PartiallyOrderedSet} is unspecified. (But mayhem is
-   * likely.)</p>
+   * likely.)
    *
    * @param <E> Element type
    */
diff --git a/core/src/main/java/org/apache/calcite/util/Permutation.java b/core/src/main/java/org/apache/calcite/util/Permutation.java
index 4a7cc2709c..b7ddf3b217 100644
--- a/core/src/main/java/org/apache/calcite/util/Permutation.java
+++ b/core/src/main/java/org/apache/calcite/util/Permutation.java
@@ -269,7 +269,7 @@ public class Permutation implements Mapping, Mappings.TargetMapping {
   /**
    * Inserts into the targets.
    *
-   * <p>For example, consider the permutation</p>
+   * <p>For example, consider the permutation
    *
    * <table border="1">
    * <caption>Example permutation</caption>
@@ -292,7 +292,7 @@ public class Permutation implements Mapping, Mappings.TargetMapping {
    * </table>
    *
    * <p>After applying <code>insertTarget(2)</code> every target 2 or higher is
-   * shifted up one.</p>
+   * shifted up one.
    *
    * <table border="1">
    * <caption>Mapping after applying insertTarget(2)</caption>
@@ -317,7 +317,7 @@ public class Permutation implements Mapping, Mappings.TargetMapping {
    * </table>
    *
    * <p>Note that the array has been extended to accommodate the new target, and
-   * the previously unmapped source 5 is mapped to the unused target slot 2.</p>
+   * the previously unmapped source 5 is mapped to the unused target slot 2.
    *
    * @param x Ordinal of position to add to target
    */
@@ -337,7 +337,7 @@ public class Permutation implements Mapping, Mappings.TargetMapping {
   /**
    * Inserts into the sources.
    *
-   * <p>Behavior is analogous to {@link #insertTarget(int)}.</p>
+   * <p>Behavior is analogous to {@link #insertTarget(int)}.
    *
    * @param x Ordinal of position to add to source
    */
diff --git a/core/src/main/java/org/apache/calcite/util/PrecedenceClimbingParser.java b/core/src/main/java/org/apache/calcite/util/PrecedenceClimbingParser.java
index 1f9ff227e8..7eb5ed6989 100644
--- a/core/src/main/java/org/apache/calcite/util/PrecedenceClimbingParser.java
+++ b/core/src/main/java/org/apache/calcite/util/PrecedenceClimbingParser.java
@@ -238,6 +238,7 @@ public class PrecedenceClimbingParser {
 
     /**
      * Returns {@code o}.
+     *
      * @return o
      */
     public @Nullable Object o() {
diff --git a/core/src/main/java/org/apache/calcite/util/ReflectiveVisitDispatcher.java b/core/src/main/java/org/apache/calcite/util/ReflectiveVisitDispatcher.java
index 0de6735142..6f55e02671 100644
--- a/core/src/main/java/org/apache/calcite/util/ReflectiveVisitDispatcher.java
+++ b/core/src/main/java/org/apache/calcite/util/ReflectiveVisitDispatcher.java
@@ -80,7 +80,7 @@ public interface ReflectiveVisitDispatcher<R extends ReflectiveVisitor,
    * <p>Visit method lookup follows the same rules as if compile-time resolution
    * for VisitorClass.visit(VisiteeClass) were performed. An ambiguous match due
    * to multiple interface inheritance results in an IllegalArgumentException. A
-   * non-match is indicated by returning false.</p>
+   * non-match is indicated by returning false.
    *
    * @param visitor         object whose visit method is to be invoked
    * @param visitee         object to be passed as a parameter to the visit
diff --git a/core/src/main/java/org/apache/calcite/util/Static.java b/core/src/main/java/org/apache/calcite/util/Static.java
index b000e69785..f31e406277 100644
--- a/core/src/main/java/org/apache/calcite/util/Static.java
+++ b/core/src/main/java/org/apache/calcite/util/Static.java
@@ -33,7 +33,7 @@ import java.util.List;
  * <li>Code that uses these objects will be terser.
  * </ul>
  *
- * <p>Cons:</p>
+ * <p>Cons:
  * <ul>
  * <li>Namespace pollution,
  * <li>code that is difficult to understand (a general problem with static
diff --git a/core/src/main/java/org/apache/calcite/util/TimestampString.java b/core/src/main/java/org/apache/calcite/util/TimestampString.java
index 559df8805d..478bb0d518 100644
--- a/core/src/main/java/org/apache/calcite/util/TimestampString.java
+++ b/core/src/main/java/org/apache/calcite/util/TimestampString.java
@@ -63,7 +63,7 @@ public class TimestampString implements Comparable<TimestampString> {
   }
 
   /** Creates a TimestampString for year, month, day, hour, minute, second,
-   *  millisecond values. */
+   * millisecond values. */
   public TimestampString(int year, int month, int day, int h, int m, int s) {
     this(ymdhms(new StringBuilder(), year, month, day, h, m, s).toString());
   }
diff --git a/core/src/main/java/org/apache/calcite/util/TimestampWithTimeZoneString.java b/core/src/main/java/org/apache/calcite/util/TimestampWithTimeZoneString.java
index 7a0baeec0c..752fa12f25 100644
--- a/core/src/main/java/org/apache/calcite/util/TimestampWithTimeZoneString.java
+++ b/core/src/main/java/org/apache/calcite/util/TimestampWithTimeZoneString.java
@@ -58,8 +58,8 @@ public class TimestampWithTimeZoneString
     this.v = v;
   }
 
-  /** Creates a TimestampWithTimeZoneString for year, month, day, hour, minute, second,
-   *  millisecond values in the given time-zone. */
+  /** Creates a TimestampWithTimeZoneString for year, month, day, hour, minute,
+   * second, millisecond values in the given time-zone. */
   public TimestampWithTimeZoneString(int year, int month, int day, int h, int m, int s,
       String timeZone) {
     this(DateTimeStringUtils.ymdhms(new StringBuilder(), year, month, day, h, m, s).toString()
diff --git a/core/src/main/java/org/apache/calcite/util/UnmodifiableArrayList.java b/core/src/main/java/org/apache/calcite/util/UnmodifiableArrayList.java
index 02fb2d1e6d..afc3f0ac56 100644
--- a/core/src/main/java/org/apache/calcite/util/UnmodifiableArrayList.java
+++ b/core/src/main/java/org/apache/calcite/util/UnmodifiableArrayList.java
@@ -24,12 +24,12 @@ import java.util.RandomAccess;
  * A view onto an array that cannot be modified by the client.
  *
  * <p>Since the array is not copied, modifications to the array will be
- * reflected in the list.</p>
+ * reflected in the list.
  *
- * <p>Null elements are allowed.</p>
+ * <p>Null elements are allowed.
  *
  * <p>Quick and low-memory, like {@link java.util.Arrays#asList(Object[])}, but
- * unmodifiable.</p>
+ * unmodifiable.
  *
  * @param <E> Element type
  */
diff --git a/core/src/main/java/org/apache/calcite/util/Util.java b/core/src/main/java/org/apache/calcite/util/Util.java
index 0d76d416bf..788d62f319 100644
--- a/core/src/main/java/org/apache/calcite/util/Util.java
+++ b/core/src/main/java/org/apache/calcite/util/Util.java
@@ -134,7 +134,7 @@ public class Util {
    * <p>In general, you should not use this in expected results of tests.
    * Expected results should be the expected result on Linux (or Mac OS) using
    * '\n'. Apply {@link Util#toLinux(String)} to Windows actual results, if
-   * necessary, to make them look like Linux actual.</p>
+   * necessary, to make them look like Linux actual.
    */
   public static final String LINE_SEPARATOR =
       System.getProperty("line.separator");
@@ -508,7 +508,7 @@ public class Util {
    * prints <code>"x\"y"</code>.
    *
    * <p>The appendable where the value is printed must not incur I/O operations. This method is
-   * not meant to be used for writing the values to permanent storage.</p>
+   * not meant to be used for writing the values to permanent storage.
    *
    * @throws IllegalStateException if the print to the specified appendable fails due to I/O
    */
@@ -689,16 +689,16 @@ public class Util {
    *
    * <p>The mapping is one-to-one (that is, distinct strings will produce
    * distinct java identifiers). The mapping is also reversible, but the
-   * inverse mapping is not implemented.</p>
+   * inverse mapping is not implemented.
    *
    * <p>A valid Java identifier must start with a Unicode letter, underscore,
    * or dollar sign ($). The other characters, if any, can be a Unicode
-   * letter, underscore, dollar sign, or digit.</p>
+   * letter, underscore, dollar sign, or digit.
    *
    * <p>This method uses an algorithm similar to URL encoding. Valid
    * characters are unchanged; invalid characters are converted to an
    * underscore followed by the hex code of the character; and underscores are
-   * doubled.</p>
+   * doubled.
    *
    * <p>Examples:
    *
@@ -747,6 +747,7 @@ public class Util {
 
   /**
    * Returns true when input string is a valid Java identifier.
+   *
    * @param s input string
    * @return true when input string is a valid Java identifier
    */
@@ -946,8 +947,10 @@ public class Util {
   /**
    * This method rethrows input throwable as is (if its unchecked) or
    * wraps it with {@link RuntimeException} and throws.
-   * <p>The typical usage would be {@code throw throwAsRuntime(...)}, where {@code throw} statement
-   * is needed so Java compiler knows the execution stops at that line.</p>
+   *
+   * <p>The typical usage would be {@code throw throwAsRuntime(...)}, where
+   * {@code throw} statement is needed so Java compiler knows the execution
+   * stops at that line.
    *
    * @param throwable input throwable
    * @return the method never returns, it always throws an unchecked exception
@@ -959,10 +962,12 @@ public class Util {
   }
 
   /**
-   * This method rethrows input throwable as is (if its unchecked) with an extra message or
-   * wraps it with {@link RuntimeException} and throws.
-   * <p>The typical usage would be {@code throw throwAsRuntime(...)}, where {@code throw} statement
-   * is needed so Java compiler knows the execution stops at that line.</p>
+   * This method rethrows input throwable as is (if its unchecked) with an extra
+   * message or wraps it with {@link RuntimeException} and throws.
+   *
+   * <p>The typical usage would be {@code throw throwAsRuntime(...)}, where
+   * {@code throw} statement is needed so Java compiler knows the execution
+   * stops at that line.
    *
    * @param throwable input throwable
    * @return the method never returns, it always throws an unchecked exception
@@ -1000,6 +1005,7 @@ public class Util {
 
   /**
    * Returns cause of the given throwable if it is non-null or the throwable itself.
+   *
    * @param throwable input throwable
    * @return cause of the given throwable if it is non-null or the throwable itself
    */
@@ -1475,7 +1481,7 @@ public class Util {
    * <li>'time' has the same format as 'offset', and defaults to 02:00:00.</li>
    * </ul>
    *
-   * <p>For example:</p>
+   * <p>For example:
    *
    * <ul>
    * <li>"PST-8PDT01:00:00,M4.1.0/02:00:00,M10.1.0/02:00:00"; or more tersely
@@ -2001,11 +2007,11 @@ public class Util {
    * starting at element {@code k}.
    *
    * <p>It is OK if the list is empty or its size is not a multiple of
-   * {@code n}.</p>
+   * {@code n}.
    *
    * <p>For instance, {@code quotientList(list, 2, 0)} returns the even
    * elements of a list, and {@code quotientList(list, 2, 1)} returns the odd
-   * elements. Those lists are the same length only if list has even size.</p>
+   * elements. Those lists are the same length only if list has even size.
    */
   public static <E> List<E> quotientList(
       final List<E> list, final int n, final int k) {
@@ -2372,7 +2378,7 @@ public class Util {
   /** Converts a number into human-readable form, with 3 digits and a "K", "M"
    * or "G" multiplier for thousands, millions or billions.
    *
-   * <p>Examples: -2, 0, 1, 999, 1.00K, 1.99K, 3.45M, 4.56B.</p>
+   * <p>Examples: -2, 0, 1, 999, 1.00K, 1.99K, 3.45M, 4.56B.
    */
   public static String human(double d) {
     if (d == 0d) {
diff --git a/core/src/main/java/org/apache/calcite/util/XmlOutput.java b/core/src/main/java/org/apache/calcite/util/XmlOutput.java
index 8fef221e86..f802621a5a 100644
--- a/core/src/main/java/org/apache/calcite/util/XmlOutput.java
+++ b/core/src/main/java/org/apache/calcite/util/XmlOutput.java
@@ -36,7 +36,7 @@ import static java.util.Objects.requireNonNull;
  * <p>Use this class to write XML to any streaming source.
  * While the class itself is unstructured and doesn't enforce any DTD
  * specification, use of the class
- * does ensure that the output is syntactically valid XML.</p>
+ * does ensure that the output is syntactically valid XML.
  */
 public class XmlOutput {
 
@@ -246,6 +246,7 @@ public class XmlOutput {
    * Completes a tag.  This outputs the end tag corresponding to the
    * last exposed beginTag.  The tag name must match the name of the
    * corresponding beginTag.
+   *
    * @param tagName the name of the end tag to write.
    */
   public void endTag(String tagName) {
@@ -432,7 +433,7 @@ public class XmlOutput {
   }
 
   /**
-   *  Write header. Use default version 1.0.
+   * Write header. Use default version 1.0.
    */
   public void header() {
     out.println("<?xml version=\"1.0\" ?>");
@@ -475,6 +476,7 @@ public class XmlOutput {
    * Encode a String for XML output, displaying it to a PrintWriter.
    * The String to be encoded is displayed, except that
    * special characters are converted into entities.
+   *
    * @param input a String to convert.
    * @param out a PrintWriter to which to write the results.
    */
@@ -510,7 +512,7 @@ public class XmlOutput {
    * CDATA section.  Note that MSXML has a nasty bug whereby whitespace
    * characters outside of a CDATA section are lost when parsing.  To
    * avoid hitting this bug, this method treats many whitespace characters
-   * as "special".</p>
+   * as "special".
    *
    * @param input the String to scan for XML special characters.
    * @return true if the String contains any such characters.
@@ -543,7 +545,7 @@ public class XmlOutput {
    * state.  Call {@link #defineEscape} as many times as necessary to set up
    * mappings, and then call {@link #makeImmutable} before
    * actually applying the defined transform.  Or,
-   * use one of the global mappings pre-defined here.</p>
+   * use one of the global mappings pre-defined here.
    */
   static class StringEscaper implements Cloneable {
     private @Nullable List<@Nullable String> translationVector;
diff --git a/core/src/main/java/org/apache/calcite/util/format/FormatElement.java b/core/src/main/java/org/apache/calcite/util/format/FormatElement.java
index ef5c230510..8346088ac4 100644
--- a/core/src/main/java/org/apache/calcite/util/format/FormatElement.java
+++ b/core/src/main/java/org/apache/calcite/util/format/FormatElement.java
@@ -37,7 +37,7 @@ public interface FormatElement {
    *
    * <p>Note that certain FormatElements may not have a Java equivalent.
    * In such cases, calling this method will throw an {@link UnsupportedOperationException}.
-   * See {@link FormatElementEnum#Q} as an example.</p>
+   * See {@link FormatElementEnum#Q} as an example.
    */
   void toPattern(StringBuilder sb) throws UnsupportedOperationException;
 
diff --git a/core/src/main/java/org/apache/calcite/util/graph/Graphs.java b/core/src/main/java/org/apache/calcite/util/graph/Graphs.java
index adf094c7dc..de230db779 100644
--- a/core/src/main/java/org/apache/calcite/util/graph/Graphs.java
+++ b/core/src/main/java/org/apache/calcite/util/graph/Graphs.java
@@ -116,7 +116,7 @@ public class Graphs {
      * Returns an iterator of all paths between two nodes,
      * in non-decreasing order of path lengths.
      *
-     * <p>The current implementation is not optimal.</p>
+     * <p>The current implementation is not optimal.
      */
     public List<List<V>> getPaths(V from, V to) {
       List<List<V>> list = new ArrayList<>();
@@ -130,6 +130,7 @@ public class Graphs {
 
     /**
      * Returns the shortest distance between two points, -1, if there is no path.
+     *
      * @param from From
      * @param to To
      * @return The shortest distance, -1, if there is no path.
diff --git a/core/src/main/java/org/apache/calcite/util/mapping/IntPair.java b/core/src/main/java/org/apache/calcite/util/mapping/IntPair.java
index e73bc47fa8..1c64c9e978 100644
--- a/core/src/main/java/org/apache/calcite/util/mapping/IntPair.java
+++ b/core/src/main/java/org/apache/calcite/util/mapping/IntPair.java
@@ -127,7 +127,7 @@ public class IntPair {
    * Converts two lists into a list of {@link IntPair}s.
    *
    * <p>The length of the combined list is the lesser of the lengths of the
-   * source lists. But typically the source lists will be the same length.</p>
+   * source lists. But typically the source lists will be the same length.
    *
    * @param lefts Left list
    * @param rights Right list
diff --git a/core/src/main/java/org/apache/calcite/util/mapping/Mappings.java b/core/src/main/java/org/apache/calcite/util/mapping/Mappings.java
index a9bf7d9b1a..c476a96edb 100644
--- a/core/src/main/java/org/apache/calcite/util/mapping/Mappings.java
+++ b/core/src/main/java/org/apache/calcite/util/mapping/Mappings.java
@@ -313,7 +313,8 @@ public abstract class Mappings {
    * {@code mapping.getTarget(source)} and {@code list.size()} is
    * {@code mapping.getSourceCount()}.
    *
-   * <p>Converse of {@link #target(List, int)}</p>
+   * <p>Converse of {@link #target(List, int)}.
+   *
    * @see #asListNonNull(TargetMapping)
    */
   @CheckReturnValue
@@ -335,9 +336,10 @@ public abstract class Mappings {
    * {@code mapping.getTarget(source)} and {@code list.size()} is
    * {@code mapping.getSourceCount()}.
    *
-   * <p>The resulting list never contains null elements</p>
+   * <p>The resulting list never contains null elements.
+   *
+   * <p>Converse of {@link #target(List, int)}.
    *
-   * <p>Converse of {@link #target(List, int)}</p>
    * @see #asList(TargetMapping)
    */
   @CheckReturnValue
@@ -423,7 +425,7 @@ public abstract class Mappings {
 
   /** Creates a bijection.
    *
-   * <p>Throws if sources and targets are not one to one.</p> */
+   * <p>Throws if sources and targets are not one to one. */
   public static Mapping bijection(List<Integer> targets) {
     return new Permutation(Ints.toArray(targets));
   }
@@ -481,14 +483,14 @@ public abstract class Mappings {
   /**
    * Creates a mapping that consists of a set of contiguous ranges.
    *
-   * <p>For example,</p>
+   * <p>For example,
    *
    * <blockquote><pre>createShiftMapping(60,
    *     100, 0, 3,
    *     200, 50, 5);
    * </pre></blockquote>
    *
-   * <p>creates</p>
+   * <p>creates
    *
    * <table>
    * <caption>Example mapping</caption>
@@ -545,7 +547,7 @@ public abstract class Mappings {
   /**
    * Creates a mapping by appending two mappings.
    *
-   * <p>Sources and targets of the second mapping are shifted to the right.</p>
+   * <p>Sources and targets of the second mapping are shifted to the right.
    *
    * <p>For example, <pre>append({0:0, 1:1}, {0:0, 1:1, 2:2})</pre> yields
    * <pre>{0:0, 1:1, 2:2, 3:3, 4:4}</pre>.
diff --git a/core/src/test/java/org/apache/calcite/examples/foodmart/java/JdbcExample.java b/core/src/test/java/org/apache/calcite/examples/foodmart/java/JdbcExample.java
index 89ab315197..0988544f93 100644
--- a/core/src/test/java/org/apache/calcite/examples/foodmart/java/JdbcExample.java
+++ b/core/src/test/java/org/apache/calcite/examples/foodmart/java/JdbcExample.java
@@ -29,7 +29,7 @@ import java.sql.Statement;
 /**
  * Example of using Calcite via JDBC.
  *
- * <p>Schema is specified programmatically.</p>
+ * <p>Schema is specified programmatically.
  */
 public class JdbcExample {
   public static void main(String[] args) throws Exception {
diff --git a/core/src/test/java/org/apache/calcite/rex/RexProgramBuilderBase.java b/core/src/test/java/org/apache/calcite/rex/RexProgramBuilderBase.java
index 5273a86ebb..bc2b51da29 100644
--- a/core/src/test/java/org/apache/calcite/rex/RexProgramBuilderBase.java
+++ b/core/src/test/java/org/apache/calcite/rex/RexProgramBuilderBase.java
@@ -234,7 +234,7 @@ public abstract class RexProgramBuilderBase {
   /**
    * Creates a call to the CAST operator.
    *
-   * <p>This method enables to create {@code CAST(42 nullable int)} expressions.</p>
+   * <p>This method enables to create {@code CAST(42 nullable int)} expressions.
    *
    * @param e input node
    * @param type type to cast to
@@ -250,7 +250,7 @@ public abstract class RexProgramBuilderBase {
    *
    * <p>Tries to expand the cast, and therefore the result may be something
    * other than a {@link RexCall} to the CAST operator, such as a
-   * {@link RexLiteral}.</p>
+   * {@link RexLiteral}.
 
    * @param e input node
    * @param type type to cast to
@@ -514,6 +514,7 @@ public abstract class RexProgramBuilderBase {
   /**
    * Creates {@code nullable boolean variable} with index of 0.
    * If you need several distinct variables, use {@link #vBool(int)}
+   *
    * @return nullable boolean variable with index of 0
    */
   protected RexNode vBool() {
diff --git a/core/src/test/java/org/apache/calcite/test/JdbcFrontJdbcBackLinqMiddleTest.java b/core/src/test/java/org/apache/calcite/test/JdbcFrontJdbcBackLinqMiddleTest.java
index 48293f6515..e57783734a 100644
--- a/core/src/test/java/org/apache/calcite/test/JdbcFrontJdbcBackLinqMiddleTest.java
+++ b/core/src/test/java/org/apache/calcite/test/JdbcFrontJdbcBackLinqMiddleTest.java
@@ -111,7 +111,7 @@ class JdbcFrontJdbcBackLinqMiddleTest {
    * into input0.x = input1.x and ... input0.z = input1.z.
    *
    * <p>Currently, the query can be planned, but the plan is not efficient (uses
-   * cartesian product).</p>
+   * cartesian product).
    */
   @Disabled("non-deterministic on JDK 1.7 vs 1.8")
   @Test void testJoinTheta() {
diff --git a/core/src/test/java/org/apache/calcite/test/JdbcFrontJdbcBackTest.java b/core/src/test/java/org/apache/calcite/test/JdbcFrontJdbcBackTest.java
index c8a9e1a68d..4bb84046b6 100644
--- a/core/src/test/java/org/apache/calcite/test/JdbcFrontJdbcBackTest.java
+++ b/core/src/test/java/org/apache/calcite/test/JdbcFrontJdbcBackTest.java
@@ -38,7 +38,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
  *
  * <p>The idea is that as much as possible of the query is pushed down
  * to the JDBC data source, in the form of a large (and hopefully efficient)
- * SQL statement.</p>
+ * SQL statement.
  *
  * @see JdbcFrontJdbcBackLinqMiddleTest
  */
diff --git a/core/src/test/java/org/apache/calcite/test/JdbcFrontLinqBackTest.java b/core/src/test/java/org/apache/calcite/test/JdbcFrontLinqBackTest.java
index 5554c7195c..ad95e5f06e 100644
--- a/core/src/test/java/org/apache/calcite/test/JdbcFrontLinqBackTest.java
+++ b/core/src/test/java/org/apache/calcite/test/JdbcFrontLinqBackTest.java
@@ -119,7 +119,7 @@ public class JdbcFrontLinqBackTest {
    * Simple UNION, plus ORDER BY.
    *
    * <p>Also tests a query that returns a single column. We optimize this case
-   * internally, using non-array representations for rows.</p>
+   * internally, using non-array representations for rows.
    */
   @Test void testUnionAllOrderBy() {
     hr()
diff --git a/core/src/test/java/org/apache/calcite/test/JdbcTest.java b/core/src/test/java/org/apache/calcite/test/JdbcTest.java
index 866fc8bbc2..9a7dbf43f2 100644
--- a/core/src/test/java/org/apache/calcite/test/JdbcTest.java
+++ b/core/src/test/java/org/apache/calcite/test/JdbcTest.java
@@ -561,25 +561,25 @@ public class JdbcTest {
   }
 
   /** Tests a JDBC connection that provides a model that contains a table
-   *  macro. */
+   * macro. */
   @Test void testTableMacroInModel() throws Exception {
     checkTableMacroInModel(Smalls.TableMacroFunction.class);
   }
 
   /** Tests a JDBC connection that provides a model that contains a table
-   *  macro defined as a static method. */
+   * macro defined as a static method. */
   @Test void testStaticTableMacroInModel() throws Exception {
     checkTableMacroInModel(Smalls.StaticTableMacroFunction.class);
   }
 
   /** Tests a JDBC connection that provides a model that contains a table
-   *  function. */
+   * function. */
   @Test void testTableFunctionInModel() throws Exception {
     checkTableFunctionInModel(Smalls.MyTableFunction.class);
   }
 
   /** Tests a JDBC connection that provides a model that contains a table
-   *  function defined as a static method. */
+   * function defined as a static method. */
   @Test void testStaticTableFunctionInModel() throws Exception {
     checkTableFunctionInModel(Smalls.TestStaticTableFunction.class);
   }
@@ -1577,7 +1577,7 @@ public class JdbcTest {
    * <p>With
    * <a href="https://issues.apache.org/jira/browse/CALCITE-127">[CALCITE-127]
    * EnumerableCalcRel can't support 3+ AND conditions</a>, the last condition
-   * is ignored and rows with deptno=10 are wrongly returned.</p>
+   * is ignored and rows with deptno=10 are wrongly returned.
    */
   @Test void testAnd3() {
     CalciteAssert.hr()
@@ -2836,7 +2836,7 @@ public class JdbcTest {
    * into a VARCHAR column the behavior would be different; the literals
    * would be converted into VARCHAR(3) values and the implied cast from
    * CHAR(1) to CHAR(3) that appends trailing spaces does not occur. See
-   * "contextually typed value specification" in the SQL spec.</p>
+   * "contextually typed value specification" in the SQL spec.
    */
   @Test void testValuesComposite() {
     CalciteAssert.that()
@@ -4635,7 +4635,7 @@ public class JdbcTest {
    * <a href="https://issues.apache.org/jira/browse/CALCITE-285">[CALCITE-285]
    * Window functions throw exception without ORDER BY</a>.
    *
-   * <p>Note:</p>
+   * <p>Note:
    *
    * <ul>
    * <li>With no ORDER BY, the window is over all rows in the partition.
diff --git a/core/src/test/java/org/apache/calcite/test/LatticeTest.java b/core/src/test/java/org/apache/calcite/test/LatticeTest.java
index 030b72b496..75c3d9b676 100644
--- a/core/src/test/java/org/apache/calcite/test/LatticeTest.java
+++ b/core/src/test/java/org/apache/calcite/test/LatticeTest.java
@@ -420,7 +420,7 @@ class LatticeTest {
   }
 
   /** A query that uses a pre-defined aggregate table, at the same
-   *  granularity but fewer calls to aggregate functions. */
+   * granularity but fewer calls to aggregate functions. */
   @Test void testLatticeWithPreDefinedTilesFewerMeasures() {
     foodmartModelWithOneTile()
         .query("select t.\"the_year\", t.\"quarter\", count(*) as c\n"
diff --git a/core/src/test/java/org/apache/calcite/test/RelBuilderTest.java b/core/src/test/java/org/apache/calcite/test/RelBuilderTest.java
index 68f5ae9aba..d24b7a2674 100644
--- a/core/src/test/java/org/apache/calcite/test/RelBuilderTest.java
+++ b/core/src/test/java/org/apache/calcite/test/RelBuilderTest.java
@@ -136,7 +136,7 @@ import static org.junit.jupiter.api.Assertions.fail;
 /**
  * Unit test for {@link RelBuilder}.
  *
- * <p>Tasks:</p>
+ * <p>Tasks:
  * <ol>
  *   <li>Add RelBuilder.scan(List&lt;String&gt;)</li>
  *   <li>Add RelBuilder.scan(Table)</li>
diff --git a/core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java b/core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
index 6bbedf8e75..150fa85f25 100644
--- a/core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
+++ b/core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
@@ -534,7 +534,8 @@ class RelOptRulesTest extends RelOptTestBase {
   }
 
   /** As {@link #testJoinDeriveIsNotNullFilterRule1()};
-   *  should not create IS NOT NULL filter if join condition is not strong wrt each key. */
+   * should not create IS NOT NULL filter if join condition is not strong wrt
+   * each key. */
   @Test void testJoinDeriveIsNotNullFilterRule13() {
     final String sql = "select t1.deptno from empnullables t1 inner join\n"
         + "empnullables t2 on coalesce(t1.ename, t2.ename) = 'abc'";
@@ -542,7 +543,8 @@ class RelOptRulesTest extends RelOptTestBase {
   }
 
   /** As {@link #testJoinDeriveIsNotNullFilterRule1()};
-   *  should not create IS NOT NULL filter if join condition is not strong wrt each key. */
+   * should not create IS NOT NULL filter if join condition is not strong wrt
+   * each key. */
   @Test void testJoinDeriveIsNotNullFilterRule14() {
     final String sql = "select t1.deptno from empnullables t1 inner join\n"
         + "empnullables t2 on nvl(t1.ename, t2.ename) = 'abc'";
@@ -553,7 +555,7 @@ class RelOptRulesTest extends RelOptTestBase {
   }
 
   /** As {@link #testJoinDeriveIsNotNullFilterRule1()};
-   *  should create IS NOT NULL filter only for the first operand of NULLIF. */
+   * should create IS NOT NULL filter only for the first operand of NULLIF. */
   @Test void testJoinDeriveIsNotNullFilterRule15() {
     final String sql = "select t1.deptno from empnullables t1 inner join\n"
         + "empnullables t2 on nullif(t1.ename, t2.ename) = 'abc'";
@@ -1499,7 +1501,7 @@ class RelOptRulesTest extends RelOptTestBase {
   }
 
   /** Tests implementing multiple distinct count the new way, using GROUPING
-   *  SETS. */
+   * SETS. */
   @Test void testDistinctCountMultiple() {
     final String sql = "select deptno, count(distinct ename),\n"
         + "  count(distinct job)\n"
@@ -3273,7 +3275,7 @@ class RelOptRulesTest extends RelOptTestBase {
   }
 
   /** Test case that reduces a nullable expression to a NOT NULL literal that
-   *  is cast to nullable. */
+   * is cast to nullable. */
   @Test void testReduceNullableToNotNull() {
     checkReduceNullableToNotNull(CoreRules.PROJECT_REDUCE_EXPRESSIONS);
   }
@@ -7822,13 +7824,13 @@ class RelOptRulesTest extends RelOptTestBase {
     }
   }
 
-  /**
-   * Test case for <a href="https://issues.apache.org/jira/browse/CALCITE-4652">[CALCITE-4652]
-   * AggregateExpandDistinctAggregatesRule must cast top aggregates to original type</a>.
-   * <p>
-   * Checks AggregateExpandDistinctAggregatesRule when return type of the SUM aggregate
-   * is changed (expanded) by define custom type factory.
-   */
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4652">[CALCITE-4652]
+   * AggregateExpandDistinctAggregatesRule must cast top aggregates to original
+   * type</a>.
+   *
+   * <p>Checks AggregateExpandDistinctAggregatesRule when return type of the SUM
+   * aggregate is changed (expanded) by define custom type factory. */
   @Test void testDistinctCountWithExpandSumType() {
     // Define new type system to expand SUM return type.
     RelDataTypeSystemImpl typeSystem = new RelDataTypeSystemImpl() {
@@ -7861,13 +7863,13 @@ class RelOptRulesTest extends RelOptTestBase {
         .check();
   }
 
-  /**
-   * Test case for <a href="https://issues.apache.org/jira/browse/CALCITE-4818">[CALCITE-4818]
-   * AggregateExpandDistinctAggregatesRule must infer correct data type for top aggregate calls</a>.
-   * <p>
-   * Checks AggregateExpandDistinctAggregatesRule when return type of the SUM aggregate
-   * is changed (expanded) by define custom type factory.
-   */
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4818">[CALCITE-4818]
+   * AggregateExpandDistinctAggregatesRule must infer correct data type for top
+   * aggregate calls</a>.
+   *
+   * <p>Checks AggregateExpandDistinctAggregatesRule when return type of the SUM
+   * aggregate is changed (expanded) by define custom type factory. */
   @Test void testSumAndDistinctSumWithExpandSumType() {
     // Define new type system to expand SUM return type.
     RelDataTypeSystemImpl typeSystem = new RelDataTypeSystemImpl() {
diff --git a/core/src/test/java/org/apache/calcite/test/SqlHintsConverterTest.java b/core/src/test/java/org/apache/calcite/test/SqlHintsConverterTest.java
index 6eec68fdb6..ff4b549fa0 100644
--- a/core/src/test/java/org/apache/calcite/test/SqlHintsConverterTest.java
+++ b/core/src/test/java/org/apache/calcite/test/SqlHintsConverterTest.java
@@ -717,7 +717,7 @@ class SqlHintsConverterTest {
     }
   }
 
-  /** A visitor to validate a hintable node has specific hint. **/
+  /** A visitor to validate a hintable node has specific hint. */
   private static class ValidateHintVisitor extends RelVisitor {
     private final RelHint expectedHint;
     private final Class<?> clazz;
diff --git a/core/src/test/java/org/apache/calcite/test/SqlToRelConverterTest.java b/core/src/test/java/org/apache/calcite/test/SqlToRelConverterTest.java
index 0c2c910f28..5c825720ef 100644
--- a/core/src/test/java/org/apache/calcite/test/SqlToRelConverterTest.java
+++ b/core/src/test/java/org/apache/calcite/test/SqlToRelConverterTest.java
@@ -452,8 +452,11 @@ class SqlToRelConverterTest extends SqlToRelTestBase {
    * Incorrect plan in with with ROLLUP inside GROUPING SETS</a>.
    *
    * <p>Equivalence example:
+   *
    * <blockquote>GROUP BY GROUPING SETS (ROLLUP(A, B), CUBE(C,D))</blockquote>
+   *
    * <p>is equal to
+   *
    * <blockquote>GROUP BY GROUPING SETS ((A,B), (A), (),
    * (C,D), (C), (D) )</blockquote>
    */
diff --git a/core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java b/core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java
index fc19a17aca..538333dfee 100644
--- a/core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java
+++ b/core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java
@@ -2760,10 +2760,9 @@ public class SqlValidatorTest extends SqlValidatorTestCase {
     invalidCodes.forEach(invalidConsumer);
   }
 
-  /** Checks parsing of built-in functions that accept time unit
-   *  Checks WEEK(WEEKDAY)
-   * <p>Override if your parser supports more such functions. */
-  @Test void checkWeekdayCustomTimeFrames() {
+  /** Tests parsing of built-in functions that accept time unit
+   * "WEEK(WEEKDAY)". */
+  @Test void testWeekdayCustomTimeFrames() {
     SqlValidatorFixture f = fixture()
         .withOperatorTable(operatorTableFor(SqlLibrary.BIG_QUERY));
 
diff --git a/core/src/test/java/org/apache/calcite/test/concurrent/ConcurrentTestCommandGenerator.java b/core/src/test/java/org/apache/calcite/test/concurrent/ConcurrentTestCommandGenerator.java
index 01b63bf5e4..7015f1e689 100644
--- a/core/src/test/java/org/apache/calcite/test/concurrent/ConcurrentTestCommandGenerator.java
+++ b/core/src/test/java/org/apache/calcite/test/concurrent/ConcurrentTestCommandGenerator.java
@@ -46,18 +46,18 @@ import java.util.regex.Pattern;
  * ({@link ConcurrentTestCommandExecutor}).
  *
  * <p>Typical actions include preparing a SQL statement for execution, executing
- * the statement and verifying its result set, and closing the statement.</p>
+ * the statement and verifying its result set, and closing the statement.
  *
  * <p>A single ConcurrentTestCommandGenerator creates commands for
  * multiple threads. Each thread is represented by an integer "thread ID".
  * Thread IDs may take on any positive integer value and may be a sparse set
- * (e.g. 1, 2, 5).</p>
+ * (e.g. 1, 2, 5).
  *
  * <p>When each command is created, it is associated with a thread and given an
  * execution order. Execution order values are positive integers, must be unique
- * within a thread, and may be a sparse set.</p>
+ * within a thread, and may be a sparse set.
  *
- * <p>There are no restrictions on the order of command creation.</p>
+ * <p>There are no restrictions on the order of command creation.
  */
 public class ConcurrentTestCommandGenerator {
   private static final char APOS = '\'';
@@ -207,7 +207,7 @@ public class ConcurrentTestCommandGenerator {
    *
    * <p><b>Expected data format:</b> <code>{ 'row1, col1 value', 'row1, col2
    * value', ... }, { 'row2, col1 value', 'row2, col2 value', ... },
-   * ...</code></p>
+   * ...</code>
    *
    * <ul>
    * <li>For string data: enclose value in apostrophes, use doubled apostrophe
diff --git a/core/src/test/java/org/apache/calcite/test/concurrent/package-info.java b/core/src/test/java/org/apache/calcite/test/concurrent/package-info.java
index 64510274ca..c00e80a859 100644
--- a/core/src/test/java/org/apache/calcite/test/concurrent/package-info.java
+++ b/core/src/test/java/org/apache/calcite/test/concurrent/package-info.java
@@ -25,11 +25,11 @@
  * own thread as a separate jdbc client (ie a separate
  * <code>java.sql.Connection</code>). There are facilties to synchronize these
  * command threads. Only a simple command sequence is supported: no branching,
- * no looping.</p>
+ * no looping.
  *
  * <p>An alternative is to define a test by writing a test script in
  * <code>mtsql</code> format, as described below. An instance of
- * <code>ConcurrentCommandScript</code> parses and executes a script.</p>
+ * <code>ConcurrentCommandScript</code> parses and executes a script.
  *
  * <h2>Script Format</h2>
  *
@@ -72,20 +72,20 @@
  * <h3>Synchronization:</h3>
  *
  * <p>The threads are synchronized by inserting synchronization points
- * (&#64;sync).</p>
+ * (&#64;sync).
  *
  * <p>When a thread reaches a &#64;sync, it waits until all threads are waiting
  * on the same &#64;sync: then all threads proceed. &#64;sync points have no
  * names. Clearly all thread sections must contain the same number of &#64;sync
- * points.</p>
+ * points.
  *
  * <p>The directive &#64;lockstep has the same effect as adding a &#64;sync
  * after each command in every thread section. Clearly it requires that all
  * thread sections have the same number of commands. The default is the antonym
- * &#64;nolockstep.</p>
+ * &#64;nolockstep.
  *
  * <p>The directive &#64;disable means "skip this script". The deault is the
- * antonym &#64;enable.</p>
+ * antonym &#64;enable.
  *
  *
  * <h3>Error handling:</h3>
@@ -96,12 +96,12 @@
  * section it can be toggled using the sql directive <code>!SET FORCE
  * <i>val</i></code>, where <i>val</i> can be <i>true, false, on, off.</i> (This
  * is modelled after sqlline and sqllineClient. Other sqlline
- * <i>!-</i>directives are ignored.)</p>
+ * <i>!-</i>directives are ignored.)
  *
  * <p>An error in a thread section will stop that thread, but the other threads
  * continue (with one fewer partner to synchronize with), and finally the
  * cleanup section runs. If the setup section quits, then only the cleanup
- * section is run.</p>
+ * section is run.
  *
  * <h3>Basic Commands (allowed in any section):</h3>
  *
@@ -189,13 +189,13 @@
  * <p>The initial value of a script variable VAR is taken from the shell
  *     environment variable of the same name.  The value can be set to a
  *     different value when the script is run, by employing a phrase
- *     VAR=VALUE on the mtsql command line.</p>
+ *     VAR=VALUE on the mtsql command line.
  *
  * <h3>Stand-Alone Tool</h3>
  *
  * <p>A command-line tool that runs an mtsql script against a specified JDBC
  *     connection,a nd prints the query results. (But see &#64;print command to
- *     filter the output.)</p>
+ *     filter the output.)
  *
  * <p> Usage: mtsql [-qvg] -u SERVER -d DRIVER [-n USER] [-p PASSWORD]
  *     [VAR=VALUE]* SCRIPT [SCRIPT]*<br>
@@ -205,7 +205,7 @@
  *     -u SERVER : sets the target; a JDBC URL.<br>
  *     -d DRIVER : sets the jdbc driver; a class on the classpath<br>
  *     VAR=VALUE : binds the script variable VAR to the VALUE; VAR must be
- *     declared at the beginning of the script(s) in a &#64;var command.</p>
+ *     declared at the beginning of the script(s) in a &#64;var command.
  *
  *
  * <h3>Example Script</h3>
diff --git a/core/src/test/java/org/apache/calcite/tools/PlannerTest.java b/core/src/test/java/org/apache/calcite/tools/PlannerTest.java
index ac3256118b..92464f6aa3 100644
--- a/core/src/test/java/org/apache/calcite/tools/PlannerTest.java
+++ b/core/src/test/java/org/apache/calcite/tools/PlannerTest.java
@@ -1546,10 +1546,8 @@ class PlannerTest {
     assertValidPlan(sql, DelegatingTypeSystem.DEFAULT, is(expectedDefault));
   }
 
-  /**
-   *  Asserts a Planner generates the correct plan using the provided
-   *  type system.
-   */
+  /** Asserts that a Planner generates the correct plan using the
+   * provided type system. */
   private void assertValidPlan(String sql, RelDataTypeSystem typeSystem,
       Matcher<String> planMatcher)  throws SqlParseException,
       ValidationException, RelConversionException {
diff --git a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidQuery.java b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidQuery.java
index 5628e935a0..2550aa03c8 100644
--- a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidQuery.java
+++ b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidQuery.java
@@ -241,7 +241,7 @@ public class DruidQuery extends AbstractRelNode implements BindableRel {
         query.druidTable, intervals, query.rels, query.getOperatorConversionMap());
   }
 
-  /** Check if it is needed to use UTC for DATE and TIMESTAMP types. **/
+  /** Check if it is needed to use UTC for DATE and TIMESTAMP types. */
   private static boolean needUtcTimeExtract(RexNode rexNode) {
     return rexNode.getType().getSqlTypeName() == SqlTypeName.DATE
         || rexNode.getType().getSqlTypeName() == SqlTypeName.TIMESTAMP
diff --git a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidSqlOperatorConverter.java b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidSqlOperatorConverter.java
index 974cb52090..f84a2ad631 100644
--- a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidSqlOperatorConverter.java
+++ b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidSqlOperatorConverter.java
@@ -38,6 +38,7 @@ public interface DruidSqlOperatorConverter {
 
   /**
    * Translate rexNode to valid Druid expression.
+   *
    * @param rexNode rexNode to translate to Druid expression
    * @param rowType row type associated with rexNode
    * @param druidQuery druid query used to figure out configs/fields related like timeZone
diff --git a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchConstants.java b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchConstants.java
index a2afb68f0e..2146ae6bdd 100644
--- a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchConstants.java
+++ b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchConstants.java
@@ -43,6 +43,7 @@ interface ElasticsearchConstants {
 
   /**
    * Detects {@code select * from elastic} types of field name (select star).
+   *
    * @param name name of the field
    * @return {@code true} if this field represents whole raw, {@code false} otherwise
    */
diff --git a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchJson.java b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchJson.java
index d316eb8630..c717a661dc 100644
--- a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchJson.java
+++ b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchJson.java
@@ -218,6 +218,7 @@ final class ElasticsearchJson {
 
     /**
      * Constructor for this instance.
+     *
      * @param hits list of matched documents
      * @param took time taken (in took) for this query to execute
      */
@@ -397,6 +398,7 @@ final class ElasticsearchJson {
 
     /**
      * Returns property from nested maps given a path like {@code a.b.c}.
+     *
      * @param map current map
      * @param path field path(s), optionally with dots ({@code a.b.c}).
      * @return value located at path {@code path} or {@code null} if not found.
@@ -622,6 +624,7 @@ final class ElasticsearchJson {
 
     /**
      * For single value. Returns single value represented by this leaf aggregation.
+     *
      * @return value corresponding to {@code value}
      */
     Object value() {
diff --git a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchRel.java b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchRel.java
index db8aa4f24f..95ab036331 100644
--- a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchRel.java
+++ b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchRel.java
@@ -50,18 +50,21 @@ public interface ElasticsearchRel extends RelNode {
 
     /**
      * Sorting clauses.
+     *
      * @see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html">Sort</a>
      */
     final List<Map.Entry<String, RelFieldCollation.Direction>> sort = new ArrayList<>();
 
     /**
      * Elastic aggregation ({@code MIN / MAX / COUNT} etc.) statements (functions).
+     *
      * @see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html">aggregations</a>
      */
     final List<Map.Entry<String, String>> aggregations = new ArrayList<>();
 
     /**
      * Allows bucketing documents together. Similar to {@code select ... from table group by field1}
+     *
      * @see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/6.3/search-aggregations-bucket.html">Bucket Aggregrations</a>
      */
     final List<String> groupBy = new ArrayList<>();
@@ -77,12 +80,14 @@ public interface ElasticsearchRel extends RelNode {
 
     /**
      * Starting index (default {@code 0}). Equivalent to {@code start} in ES query.
+     *
      * @see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-from-size.html">From/Size</a>
      */
     Long offset;
 
     /**
      * Number of records to return. Equivalent to {@code size} in ES query.
+     *
      * @see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-from-size.html">From/Size</a>
      */
     Long fetch;
diff --git a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchRules.java b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchRules.java
index 00685af824..9f542c4e4d 100644
--- a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchRules.java
+++ b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchRules.java
@@ -62,6 +62,7 @@ class ElasticsearchRules {
 
   /**
    * Returns 'string' if it is a call to item['string'], null otherwise.
+   *
    * @param call current relational expression
    * @return literal value
    */
diff --git a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchSearchResult.java b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchSearchResult.java
index 8784be3375..29fb4a059f 100644
--- a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchSearchResult.java
+++ b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchSearchResult.java
@@ -39,6 +39,7 @@ public class ElasticsearchSearchResult {
 
   /**
    * Constructor for this instance.
+   *
    * @param hits list of matched documents
    * @param took time taken (in took) for this query to execute
    */
diff --git a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTable.java b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTable.java
index 419cc43031..dd57b5e079 100644
--- a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTable.java
+++ b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTable.java
@@ -350,6 +350,7 @@ public class ElasticsearchTable extends AbstractQueryableTable implements Transl
     }
 
     /** Called via code-generation.
+     *
      * @param ops list of queries (as strings)
      * @param fields projection
      * @see ElasticsearchMethod#ELASTICSEARCH_QUERYABLE_FIND
diff --git a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTableScan.java b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTableScan.java
index 39cc693c3a..668bdd68e4 100644
--- a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTableScan.java
+++ b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTableScan.java
@@ -39,7 +39,7 @@ import java.util.Objects;
  * Relational expression representing a scan of an Elasticsearch type.
  *
  * <p> Additional operations might be applied,
- * using the "find" method.</p>
+ * using the "find" method.
  */
 public class ElasticsearchTableScan extends TableScan implements ElasticsearchRel {
   private final ElasticsearchTable elasticsearchTable;
diff --git a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchToEnumerableConverter.java b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchToEnumerableConverter.java
index 99d6b5f289..3e0c037182 100644
--- a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchToEnumerableConverter.java
+++ b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchToEnumerableConverter.java
@@ -113,6 +113,7 @@ public class ElasticsearchToEnumerableConverter extends ConverterImpl implements
 
   /** E.g. {@code constantArrayList("x", "y")} returns
    * "Arrays.asList('x', 'y')".
+   *
    * @param values list of values
    * @param clazz runtime class representing each element in the list
    * @param <T> type of elements in the list
@@ -125,6 +126,7 @@ public class ElasticsearchToEnumerableConverter extends ConverterImpl implements
 
   /** E.g. {@code constantList("x", "y")} returns
    * {@code {ConstantExpression("x"), ConstantExpression("y")}}.
+   *
    * @param values list of elements
    * @param <T> type of elements inside this list
    * @return list of constant expressions
diff --git a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTransport.java b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTransport.java
index ef10225617..d24278ae99 100644
--- a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTransport.java
+++ b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTransport.java
@@ -228,6 +228,7 @@ final class ElasticsearchTransport {
 
   /**
    * Parses HTTP response into some class using jackson API.
+   *
    * @param <T> result type
    */
   private static class JsonParserFn<T> implements Function<Response, T> {
diff --git a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/PredicateAnalyzer.java b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/PredicateAnalyzer.java
index f2f65e3369..95d829f4d5 100644
--- a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/PredicateAnalyzer.java
+++ b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/PredicateAnalyzer.java
@@ -209,6 +209,7 @@ class PredicateAnalyzer {
      * 3) Sarg is real Range( > 1 and <= 10).
      *    In this case the search call should be translated to rang Query
      * Currently only the 1) and 2) cases are supported.
+     *
      * @param search SEARCH RexCall
      * @return true if it isSearchWithPoints or isSearchWithComplementedPoints, other false
      */
@@ -486,6 +487,7 @@ class PredicateAnalyzer {
      * cause an exception to be thrown. For example, we currently do not support
      * comparing a literal to another literal as convention {@code 5 = 5}. Nor do we support
      * comparing named fields to other named fields as convention {@code $0 = $1}.
+     *
      * @param left left expression
      * @param right right expression
      */
@@ -887,6 +889,7 @@ class PredicateAnalyzer {
   /**
    * By default, range queries on date/time need use the format of the source to parse the literal.
    * So we need to specify that the literal has "date_time" format
+   *
    * @param literal literal value
    * @param rangeQueryBuilder query builder to optionally add {@code format} expression
    * @return existing builder with possible {@code format} attribute
diff --git a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/ElasticSearchAdapterTest.java b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/ElasticSearchAdapterTest.java
index 88f73e9595..1936a833f5 100644
--- a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/ElasticSearchAdapterTest.java
+++ b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/ElasticSearchAdapterTest.java
@@ -72,6 +72,7 @@ class ElasticSearchAdapterTest {
 
   /**
    * Used to create {@code zips} index and insert zip data in bulk.
+   *
    * @throws Exception when instance setup failed
    */
   @BeforeAll
diff --git a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/EmbeddedElasticsearchNode.java b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/EmbeddedElasticsearchNode.java
index e1b80c13ee..a47b704a76 100644
--- a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/EmbeddedElasticsearchNode.java
+++ b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/EmbeddedElasticsearchNode.java
@@ -71,10 +71,13 @@ class EmbeddedElasticsearchNode implements AutoCloseable {
   }
 
   /**
-   * Creates elastic node as single member of a cluster. Node will not be started
-   * unless {@link #start()} is explicitly called.
-   * <p>Need {@code synchronized} because of static caches inside ES (which are not thread safe).
-   * @return instance which needs to be explicitly started (using {@link #start()})
+   * Creates elastic node as single member of a cluster. Node will not
+   * be started unless {@link #start()} is explicitly called.
+   *
+   * <p>Need {@code synchronized} because of static caches inside ES
+   * (which are not thread safe).
+   *
+   * @return instance; needs to be explicitly started using {@link #start()}
    */
   public static synchronized EmbeddedElasticsearchNode create() {
     File data;
@@ -115,6 +118,7 @@ class EmbeddedElasticsearchNode implements AutoCloseable {
 
   /**
    * Returns current address to connect to with HTTP client.
+   *
    * @return hostname/port for HTTP connection
    */
   public TransportAddress httpAddress() {
diff --git a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/EmbeddedElasticsearchPolicy.java b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/EmbeddedElasticsearchPolicy.java
index c1fca5a7db..38029c32fc 100644
--- a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/EmbeddedElasticsearchPolicy.java
+++ b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/EmbeddedElasticsearchPolicy.java
@@ -38,28 +38,30 @@ import java.util.Map;
 import java.util.Objects;
 
 /**
- * Used to initialize a single elastic node. For performance reasons (node startup costs),
- * same instance is shared across multiple tests (Elasticsearch does not allow multiple
- * instances per JVM).
+ * Used to initialize a single Elasticsearch node. For performance reasons (node
+ * startup costs), same instance is shared across multiple tests (Elasticsearch
+ * does not allow multiple instances per JVM).
  *
  * <p>This rule should be used as follows:
  * <pre>
- *  public class MyTest {
- *    public static final EmbeddedElasticsearchPolicy RULE = EmbeddedElasticsearchPolicy.create();
+ * public class MyTest {
+ *   public static final EmbeddedElasticsearchPolicy RULE =
+ *       EmbeddedElasticsearchPolicy.create();
  *
- *    &#64;BeforeClass
- *    public static void setup() {
- *       // ... populate instance
- *       // The collections must have different names so the tests could be executed concurrently
- *    }
+ *   &#64;BeforeClass
+ *   public static void setup() {
+ *      // ... populate instance
+ *      // The collections must have different names so the tests could be
+ *      // executed concurrently
+ *   }
  *
- *    &#64;Test
- *    public void myTest() {
- *      RestClient client = RULE.restClient();
- *      // ....
- *    }
- *  }
- *  </pre>
+ *   &#64;Test
+ *   public void myTest() {
+ *     RestClient client = RULE.restClient();
+ *     // ....
+ *   }
+ * }
+ * </pre>
  */
 class EmbeddedElasticsearchPolicy {
 
@@ -86,6 +88,7 @@ class EmbeddedElasticsearchPolicy {
 
   /**
    * Factory method to create this rule.
+   *
    * @return managed resource to be used in unit tests
    */
   public static EmbeddedElasticsearchPolicy create() {
@@ -93,16 +96,15 @@ class EmbeddedElasticsearchPolicy {
   }
 
   /**
-   * Creates index in elastic search given a mapping. Mapping can contain nested fields expressed
-   * as dots({@code .}).
+   * Creates index in Elasticsearch given a mapping. Mapping can
+   * contain nested fields expressed as dots({@code .}).
    *
-   * <p>Example
-   * <pre>
-   *  {@code
+   * <p>Example:
+   *
+   * <pre>{@code
    *     b.a: long
    *     b.b: keyword
-   *  }
-   * </pre>
+   * }</pre>
    *
    * @param index index of the index
    * @param mapping field and field type mapping
@@ -133,13 +135,12 @@ class EmbeddedElasticsearchPolicy {
    * Creates alias in elastic search given an index.
    * as dots({@code .}).
    *
-   * <p>Example
-   * <pre>
-   *  {@code
+   * <p>Example:
+   *
+   * <pre>{@code
    *     b.a: long
    *     b.b: keyword
-   *  }
-   * </pre>
+   * }</pre>
    *
    * @param index index of the index
    * @param alias alias of the index
@@ -220,6 +221,7 @@ class EmbeddedElasticsearchPolicy {
 
   /**
    * Exposes Jackson API to be used to parse search results.
+   *
    * @return existing instance of ObjectMapper
    */
   ObjectMapper mapper() {
@@ -227,7 +229,9 @@ class EmbeddedElasticsearchPolicy {
   }
 
   /**
-   * Low-level http rest client connected to current embedded elastic search instance.
+   * Low-level http rest client connected to current embedded Elasticsearch
+   * instance.
+   *
    * @return http client connected to ES cluster
    */
   RestClient restClient() {
@@ -252,6 +256,7 @@ class EmbeddedElasticsearchPolicy {
 
   /**
    * HTTP address for rest clients (can be ES native or any other).
+   *
    * @return http address to connect to
    */
   private TransportAddress httpAddress() {
diff --git a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/MatchTest.java b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/MatchTest.java
index a2417ab016..d6fb98cbea 100644
--- a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/MatchTest.java
+++ b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/MatchTest.java
@@ -79,6 +79,7 @@ class MatchTest {
 
   /**
    * Used to create {@code zips} index and insert zip data in bulk.
+   *
    * @throws Exception when instance setup failed
    */
   @BeforeAll
diff --git a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/Projection2Test.java b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/Projection2Test.java
index 0c53ff9201..9dd34be78d 100644
--- a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/Projection2Test.java
+++ b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/Projection2Test.java
@@ -125,6 +125,7 @@ class Projection2Test {
 
   /**
    * Test that {@code _id} field is available when queried explicitly.
+   *
    * @see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-id-field.html">ID Field</a>
    */
   @Test void projectionWithIdField() {
@@ -233,6 +234,7 @@ class Projection2Test {
    *      key1=foo1; key2=\\w+; key4=\\d{3,4}
    *   }
    * </pre>
+   *
    * @param lines lines with regexp
    * @return consumer to be used in {@link org.apache.calcite.test.CalciteAssert.AssertQuery}
    */
diff --git a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/QueryBuildersTest.java b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/QueryBuildersTest.java
index c47c150347..5e80326fd7 100644
--- a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/QueryBuildersTest.java
+++ b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/QueryBuildersTest.java
@@ -43,6 +43,7 @@ class QueryBuildersTest {
 
   /**
    * Test for simple scalar terms (boolean, int etc.)
+   *
    * @throws Exception not expected
    */
   @Test void term() throws Exception {
diff --git a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/ScrollingTest.java b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/ScrollingTest.java
index 63205551cc..7106361973 100644
--- a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/ScrollingTest.java
+++ b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/ScrollingTest.java
@@ -98,6 +98,7 @@ class ScrollingTest {
   /**
    * Ensures there are no pending scroll contexts in elastic search cluster.
    * Queries {@code /_nodes/stats/indices/search} endpoint.
+   *
    * @see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html">Indices Stats</a>
    */
   private void assertNoActiveScrolls() throws IOException  {
diff --git a/elasticsearch/src/test/java/org/apache/calcite/test/ElasticsearchChecker.java b/elasticsearch/src/test/java/org/apache/calcite/test/ElasticsearchChecker.java
index 7e67020e91..1e5189ff17 100644
--- a/elasticsearch/src/test/java/org/apache/calcite/test/ElasticsearchChecker.java
+++ b/elasticsearch/src/test/java/org/apache/calcite/test/ElasticsearchChecker.java
@@ -48,6 +48,7 @@ public class ElasticsearchChecker {
 
   /** Returns a function that checks that a particular Elasticsearch pipeline is
    * generated to implement a query.
+   *
    * @param strings expected expressions
    * @return validation function
    */
@@ -83,6 +84,7 @@ public class ElasticsearchChecker {
    *   expanded to
    *   {a: { b: {c: 1}}}}
    * </pre>
+   *
    * @param parent current node
    * @param <T> type of node (usually JsonNode).
    * @return copy of existing node with field {@code a.b.c} expanded.
diff --git a/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvStreamTableFactory.java b/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvStreamTableFactory.java
index 49bb2e0823..cb524dcf3f 100644
--- a/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvStreamTableFactory.java
+++ b/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvStreamTableFactory.java
@@ -34,7 +34,7 @@ import java.util.Map;
  * Factory that creates a {@link CsvTranslatableTable}.
  *
  * <p>Allows a CSV table to be included in a model.json file, even in a
- * schema that is not based upon {@link CsvSchema}.</p>
+ * schema that is not based upon {@link CsvSchema}.
  */
 @SuppressWarnings("UnusedDeclaration")
 public class CsvStreamTableFactory implements TableFactory<CsvTable> {
diff --git a/example/csv/src/main/java/org/apache/calcite/adapter/csv/package-info.java b/example/csv/src/main/java/org/apache/calcite/adapter/csv/package-info.java
index 03d602167e..5cb4d328b6 100644
--- a/example/csv/src/main/java/org/apache/calcite/adapter/csv/package-info.java
+++ b/example/csv/src/main/java/org/apache/calcite/adapter/csv/package-info.java
@@ -20,6 +20,6 @@
  *
  * <p>A Calcite schema maps onto a directory, and each CSV file in that
  * directory appears as a table.  Full SQL operations are available on
- * those tables.</p>
+ * those tables.
  */
 package org.apache.calcite.adapter.csv;
diff --git a/file/src/main/java/org/apache/calcite/adapter/file/CsvStreamReader.java b/file/src/main/java/org/apache/calcite/adapter/file/CsvStreamReader.java
index aa00472d24..1c7aed8ff0 100644
--- a/file/src/main/java/org/apache/calcite/adapter/file/CsvStreamReader.java
+++ b/file/src/main/java/org/apache/calcite/adapter/file/CsvStreamReader.java
@@ -70,7 +70,7 @@ class CsvStreamReader extends CSVReader implements Closeable {
    * @param line The line number to skip for start reading
    * @param strictQuotes Sets if characters outside the quotes are ignored
    * @param ignoreLeadingWhiteSpace If true, parser should ignore
-   *  white space before a quote in a field
+   *                                white space before a quote in a field
    */
   private CsvStreamReader(Source source, char separator, char quoteChar,
       char escape, int line, boolean strictQuotes,
diff --git a/geode/src/main/java/org/apache/calcite/adapter/geode/util/JavaTypeFactoryExtImpl.java b/geode/src/main/java/org/apache/calcite/adapter/geode/util/JavaTypeFactoryExtImpl.java
index a322e4b6b4..6112caff48 100644
--- a/geode/src/main/java/org/apache/calcite/adapter/geode/util/JavaTypeFactoryExtImpl.java
+++ b/geode/src/main/java/org/apache/calcite/adapter/geode/util/JavaTypeFactoryExtImpl.java
@@ -37,7 +37,7 @@ import java.util.Map;
  * Implementation of {@link JavaTypeFactory}.
  *
  * <p><strong>NOTE: This class is experimental and subject to
- * change/removal without notice</strong>.</p>
+ * change/removal without notice</strong>.
  */
 public class JavaTypeFactoryExtImpl
     extends JavaTypeFactoryImpl {
diff --git a/geode/src/test/java/org/apache/calcite/adapter/geode/rel/GeodeEmbeddedPolicy.java b/geode/src/test/java/org/apache/calcite/adapter/geode/rel/GeodeEmbeddedPolicy.java
index 9faf9e99ec..0191d2e9e6 100644
--- a/geode/src/test/java/org/apache/calcite/adapter/geode/rel/GeodeEmbeddedPolicy.java
+++ b/geode/src/test/java/org/apache/calcite/adapter/geode/rel/GeodeEmbeddedPolicy.java
@@ -82,6 +82,7 @@ public class GeodeEmbeddedPolicy implements BeforeAllCallback, AfterAllCallback
 
   /**
    * Returns current cache instance which was initialized for tests.
+   *
    * @throws IllegalStateException if server process didn't start
    */
   Cache cache() {
diff --git a/kafka/src/main/java/org/apache/calcite/adapter/kafka/package-info.java b/kafka/src/main/java/org/apache/calcite/adapter/kafka/package-info.java
index e656068f35..3524be9162 100644
--- a/kafka/src/main/java/org/apache/calcite/adapter/kafka/package-info.java
+++ b/kafka/src/main/java/org/apache/calcite/adapter/kafka/package-info.java
@@ -18,6 +18,6 @@
 /**
  * Kafka query provider.
  *
- * <p>One Kafka topic is mapping to one STREAM table.</p>
+ * <p>One Kafka topic is mapping to one STREAM table.
  */
 package org.apache.calcite.adapter.kafka;
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractEnumerable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractEnumerable.java
index d89614df36..1a798704d1 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractEnumerable.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractEnumerable.java
@@ -24,7 +24,7 @@ import java.util.Iterator;
  *
  * <p>It is helpful to derive from this class if you are implementing
  * {@code Enumerable}, because {@code Enumerable} has so many extension methods,
- * but it is not required.</p>
+ * but it is not required.
  *
  * @param <T> Element type
  */
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractEnumerable2.java b/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractEnumerable2.java
index 774c9210eb..8d3958625e 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractEnumerable2.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractEnumerable2.java
@@ -22,7 +22,7 @@ package org.apache.calcite.linq4j;
  *
  * <p>It is helpful to derive from this class if you are implementing
  * {@code Enumerable}, because {@code Enumerable} has so many extension methods,
- * but it is not required.</p>
+ * but it is not required.
  *
  * @param <T> Element type
  */
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractQueryable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractQueryable.java
index d3bb73888c..a3f6349c0a 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractQueryable.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractQueryable.java
@@ -22,7 +22,7 @@ package org.apache.calcite.linq4j;
  *
  * <p>It is helpful to derive from this class if you are implementing
  * {@code Queryable}, because {@code Queryable} has so many extension methods,
- * but it is not required.</p>
+ * but it is not required.
  *
  * @param <T> Element type
  */
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/DefaultEnumerable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/DefaultEnumerable.java
index 2fc8e6ff9c..50b14b9ca9 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/DefaultEnumerable.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/DefaultEnumerable.java
@@ -50,7 +50,7 @@ import java.util.Map;
  * <p>The are two abstract methods:
  * {@link #enumerator()} and {@link #iterator()}.
  * The derived class can implement each separately, or implement one in terms of
- * the other.</p>
+ * the other.
  *
  * @param <T> Element type
  */
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/Enumerable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/Enumerable.java
index 72824b9d4a..4af96280dd 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/Enumerable.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/Enumerable.java
@@ -22,9 +22,9 @@ import org.checkerframework.framework.qual.Covariant;
  * Exposes the enumerator, which supports a simple iteration over a collection.
  *
  * <p>Analogous to LINQ's System.Collections.IEnumerable (both generic
- * and non-generic variants).</p>
+ * and non-generic variants).
  *
- * <p>Also implements {@link Iterable}, to enable use in Java foreach loops.</p>
+ * <p>Also implements {@link Iterable}, to enable use in Java foreach loops.
  *
  * @param <T> Element type
  */
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java b/linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java
index 025487cf34..6a1a21766f 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java
@@ -208,7 +208,7 @@ public abstract class EnumerableDefaults {
   /**
    * Converts an Enumerable to an IQueryable.
    *
-   * <p>Analogous to the LINQ's Enumerable.AsQueryable extension method.</p>
+   * <p>Analogous to the LINQ's Enumerable.AsQueryable extension method.
    *
    * @param enumerable Enumerable
    * @param <TSource> Element type
@@ -321,7 +321,7 @@ public abstract class EnumerableDefaults {
   }
 
   /**
-   * <p>Analogous to LINQ's Enumerable.Cast extension method.</p>
+   * <p>Analogous to LINQ's Enumerable.Cast extension method.
    *
    * @param clazz Target type
    * @param <T2> Target type
@@ -1647,12 +1647,12 @@ public abstract class EnumerableDefaults {
    * <p>Fetches blocks of size {@code batchSize} from {@code outer},
    * storing each block into a list ({@code outerValues}).
    * For each block, it uses the {@code inner} function to
-   * obtain an enumerable with the correlated rows from the right (inner) input.</p>
+   * obtain an enumerable with the correlated rows from the right (inner) input.
    *
    * <p>Each result present in the {@code innerEnumerator} has matched at least one
    * value from the block {@code outerValues}.
    * At this point a mini nested loop is performed between the outer values
-   * and inner values using the {@code predicate} to find out the actual matching join results.</p>
+   * and inner values using the {@code predicate} to find out the actual matching join results.
    *
    * <p>In order to optimize this mini nested loop, during the first iteration
    * (the first value from {@code outerValues}) we use the {@code innerEnumerator}
@@ -1660,7 +1660,7 @@ public abstract class EnumerableDefaults {
    * with said {@code innerEnumerator} rows. In the subsequent iterations
    * (2nd, 3rd, etc. value from {@code outerValues}) the list {@code innerValues} is used,
    * since it contains all the {@code innerEnumerator} values,
-   * which were stored in the first iteration.</p>
+   * which were stored in the first iteration.
    */
   public static <TSource, TInner, TResult> Enumerable<TResult> correlateBatchJoin(
       final JoinType joinType,
@@ -2147,6 +2147,7 @@ public abstract class EnumerableDefaults {
   /**
    * Joins two inputs that are sorted on the key.
    * Inputs must sorted in ascending order, nulls last.
+   *
    * @deprecated Use {@link #mergeJoin(Enumerable, Enumerable, Function1, Function1, Function2, JoinType, Comparator)}
    */
   @Deprecated // to be removed before 2.0
@@ -2171,7 +2172,9 @@ public abstract class EnumerableDefaults {
   }
 
   /**
-   * Returns if certain join type is supported by Enumerable Merge Join implementation.
+   * Returns if certain join type is supported by Enumerable Merge
+   * Join implementation.
+   *
    * <p>NOTE: This method is subject to change or be removed without notice.
    */
   public static boolean isMergeJoinSupported(JoinType joinType) {
@@ -2620,7 +2623,7 @@ public abstract class EnumerableDefaults {
    * Filters the elements of an Enumerable based on a
    * specified type.
    *
-   * <p>Analogous to LINQ's Enumerable.OfType extension method.</p>
+   * <p>Analogous to LINQ's Enumerable.OfType extension method.
    *
    * @param clazz Target type
    * @param <TResult> Target type
@@ -2666,6 +2669,7 @@ public abstract class EnumerableDefaults {
 
   /**
    * A sort implementation optimized for a sort with a fetch size (LIMIT).
+   *
    * @param offset how many rows are skipped from the sorted output.
    *               Must be greater than or equal to 0.
    * @param fetch how many rows are retrieved. Must be greater than or equal to 0.
@@ -3484,7 +3488,7 @@ public abstract class EnumerableDefaults {
    * Enumerable&lt;TSource&gt; according to a specified key selector
    * function.
    *
-   * <p>NOTE: Called {@code toDictionary} in LINQ.NET.</p>
+   * <p>NOTE: Called {@code toDictionary} in LINQ.NET.
    */
   public static <TSource, TKey> Map<TKey, TSource> toMap(
       Enumerable<TSource> source, Function1<TSource, TKey> keySelector) {
@@ -4369,6 +4373,7 @@ public abstract class EnumerableDefaults {
      * Clears {@code left} list, adds {@code left} into it, and advance left enumerator,
      * adding all items with the same key to {@code left} list too, until left enumerator
      * is over or a different key is found.
+     *
      * @return {@code true} if there are still elements to be processed on the left enumerator,
      * {@code false} otherwise (left enumerator is over or null key is found).
      */
@@ -4401,6 +4406,7 @@ public abstract class EnumerableDefaults {
      * Clears {@code right} list, adds {@code right} into it, and advance right enumerator,
      * adding all items with the same key to {@code right} list too, until right enumerator
      * is over or a different key is found.
+     *
      * @return {@code true} if there are still elements to be processed on the right enumerator,
      * {@code false} otherwise (right enumerator is over or null key is found).
      */
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedEnumerable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedEnumerable.java
index c20fe988a0..a375ff250b 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedEnumerable.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedEnumerable.java
@@ -55,7 +55,7 @@ public interface ExtendedEnumerable<TSource> {
    * Performs an operation for each member of this enumeration.
    *
    * <p>Returns the value returned by the function for the last element in
-   * this enumeration, or null if this enumeration is empty.</p>
+   * this enumeration, or null if this enumeration is empty.
    *
    * @param func Operation
    * @param <R> Return type
@@ -137,9 +137,9 @@ public interface ExtendedEnumerable<TSource> {
    * <p>If the type of source implements {@code Queryable}, this method
    * returns it directly. Otherwise, it returns a {@code Queryable} that
    * executes queries by calling the equivalent query operator methods in
-   * {@code Enumerable} instead of those in {@code Queryable}.</p>
+   * {@code Enumerable} instead of those in {@code Queryable}.
    *
-   * <p>Analogous to the LINQ's Enumerable.AsQueryable extension method.</p>
+   * <p>Analogous to the LINQ's Enumerable.AsQueryable extension method.
    *
    * @return A queryable
    */
@@ -572,7 +572,7 @@ public interface ExtendedEnumerable<TSource> {
    * optional outer join semantics. A specified
    * {@code EqualityComparer<TSource>} is used to compare keys.
    *
-   * <p>A left join generates nulls on right, and vice versa:</p>
+   * <p>A left join generates nulls on right, and vice versa:
    *
    * <table>
    *   <caption>Join types</caption>
@@ -599,7 +599,7 @@ public interface ExtendedEnumerable<TSource> {
    * optional outer join semantics. A specified
    * {@code EqualityComparer<TSource>} is used to compare keys.
    *
-   * <p>A left join generates nulls on right, and vice versa:</p>
+   * <p>A left join generates nulls on right, and vice versa:
    *
    * <table>
    *   <caption>Join types</caption>
@@ -614,7 +614,7 @@ public interface ExtendedEnumerable<TSource> {
    *   <tr><td>FULL</td><td>true</td><td>true</td></tr>
    * </table>
    *
-   * <p>A predicate is used to filter the join result per-row</p>
+   * <p>A predicate is used to filter the join result per-row
    */
   <TInner, TKey, TResult> Enumerable<TResult> hashJoin(Enumerable<TInner> inner,
       Function1<TSource, TKey> outerKeySelector,
@@ -836,7 +836,7 @@ public interface ExtendedEnumerable<TSource> {
    * Filters the elements of an Enumerable based on a
    * specified type.
    *
-   * <p>Analogous to LINQ's Enumerable.OfType extension method.</p>
+   * <p>Analogous to LINQ's Enumerable.OfType extension method.
    *
    * @param clazz Target type
    * @param <TResult> Target type
@@ -1090,7 +1090,7 @@ public interface ExtendedEnumerable<TSource> {
    * {@code Enumerable<TSource>} according to a specified key selector
    * function.
    *
-   * <p>NOTE: Called {@code toDictionary} in LINQ.NET.</p>
+   * <p>NOTE: Called {@code toDictionary} in LINQ.NET.
    */
   <TKey> Map<TKey, TSource> toMap(Function1<TSource, TKey> keySelector);
 
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedOrderedEnumerable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedOrderedEnumerable.java
index 47ae6892a0..852b8c671c 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedOrderedEnumerable.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedOrderedEnumerable.java
@@ -37,7 +37,7 @@ public interface ExtendedOrderedEnumerable<T> extends Enumerable<T> {
    * {@link #thenByDescending(org.apache.calcite.linq4j.function.Function1, java.util.Comparator) thenByDescending},
    * depending on whether descending is true or false. They both perform a
    * subordinate ordering of an already sorted sequence of type
-   * {@link OrderedEnumerable}.</p>
+   * {@link OrderedEnumerable}.
    */
   <TKey> OrderedEnumerable<T> createOrderedEnumerable(
       Function1<T, TKey> keySelector, Comparator<TKey> comparator,
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedQueryable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedQueryable.java
index ef3c2f7919..f30b22482b 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedQueryable.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedQueryable.java
@@ -275,7 +275,7 @@ interface ExtendedQueryable<TSource> extends ExtendedEnumerable<TSource> {
    *
    * <p>NOTE: Renamed from {@code groupBy} to distinguish from
    * {@link #groupBy(org.apache.calcite.linq4j.tree.FunctionExpression, org.apache.calcite.linq4j.tree.FunctionExpression)},
-   * which has the same erasure.</p>
+   * which has the same erasure.
    */
   <TKey, TResult> Queryable<TResult> groupByK(
       FunctionExpression<Function1<TSource, TKey>> keySelector,
@@ -445,7 +445,7 @@ interface ExtendedQueryable<TSource> extends ExtendedEnumerable<TSource> {
    * out any elements in source that are not of type TResult.
    *
    * <p>NOTE: clazz parameter not present in C# LINQ; necessary because of
-   * Java type erasure.</p>
+   * Java type erasure.
    */
   @Override <TResult> Queryable<TResult> ofType(Class<TResult> clazz);
 
@@ -498,7 +498,7 @@ interface ExtendedQueryable<TSource> extends ExtendedEnumerable<TSource> {
    * form by incorporating the element's index.
    *
    * <p>NOTE: Renamed from {@code select} because had same erasure as
-   * {@link #select(org.apache.calcite.linq4j.tree.FunctionExpression)}.</p>
+   * {@link #select(org.apache.calcite.linq4j.tree.FunctionExpression)}.
    */
   <TResult> Queryable<TResult> selectN(
       FunctionExpression<Function2<TSource, Integer, TResult>> selector);
@@ -519,7 +519,7 @@ interface ExtendedQueryable<TSource> extends ExtendedEnumerable<TSource> {
    * projected form of that element.
    *
    * <p>NOTE: Renamed from {@code selectMany} because had same erasure as
-   * {@link #selectMany(org.apache.calcite.linq4j.tree.FunctionExpression)}</p>
+   * {@link #selectMany(org.apache.calcite.linq4j.tree.FunctionExpression)}.
    */
   <TResult> Queryable<TResult> selectManyN(
       FunctionExpression<Function2<TSource, Integer, Enumerable<TResult>>>
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/Extensions.java b/linq4j/src/main/java/org/apache/calcite/linq4j/Extensions.java
index 5b8ba733b0..e7434a252c 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/Extensions.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/Extensions.java
@@ -28,7 +28,7 @@ import java.util.Map;
  * <h2>Notes on mapping from LINQ.NET to Java</h2>
  *
  * <p>We have preserved most of the API. But we've changed a few things, so that
- * the API is more typical Java API:</p>
+ * the API is more typical Java API:
  *
  * <ul>
  *
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/Linq4j.java b/linq4j/src/main/java/org/apache/calcite/linq4j/Linq4j.java
index 964df314dd..482a30757f 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/Linq4j.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/Linq4j.java
@@ -86,7 +86,7 @@ public abstract class Linq4j {
    *
    * <p><b>WARNING</b>: The iterator returned by this method does not call
    * {@link org.apache.calcite.linq4j.Enumerator#close()}, so it is not safe to
-   * use with an enumerator that allocates resources.</p>
+   * use with an enumerator that allocates resources.
    *
    * @param enumerator Enumerator
    * @param <T> Element type
@@ -131,7 +131,7 @@ public abstract class Linq4j {
    * Adapter that converts an {@link Collection} into an {@link Enumerable}.
    *
    * <p>It uses more efficient implementations if the iterable happens to
-   * be a {@link List}.</p>
+   * be a {@link List}.
    *
    * @param collection Collection
    * @param <T> Element type
@@ -150,7 +150,7 @@ public abstract class Linq4j {
    * Adapter that converts an {@link Iterable} into an {@link Enumerable}.
    *
    * <p>It uses more efficient implementations if the iterable happens to
-   * be a {@link Collection} or a {@link List}.</p>
+   * be a {@link Collection} or a {@link List}.
    *
    * @param iterable Iterable
    * @param <T> Element type
@@ -263,7 +263,7 @@ public abstract class Linq4j {
    * <p>The {@code ofType} method returns only those elements in source that
    * can be cast to type TResult. To instead receive an exception if an
    * element cannot be cast to type TResult, use
-   * {@link #cast(Iterable, Class)}.</p>
+   * {@link #cast(Iterable, Class)}.
    *
    * <p>Since standard Java {@link Collection} objects implement the
    * {@link Iterable} interface, the {@code cast} method enables the standard
@@ -368,13 +368,13 @@ public abstract class Linq4j {
    * enumerator B that returns {"x", "y"}, product(List(A, B)) will return
    * {List("a", "x"), List("a", "y"),
    * List("b", "x"), List("b", "y"),
-   * List("c", "x"), List("c", "y")}.</p>
+   * List("c", "x"), List("c", "y")}.
    *
    * <p>Notice that the cardinality of the result is the product of the
    * cardinality of the inputs. The enumerators A and B have 3 and 2
    * elements respectively, and the result has 3 * 2 = 6 elements.
    * This is always the case. In
-   * particular, if any of the enumerators is empty, the result is empty.</p>
+   * particular, if any of the enumerators is empty, the result is empty.
    *
    * @param enumerators List of enumerators
    * @param <T> Element type
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/MemoryFactory.java b/linq4j/src/main/java/org/apache/calcite/linq4j/MemoryFactory.java
index f68fa91777..421a52a98d 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/MemoryFactory.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/MemoryFactory.java
@@ -23,6 +23,7 @@ import java.util.Arrays;
 /**
  * Contains the State and changes internally.
  * with the {@link #create()} method one can get immutable Snapshots.
+ *
  * @param <E> Type of the base Object
  */
 public class MemoryFactory<E> {
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/MergeUnionEnumerator.java b/linq4j/src/main/java/org/apache/calcite/linq4j/MergeUnionEnumerator.java
index 7039fd9815..d708f67858 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/MergeUnionEnumerator.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/MergeUnionEnumerator.java
@@ -32,6 +32,7 @@ import java.util.Set;
 /**
  * Performs a union (or union all) of all its inputs (which must be already sorted),
  * respecting the order.
+ *
  * @param <TSource> record type
  * @param <TKey> sort key
  */
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/QueryProvider.java b/linq4j/src/main/java/org/apache/calcite/linq4j/QueryProvider.java
index bcc90660fd..01af01e4b2 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/QueryProvider.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/QueryProvider.java
@@ -24,7 +24,7 @@ import java.lang.reflect.Type;
  * Defines methods to create and execute queries that are described by a
  * {@link Queryable} object.
  *
- * <p>Analogous to LINQ's System.Linq.QueryProvider.</p>
+ * <p>Analogous to LINQ's System.Linq.QueryProvider.
  */
 public interface QueryProvider {
   /**
@@ -33,7 +33,7 @@ public interface QueryProvider {
    *
    * <p>NOTE: The {@link org.apache.calcite.linq4j.Queryable#getExpression()}
    * property of the returned {@link Queryable} object is equal to
-   * {@code expression}.</p>
+   * {@code expression}.
    *
    * @param expression Expression
    * @param rowType Row type
@@ -63,7 +63,7 @@ public interface QueryProvider {
    * (instead of an enumerable sequence of values). Expression trees that
    * represent queries that return enumerable results are executed when the
    * {@link Queryable} object that contains the expression tree is
-   * enumerated.</p>
+   * enumerated.
    *
    * <p>The Queryable standard query operator methods that return singleton
    * results call {@code execute}. They pass it a
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/QueryProviderImpl.java b/linq4j/src/main/java/org/apache/calcite/linq4j/QueryProviderImpl.java
index 62889872ec..4041d55dda 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/QueryProviderImpl.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/QueryProviderImpl.java
@@ -23,7 +23,7 @@ import java.lang.reflect.Type;
 /**
  * Partial implementation of {@link QueryProvider}.
  *
- * <p>Derived class needs to implement {@link #executeQuery}.</p>
+ * <p>Derived class needs to implement {@link #executeQuery}.
  */
 public abstract class QueryProviderImpl implements QueryProvider {
   /**
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/Queryable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/Queryable.java
index 9f9f049744..a1eb8f4c16 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/Queryable.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/Queryable.java
@@ -22,7 +22,7 @@ import org.checkerframework.framework.qual.Covariant;
  * Provides functionality to evaluate queries against a specific data source
  * wherein the type of the data is known.
  *
- * <p>Analogous to LINQ's System.Linq.IQueryable.</p>
+ * <p>Analogous to LINQ's System.Linq.IQueryable.
  *
  * @param <T> Element type
  */
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/QueryableDefaults.java b/linq4j/src/main/java/org/apache/calcite/linq4j/QueryableDefaults.java
index bef7d183e0..f84c085343 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/QueryableDefaults.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/QueryableDefaults.java
@@ -218,7 +218,7 @@ public abstract class QueryableDefaults {
   }
 
   /**
-   * <p>Analogous to LINQ's Enumerable.Cast extension method.</p>
+   * <p>Analogous to LINQ's Enumerable.Cast extension method.
    *
    * @param clazz Target type
    * @param <T2> Target type
@@ -426,7 +426,7 @@ public abstract class QueryableDefaults {
    *
    * <p>NOTE: Renamed from {@code groupBy} to distinguish from
    * {@link #groupBy(org.apache.calcite.linq4j.Queryable, org.apache.calcite.linq4j.tree.FunctionExpression, org.apache.calcite.linq4j.tree.FunctionExpression)},
-   * which has the same erasure.</p>
+   * which has the same erasure.
    */
   public static <T, TKey, TResult> Queryable<Grouping<TKey, TResult>> groupByK(
       Queryable<T> queryable,
@@ -457,7 +457,7 @@ public abstract class QueryableDefaults {
    *
    * <p>NOTE: Renamed from {@code groupBy} to distinguish from
    * {@link #groupBy(org.apache.calcite.linq4j.Queryable, org.apache.calcite.linq4j.tree.FunctionExpression, org.apache.calcite.linq4j.tree.FunctionExpression, org.apache.calcite.linq4j.function.EqualityComparer)},
-   * which has the same erasure.</p>
+   * which has the same erasure.
    */
   public static <T, TKey, TResult> Queryable<TResult> groupByK(
       Queryable<T> queryable,
@@ -675,7 +675,7 @@ public abstract class QueryableDefaults {
    * {@link org.apache.calcite.linq4j.QueryProvider#createQuery createQuery}
    * method of the
    * {@link org.apache.calcite.linq4j.QueryProvider} represented by
-   * the Provider property of the source parameter.</p>
+   * the Provider property of the source parameter.
    *
    * <p>The query behavior that occurs as a result of executing an expression
    * tree that represents calling OfType depends on the implementation of the
@@ -683,7 +683,7 @@ public abstract class QueryableDefaults {
    * out any elements in source that are not of type TResult.
    *
    * <p>NOTE: clazz parameter not present in C# LINQ; necessary because of
-   * Java type erasure.</p>
+   * Java type erasure.
    */
   public static <TResult> Queryable<TResult> ofType(Queryable<?> queryable,
       Class<TResult> clazz) {
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/RawEnumerable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/RawEnumerable.java
index 35d3ac1db5..b77a0f1798 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/RawEnumerable.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/RawEnumerable.java
@@ -23,10 +23,10 @@ import org.checkerframework.framework.qual.Covariant;
  * without the extension methods.
  *
  * <p>Just the bare methods, to make it easier to implement. Code that requires
- * the extension methods can use the static methods in {@link Extensions}.</p>
+ * the extension methods can use the static methods in {@link Extensions}.
  *
  * <p>Analogous to LINQ's System.Collections.IEnumerable (both generic
- * and non-generic variants), without the extension methods.</p>
+ * and non-generic variants), without the extension methods.
  *
  * @param <T> Element type
  * @see Enumerable
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/RawQueryable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/RawQueryable.java
index 953f6a0741..05ecf85692 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/RawQueryable.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/RawQueryable.java
@@ -42,6 +42,7 @@ public interface RawQueryable<T> extends Enumerable<T> {
 
   /**
    * Gets the expression tree that is associated with this Queryable.
+   *
    * @return null if the expression is not available
    */
   @Nullable Expression getExpression();
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/function/Functions.java b/linq4j/src/main/java/org/apache/calcite/linq4j/function/Functions.java
index c3b9877a6b..6a4a0da2a3 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/function/Functions.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/function/Functions.java
@@ -207,9 +207,9 @@ public abstract class Functions {
    * Returns the appropriate interface for a lambda function with
    * 1 argument and the given return type.
    *
-   * <p>For example:</p>
-   * functionClass(Integer.TYPE) returns IntegerFunction1.class
-   * functionClass(String.class) returns Function1.class
+   * <p>For example:
+   * functionClass(Integer.TYPE) returns IntegerFunction1.class;
+   * functionClass(String.class) returns Function1.class.
    *
    * @param aClass Return type
    *
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/BlockBuilder.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/BlockBuilder.java
index 750d513db5..731db83362 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/BlockBuilder.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/BlockBuilder.java
@@ -34,7 +34,7 @@ import static java.util.Objects.requireNonNull;
 /**
  * Builder for {@link BlockStatement}.
  *
- * <p>Has methods that help ensure that variable names are unique.</p>
+ * <p>Has methods that help ensure that variable names are unique.
  */
 public class BlockBuilder {
   final List<Statement> statements = new ArrayList<>();
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Blocks.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Blocks.java
index 993470ca6c..578767adb6 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Blocks.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Blocks.java
@@ -19,7 +19,7 @@ package org.apache.calcite.linq4j.tree;
 import static java.util.Objects.requireNonNull;
 
 /**
- * <p>Helper methods concerning {@link BlockStatement}s.</p>
+ * <p>Helper methods concerning {@link BlockStatement}s.
  *
  * @see BlockBuilder
  */
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConditionalExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConditionalExpression.java
index e33e2fa98c..0b0290d7d7 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConditionalExpression.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConditionalExpression.java
@@ -32,7 +32,6 @@ import java.util.Objects;
  * {c0, e0, c1, e1, ..., c<sub>n-1</sub>, e<sub>n-1</sub>}
  * represents
  * "if (c0) e0 else if (c1) e1 ... else if (c<sub>n-1</sub>) e<sub>n-1</sub>".
- * </p>
  */
 public class ConditionalExpression extends AbstractNode {
   final List<Node> expressionList;
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConditionalStatement.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConditionalStatement.java
index f83a3bbd42..df43ecc101 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConditionalStatement.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConditionalStatement.java
@@ -31,7 +31,6 @@ import java.util.Objects;
  * {c0, e0, c1, e1, ..., c<sub>n-1</sub>, e<sub>n-1</sub>}
  * represents
  * "if (c0) e0 else if (c1) e1 ... else if (c<sub>n-1</sub>) e<sub>n-1</sub>".
- * </p>
  */
 public class ConditionalStatement extends Statement {
   public final List<Node> expressionList;
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Expression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Expression.java
index 9ec2984874..15eb8bff9f 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Expression.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Expression.java
@@ -19,7 +19,7 @@ package org.apache.calcite.linq4j.tree;
 import java.lang.reflect.Type;
 
 /**
- * <p>Analogous to LINQ's System.Linq.Expression.</p>
+ * <p>Analogous to LINQ's System.Linq.Expression.
  */
 public abstract class Expression extends AbstractNode {
 
@@ -29,7 +29,7 @@ public abstract class Expression extends AbstractNode {
    * <p>The type of the expression may, at the caller's discretion, be a
    * regular class (because {@link Class} implements {@link Type}) or it may
    * be a different implementation that retains information about type
-   * parameters.</p>
+   * parameters.
    *
    * @param nodeType Node type
    * @param type Type of the expression
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ExpressionType.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ExpressionType.java
index b532aba2c4..7b0dfe65d1 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ExpressionType.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ExpressionType.java
@@ -18,9 +18,7 @@ package org.apache.calcite.linq4j.tree;
 
 import org.checkerframework.checker.nullness.qual.Nullable;
 
-/**
- * <p>Analogous to LINQ's System.Linq.Expressions.ExpressionType.</p>
- */
+/** Analogous to LINQ's System.Linq.Expressions.ExpressionType. */
 public enum ExpressionType {
 
   // Operator precedence and associativity is as follows.
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Expressions.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Expressions.java
index 9204ef047d..79fa310e19 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Expressions.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Expressions.java
@@ -382,10 +382,10 @@ public abstract class Expressions {
    * method that takes arguments, with an explicit return type.
    *
    * <p>The return type must be consistent with the return type of the method,
-   * but may contain extra information, such as type parameters.</p>
+   * but may contain extra information, such as type parameters.
    *
    * <p>The {@code expression} argument may be null if and only if the method
-   * is static.</p>
+   * is static.
    */
   public static MethodCallExpression call(Type returnType,
       @Nullable Expression expression, Method method,
@@ -399,10 +399,10 @@ public abstract class Expressions {
    * method that takes arguments, with an explicit return type, with varargs.
    *
    * <p>The return type must be consistent with the return type of the method,
-   * but may contain extra information, such as type parameters.</p>
+   * but may contain extra information, such as type parameters.
    *
    * <p>The {@code expression} argument may be null if and only if the method
-   * is static.</p>
+   * is static.
    */
   public static MethodCallExpression call(Type returnType,
       @Nullable Expression expression, Method method,
@@ -519,7 +519,7 @@ public abstract class Expressions {
    * conditional expression in cases where the types of ifTrue and ifFalse
    * expressions are not equal. Types of both ifTrue and ifFalse must be
    * implicitly reference assignable to the result type. The type is allowed
-   * to be {@link Void#TYPE void}.</p>
+   * to be {@link Void#TYPE void}.
    */
   public static ConditionalExpression condition(Expression test,
       Expression ifTrue, Expression ifFalse, Type type) {
@@ -535,7 +535,7 @@ public abstract class Expressions {
    * short 12, double 3.14 and boolean false), boxed primitives
    * (e.g. Integer.valueOf(12)), enums, classes, BigDecimal, BigInteger,
    * classes that have a constructor with a parameter for each field, and
-   * arrays.</p>
+   * arrays.
    */
   public static ConstantExpression constant(@Nullable Object value) {
     if (value == null) {
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/NewExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/NewExpression.java
index f2d343ecdd..5cbe06824c 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/NewExpression.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/NewExpression.java
@@ -26,7 +26,7 @@ import java.util.Objects;
  * Represents a constructor call.
  *
  * <p>If {@link #memberDeclarations} is not null (even if empty) represents
- * an anonymous class.</p>
+ * an anonymous class.
  */
 public class NewExpression extends Expression {
   @SuppressWarnings("HidingField")
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Node.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Node.java
index 9159d85dbe..6cbe9e5085 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Node.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Node.java
@@ -16,9 +16,7 @@
  */
 package org.apache.calcite.linq4j.tree;
 
-/**
- * <p>Parse tree node.</p>
- */
+/** Parse tree node. */
 public interface Node {
   <R> R accept(Visitor<R> visitor);
 
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Primitive.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Primitive.java
index 0e89bdeebe..b27c48b043 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Primitive.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Primitive.java
@@ -38,7 +38,7 @@ import static java.util.Objects.requireNonNull;
  *
  * <p>There are fields for the native class (e.g. <code>int</code>, also
  * known as {@link Integer#TYPE}) and the boxing class
- * (e.g. {@link Integer}).</p>
+ * (e.g. {@link Integer}).
  */
 public enum Primitive {
   BOOLEAN(Boolean.TYPE, Boolean.class, 1, false, false, null, null, true, -1),
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Statement.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Statement.java
index c76ab5c213..8897ca11be 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Statement.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Statement.java
@@ -19,7 +19,7 @@ package org.apache.calcite.linq4j.tree;
 import java.lang.reflect.Type;
 
 /**
- * <p>Statement.</p>
+ * <p>Statement.
  */
 public abstract class Statement extends AbstractNode {
   protected Statement(ExpressionType nodeType, Type type) {
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Types.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Types.java
index 8db3a6994f..0be03c9fc0 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Types.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Types.java
@@ -62,7 +62,7 @@ public abstract class Types {
    * {@link org.apache.calcite.linq4j.Enumerable Enumerable}), {@link Iterator},
    * {@link Enumerator}, or an array.
    *
-   * <p>Returns null if the type is not one of these.</p>
+   * <p>Returns null if the type is not one of these.
    */
   public static @Nullable Type getElementType(Type type) {
     if (type instanceof ArrayType) {
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/package-info.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/package-info.java
index e3c6360a61..9c1eeda04d 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/package-info.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/package-info.java
@@ -23,6 +23,6 @@
  * {@link org.apache.calcite.linq4j.Queryable} interface. The system attempts
  * to understand the intent of the query and reorganize it for
  * efficiency; for example, it may attempt to push down filters to the
- * source SQL system.</p>
+ * source SQL system.
  */
 package org.apache.calcite.linq4j.tree;
diff --git a/linq4j/src/test/java/org/apache/calcite/linq4j/test/BlockBuilderTest.java b/linq4j/src/test/java/org/apache/calcite/linq4j/test/BlockBuilderTest.java
index 95ff073f45..251f6f0b41 100644
--- a/linq4j/src/test/java/org/apache/calcite/linq4j/test/BlockBuilderTest.java
+++ b/linq4j/src/test/java/org/apache/calcite/linq4j/test/BlockBuilderTest.java
@@ -165,6 +165,7 @@ class BlockBuilderTest {
 
   /**
    * Class with generics to validate if {@link Expressions#call(Method, Expression...)} works.
+   *
    * @param <I> result type
    */
   static class Identity<I> implements Function<I, I> {
diff --git a/linq4j/src/test/java/org/apache/calcite/linq4j/test/JoinPreserveOrderTest.java b/linq4j/src/test/java/org/apache/calcite/linq4j/test/JoinPreserveOrderTest.java
index d58e2e556c..d77ae17823 100644
--- a/linq4j/src/test/java/org/apache/calcite/linq4j/test/JoinPreserveOrderTest.java
+++ b/linq4j/src/test/java/org/apache/calcite/linq4j/test/JoinPreserveOrderTest.java
@@ -61,6 +61,7 @@ public final class JoinPreserveOrderTest {
 
   /**
    * A description holding which column must be sorted and how.
+   *
    * @param <T> the type of the input relation
    */
   private static class Field<T> {
diff --git a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoSchemaFactory.java b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoSchemaFactory.java
index 1c6ca8e26b..cb1b9a7dda 100644
--- a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoSchemaFactory.java
+++ b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoSchemaFactory.java
@@ -29,7 +29,7 @@ import java.util.Map;
 /**
  * Factory that creates a {@link MongoSchema}.
  *
- * <p>Allows a custom schema to be included in a model.json file.</p>
+ * <p>Allows a custom schema to be included in a model.json file.
  */
 public class MongoSchemaFactory implements SchemaFactory {
   // public constructor, per factory contract
diff --git a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTable.java b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTable.java
index e3d46e5c8b..4a5694279b 100644
--- a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTable.java
+++ b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTable.java
@@ -89,7 +89,7 @@ public class MongoTable extends AbstractQueryableTable
   /** Executes a "find" operation on the underlying collection.
    *
    * <p>For example,
-   * <code>zipsTable.find("{state: 'OR'}", "{city: 1, zipcode: 1}")</code></p>
+   * <code>zipsTable.find("{state: 'OR'}", "{city: 1, zipcode: 1}")</code>
    *
    * @param mongoDb MongoDB connection
    * @param filterJson Filter JSON string, or null
@@ -121,7 +121,7 @@ public class MongoTable extends AbstractQueryableTable
    * <code>zipsTable.aggregate(
    * "{$filter: {state: 'OR'}",
    * "{$group: {_id: '$city', c: {$sum: 1}, p: {$sum: '$pop'}}}")
-   * </code></p>
+   * </code>
    *
    * @param mongoDb MongoDB connection
    * @param fields List of fields to project; or null to return map
diff --git a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTableScan.java b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTableScan.java
index 8783c30f68..17799e4b61 100644
--- a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTableScan.java
+++ b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTableScan.java
@@ -37,7 +37,7 @@ import java.util.List;
  * Relational expression representing a scan of a MongoDB collection.
  *
  * <p> Additional operations might be applied,
- * using the "find" or "aggregate" methods.</p>
+ * using the "find" or "aggregate" methods.
  */
 public class MongoTableScan extends TableScan implements MongoRel {
   final MongoTable mongoTable;
diff --git a/mongodb/src/test/java/org/apache/calcite/adapter/mongodb/MongoAdapterTest.java b/mongodb/src/test/java/org/apache/calcite/adapter/mongodb/MongoAdapterTest.java
index d2e589985b..738f093380 100644
--- a/mongodb/src/test/java/org/apache/calcite/adapter/mongodb/MongoAdapterTest.java
+++ b/mongodb/src/test/java/org/apache/calcite/adapter/mongodb/MongoAdapterTest.java
@@ -136,9 +136,7 @@ public class MongoAdapterTest implements SchemaFactory {
     });
   }
 
-  /**
-   *  Returns always the same schema to avoid initialization costs.
-   */
+  /** Returns always the same schema to avoid initialization costs. */
   @Override public Schema create(SchemaPlus parentSchema, String name,
       Map<String, Object> operand) {
     return schema;
diff --git a/pig/src/main/java/org/apache/calcite/adapter/pig/PigAggregate.java b/pig/src/main/java/org/apache/calcite/adapter/pig/PigAggregate.java
index 5ba468c1b4..742c82816b 100644
--- a/pig/src/main/java/org/apache/calcite/adapter/pig/PigAggregate.java
+++ b/pig/src/main/java/org/apache/calcite/adapter/pig/PigAggregate.java
@@ -114,6 +114,7 @@ public class PigAggregate extends Aggregate implements PigRel {
    * Generates a FOREACH statement containing invocation of aggregate functions
    * and projection of grouped fields. e.g.
    * <code>A = FOREACH A GENERATE group, SUM(A.pet_num);</code>
+   *
    * @see Pig documentation for special meaning of the "group" field after GROUP
    *      BY.
    */
diff --git a/pig/src/main/java/org/apache/calcite/adapter/pig/PigTableFactory.java b/pig/src/main/java/org/apache/calcite/adapter/pig/PigTableFactory.java
index 70a5c5e8fd..6ebf30f0ad 100644
--- a/pig/src/main/java/org/apache/calcite/adapter/pig/PigTableFactory.java
+++ b/pig/src/main/java/org/apache/calcite/adapter/pig/PigTableFactory.java
@@ -30,7 +30,7 @@ import java.util.Map;
 /**
  * Factory that creates a {@link PigTable}.
  *
- * <p>Allows a Pig table to be included in a model.json file.</p>
+ * <p>Allows a Pig table to be included in a model.json file.
  */
 public class PigTableFactory implements TableFactory<PigTable> {
   // public constructor, per factory contract
diff --git a/piglet/src/main/java/org/apache/calcite/piglet/DynamicTupleRecordType.java b/piglet/src/main/java/org/apache/calcite/piglet/DynamicTupleRecordType.java
index 59575e7b61..3b1511d893 100644
--- a/piglet/src/main/java/org/apache/calcite/piglet/DynamicTupleRecordType.java
+++ b/piglet/src/main/java/org/apache/calcite/piglet/DynamicTupleRecordType.java
@@ -62,6 +62,7 @@ public class DynamicTupleRecordType extends DynamicRecordTypeImpl {
 
   /**
    * Gets index number from field name.
+   *
    * @param fieldName Field name, format example '$1'
    */
   private static int nameToIndex(String fieldName) {
diff --git a/plus/src/main/java/org/apache/calcite/adapter/tpcds/TpcdsSchemaFactory.java b/plus/src/main/java/org/apache/calcite/adapter/tpcds/TpcdsSchemaFactory.java
index 07e8aab110..1f6294bc2e 100644
--- a/plus/src/main/java/org/apache/calcite/adapter/tpcds/TpcdsSchemaFactory.java
+++ b/plus/src/main/java/org/apache/calcite/adapter/tpcds/TpcdsSchemaFactory.java
@@ -26,7 +26,7 @@ import java.util.Map;
 /**
  * Factory that creates a {@link TpcdsSchema}.
  *
- * <p>Allows a custom schema to be included in a model.json file.</p>
+ * <p>Allows a custom schema to be included in a model.json file.
  */
 @SuppressWarnings("UnusedDeclaration")
 public class TpcdsSchemaFactory implements SchemaFactory {
diff --git a/plus/src/main/java/org/apache/calcite/adapter/tpch/TpchSchemaFactory.java b/plus/src/main/java/org/apache/calcite/adapter/tpch/TpchSchemaFactory.java
index ab73c85d7b..039c381cb4 100644
--- a/plus/src/main/java/org/apache/calcite/adapter/tpch/TpchSchemaFactory.java
+++ b/plus/src/main/java/org/apache/calcite/adapter/tpch/TpchSchemaFactory.java
@@ -26,7 +26,7 @@ import java.util.Map;
 /**
  * Factory that creates a {@link TpchSchema}.
  *
- * <p>Allows a custom schema to be included in a model.json file.</p>
+ * <p>Allows a custom schema to be included in a model.json file.
  */
 @SuppressWarnings("UnusedDeclaration")
 public class TpchSchemaFactory implements SchemaFactory {
diff --git a/plus/src/test/java/org/apache/calcite/adapter/tpcds/TpcdsTest.java b/plus/src/test/java/org/apache/calcite/adapter/tpcds/TpcdsTest.java
index de85c177cf..3d4595ca67 100644
--- a/plus/src/test/java/org/apache/calcite/adapter/tpcds/TpcdsTest.java
+++ b/plus/src/test/java/org/apache/calcite/adapter/tpcds/TpcdsTest.java
@@ -47,7 +47,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
 
 /** Unit test for {@link org.apache.calcite.adapter.tpcds.TpcdsSchema}.
  *
- * <p>Only runs as part of slow test suite.</p>
+ * <p>Only runs as part of slow test suite.
  */
 @Tag("slow")
 class TpcdsTest {
@@ -319,7 +319,7 @@ class TpcdsTest {
    * Builder query 27 using {@link RelBuilder}.
    *
    * <blockquote><pre>
-   *   select  i_item_id,
+   * select  i_item_id,
    *         s_state, grouping(s_state) g_state,
    *         avg(ss_quantity) agg1,
    *         avg(ss_list_price) agg2,
@@ -340,10 +340,10 @@ class TpcdsTest {
    *              'distmember(fips_county,[STATENUMBER.4], 3)',
    *              'distmember(fips_county,[STATENUMBER.5], 3)',
    *              'distmember(fips_county,[STATENUMBER.6], 3)')
-   *  group by rollup (i_item_id, s_state)
-   *  order by i_item_id
+   * group by rollup (i_item_id, s_state)
+   * order by i_item_id
    *          ,s_state
-   *  LIMIT 100
+   * LIMIT 100
    * </pre></blockquote>
    */
   @Test void testQuery27Builder() throws Exception {
diff --git a/plus/src/test/java/org/apache/calcite/adapter/tpch/TpchTest.java b/plus/src/test/java/org/apache/calcite/adapter/tpch/TpchTest.java
index 3db9dd3dd7..9ea5cd0ab7 100644
--- a/plus/src/test/java/org/apache/calcite/adapter/tpch/TpchTest.java
+++ b/plus/src/test/java/org/apache/calcite/adapter/tpch/TpchTest.java
@@ -36,7 +36,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
 /** Unit test for {@link org.apache.calcite.adapter.tpch.TpchSchema}.
  *
  * <p>Because the TPC-H data generator takes time and memory to instantiate,
- * tests only run as part of slow tests.</p>
+ * tests only run as part of slow tests.
  */
 class TpchTest {
   public static final boolean ENABLE = TestUtil.getJavaMajorVersion() >= 7;
diff --git a/spark/src/main/java/org/apache/calcite/adapter/spark/EnumerableToSparkConverter.java b/spark/src/main/java/org/apache/calcite/adapter/spark/EnumerableToSparkConverter.java
index 175426c372..e94f9ee8a4 100644
--- a/spark/src/main/java/org/apache/calcite/adapter/spark/EnumerableToSparkConverter.java
+++ b/spark/src/main/java/org/apache/calcite/adapter/spark/EnumerableToSparkConverter.java
@@ -42,7 +42,7 @@ import java.util.List;
  *
  * <p>Concretely, this means iterating over the contents of an
  * {@link org.apache.calcite.linq4j.Enumerable}, storing them in a list, and
- * building an {@link org.apache.spark.rdd.RDD} on top of it.</p>
+ * building an {@link org.apache.spark.rdd.RDD} on top of it.
  */
 public class EnumerableToSparkConverter
     extends ConverterImpl
diff --git a/spark/src/main/java/org/apache/calcite/adapter/spark/HttpServer.java b/spark/src/main/java/org/apache/calcite/adapter/spark/HttpServer.java
index e3febdb7a2..44f6844a2b 100644
--- a/spark/src/main/java/org/apache/calcite/adapter/spark/HttpServer.java
+++ b/spark/src/main/java/org/apache/calcite/adapter/spark/HttpServer.java
@@ -36,7 +36,7 @@ import java.util.Collections;
 /**
  * An HTTP server for static content used to allow worker nodes to access JARs.
  *
- * <p>Based on Spark HttpServer, wraps a Jetty server.</p>
+ * <p>Based on Spark HttpServer, wraps a Jetty server.
  */
 class HttpServer {
   private static String localIpAddress;
diff --git a/spark/src/main/java/org/apache/calcite/adapter/spark/SparkRuntime.java b/spark/src/main/java/org/apache/calcite/adapter/spark/SparkRuntime.java
index b5a54e97e9..922052cb25 100644
--- a/spark/src/main/java/org/apache/calcite/adapter/spark/SparkRuntime.java
+++ b/spark/src/main/java/org/apache/calcite/adapter/spark/SparkRuntime.java
@@ -54,7 +54,7 @@ public abstract class SparkRuntime {
 
   /** Returns the Spark context for the current execution.
    *
-   * <p>Currently a global variable; maybe later held within {@code root}.</p>
+   * <p>Currently a global variable; maybe later held within {@code root}.
    */
   public static JavaSparkContext getSparkContext(DataContext root) {
     return (JavaSparkContext) SparkHandlerImpl.instance().sparkContext();
diff --git a/spark/src/main/java/org/apache/calcite/adapter/spark/SparkToEnumerableConverter.java b/spark/src/main/java/org/apache/calcite/adapter/spark/SparkToEnumerableConverter.java
index e4e48e686c..cfdc180eba 100644
--- a/spark/src/main/java/org/apache/calcite/adapter/spark/SparkToEnumerableConverter.java
+++ b/spark/src/main/java/org/apache/calcite/adapter/spark/SparkToEnumerableConverter.java
@@ -47,7 +47,7 @@ import java.util.List;
  *
  * <p>Concretely, this means calling the
  * {@link org.apache.spark.api.java.JavaRDD#collect()} method of an RDD
- * and converting it to enumerable.</p>
+ * and converting it to enumerable.
  */
 public class SparkToEnumerableConverter
     extends ConverterImpl
diff --git a/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkDriver.java b/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkDriver.java
index 8738235046..13b37abe16 100644
--- a/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkDriver.java
+++ b/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkDriver.java
@@ -34,7 +34,7 @@ import java.util.Properties;
 /**
  * JDBC driver for Splunk.
  *
- * <p>It accepts connect strings that start with "jdbc:splunk:".</p>
+ * <p>It accepts connect strings that start with "jdbc:splunk:".
  */
 public class SplunkDriver extends org.apache.calcite.jdbc.Driver {
   protected SplunkDriver() {
diff --git a/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkTableScan.java b/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkTableScan.java
index 8a4012a07f..aec1c30c3d 100644
--- a/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkTableScan.java
+++ b/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkTableScan.java
@@ -52,7 +52,7 @@ import java.util.Map;
  * instance is one large table. This "table" does not have a fixed set of
  * columns (Splunk calls them "fields") but each query specifies the fields that
  * it wants. It also specifies a search expression, and optionally earliest and
- * latest dates.</p>
+ * latest dates.
  */
 public class SplunkTableScan
     extends TableScan
diff --git a/splunk/src/main/java/org/apache/calcite/adapter/splunk/package-info.java b/splunk/src/main/java/org/apache/calcite/adapter/splunk/package-info.java
index d9b5ee195a..cfead242ef 100644
--- a/splunk/src/main/java/org/apache/calcite/adapter/splunk/package-info.java
+++ b/splunk/src/main/java/org/apache/calcite/adapter/splunk/package-info.java
@@ -20,6 +20,6 @@
  *
  * <p>There is a single table, called "Splunk". It has fixed columns
  * "host", "index", "source", "sourcetype". It has a variable type, so other
- * fields are held in a map field called "_others".</p>
+ * fields are held in a map field called "_others".
  */
 package org.apache.calcite.adapter.splunk;
diff --git a/splunk/src/main/java/org/apache/calcite/adapter/splunk/search/SplunkConnectionImpl.java b/splunk/src/main/java/org/apache/calcite/adapter/splunk/search/SplunkConnectionImpl.java
index f291967591..9dcc92f5b2 100644
--- a/splunk/src/main/java/org/apache/calcite/adapter/splunk/search/SplunkConnectionImpl.java
+++ b/splunk/src/main/java/org/apache/calcite/adapter/splunk/search/SplunkConnectionImpl.java
@@ -329,7 +329,7 @@ public class SplunkConnectionImpl implements SplunkConnection {
    * results from a Splunk REST call.
    *
    * <p>The element type is either {@code String} or {@code String[]}, depending
-   * on the value of {@code source}.</p> */
+   * on the value of {@code source}. */
   public static class SplunkResultEnumerator implements Enumerator<Object> {
     private final CSVReader csvReader;
     private String[] fieldNames;
diff --git a/testkit/src/main/java/org/apache/calcite/sql/test/AbstractSqlTester.java b/testkit/src/main/java/org/apache/calcite/sql/test/AbstractSqlTester.java
index 5714621d18..a0d1e19e23 100644
--- a/testkit/src/main/java/org/apache/calcite/sql/test/AbstractSqlTester.java
+++ b/testkit/src/main/java/org/apache/calcite/sql/test/AbstractSqlTester.java
@@ -307,18 +307,18 @@ public abstract class AbstractSqlTester implements SqlTester, AutoCloseable {
    * Builds a query that extracts all literals as columns in an underlying
    * select.
    *
-   * <p>For example,</p>
+   * <p>For example,
    *
    * <blockquote>{@code 1 < 5}</blockquote>
    *
-   * <p>becomes</p>
+   * <p>becomes
    *
    * <blockquote>{@code SELECT p0 < p1
    * FROM (VALUES (1, 5)) AS t(p0, p1)}</blockquote>
    *
    * <p>Null literals don't have enough type information to be extracted.
    * We push down {@code CAST(NULL AS type)} but raw nulls such as
-   * {@code CASE 1 WHEN 2 THEN 'a' ELSE NULL END} are left as is.</p>
+   * {@code CASE 1 WHEN 2 THEN 'a' ELSE NULL END} are left as is.
    *
    * @param factory Test factory
    * @param expression Scalar expression
diff --git a/testkit/src/main/java/org/apache/calcite/sql/test/SqlOperatorFixture.java b/testkit/src/main/java/org/apache/calcite/sql/test/SqlOperatorFixture.java
index a00a2d1f52..5eb94dcbc1 100644
--- a/testkit/src/main/java/org/apache/calcite/sql/test/SqlOperatorFixture.java
+++ b/testkit/src/main/java/org/apache/calcite/sql/test/SqlOperatorFixture.java
@@ -503,6 +503,7 @@ public interface SqlOperatorFixture extends AutoCloseable {
 
   /**
    * Tests that an aggregate expression fails at run time.
+   *
    * @param expr An aggregate expression
    * @param inputValues Array of input values
    * @param expectedError Pattern for expected error
diff --git a/testkit/src/main/java/org/apache/calcite/test/CalciteAssert.java b/testkit/src/main/java/org/apache/calcite/test/CalciteAssert.java
index 2d72e41447..1f0c0ee2cd 100644
--- a/testkit/src/main/java/org/apache/calcite/test/CalciteAssert.java
+++ b/testkit/src/main/java/org/apache/calcite/test/CalciteAssert.java
@@ -157,7 +157,7 @@ public class CalciteAssert {
    * Which database to use for tests that require a JDBC data source.
    *
    * @see CalciteSystemProperty#TEST_DB
-   **/
+   */
   public static final DatabaseInstance DB =
       DatabaseInstance.valueOf(CalciteSystemProperty.TEST_DB.value());
 
@@ -233,7 +233,7 @@ public class CalciteAssert {
   }
 
   /** Short-hand for
-   *  {@code CalciteAssert.that().with(Config.EMPTY).withModel(model)}. */
+   * {@code CalciteAssert.that().with(Config.EMPTY).withModel(model)}. */
   public static AssertThat model(String model) {
     return that().withModel(model);
   }
@@ -1172,7 +1172,7 @@ public class CalciteAssert {
       return with(connectionFactory.with(property, value));
     }
 
-    /** Sets the Lex property. **/
+    /** Sets the Lex property. */
     public AssertThat with(Lex lex) {
       return with(CalciteConnectionProperty.LEX, lex);
     }
@@ -1577,10 +1577,10 @@ public class CalciteAssert {
      *
      * <p>Note: this API does NOT trigger the query, so you need to use something like
      * {@link #returns(String)}, or {@link #returnsUnordered(String...)} to trigger query
-     * execution</p>
+     * execution
      *
      * <p>Note: prefer using {@link #explainHookMatches(String)} if you assert
-     * the full plan tree as it produces slightly cleaner messages</p>
+     * the full plan tree as it produces slightly cleaner messages
      *
      * @param expectedPlan expected execution plan. The plan is normalized to LF line endings
      * @return updated assert query
@@ -1597,10 +1597,10 @@ public class CalciteAssert {
      *
      * <p>Note: this API does NOT trigger the query, so you need to use something like
      * {@link #returns(String)}, or {@link #returnsUnordered(String...)} to trigger query
-     * execution</p>
+     * execution
      *
      * <p>Note: prefer using {@link #explainHookMatches(SqlExplainLevel, Matcher)} if you assert
-     * the full plan tree as it produces slightly cleaner messages</p>
+     * the full plan tree as it produces slightly cleaner messages
      *
      * @param sqlExplainLevel the level of explain plan
      * @param expectedPlan expected execution plan. The plan is normalized to LF line endings
@@ -1618,7 +1618,7 @@ public class CalciteAssert {
      *
      * <p>Note: this API does NOT trigger the query, so you need to use something like
      * {@link #returns(String)}, or {@link #returnsUnordered(String...)} to trigger query
-     * execution</p>
+     * execution.
      *
      * @param expectedPlan expected execution plan. The plan is normalized to LF line endings
      * @return updated assert query
@@ -1635,7 +1635,7 @@ public class CalciteAssert {
      *
      * <p>Note: this API does NOT trigger the query, so you need to use something like
      * {@link #returns(String)}, or {@link #returnsUnordered(String...)} to trigger query
-     * execution</p>
+     * execution.
      *
      * @param planMatcher execution plan matcher. The plan is normalized to LF line endings
      * @return updated assert query
@@ -1652,7 +1652,7 @@ public class CalciteAssert {
      *
      * <p>Note: this API does NOT trigger the query, so you need to use something like
      * {@link #returns(String)}, or {@link #returnsUnordered(String...)} to trigger query
-     * execution</p>
+     * execution.
      *
      * @param sqlExplainLevel the level of explain plan
      * @param planMatcher execution plan matcher. The plan is normalized to LF line endings
diff --git a/testkit/src/main/java/org/apache/calcite/test/DiffRepository.java b/testkit/src/main/java/org/apache/calcite/test/DiffRepository.java
index 86cbc1b301..42af61dac3 100644
--- a/testkit/src/main/java/org/apache/calcite/test/DiffRepository.java
+++ b/testkit/src/main/java/org/apache/calcite/test/DiffRepository.java
@@ -87,7 +87,7 @@ import static java.util.Objects.requireNonNull;
  * </code></pre></blockquote>
  *
  * <p>There is an accompanying reference file named after the class,
- * <code>src/test/resources/com/acme/test/MyTest.xml</code>:</p>
+ * <code>src/test/resources/com/acme/test/MyTest.xml</code>:
  *
  * <blockquote><pre><code>
  * &lt;Root&gt;
@@ -111,19 +111,19 @@ import static java.util.Objects.requireNonNull;
  *
  * <p>If any of the test cases fails, a log file is generated, called
  * <code>build/resources/test/com/acme/test/MyTest_actual.xml</code>, containing the actual
- * output.</p>
+ * output.
  *
  * <p>The log
  * file is otherwise identical to the reference log, so once the log file has
  * been verified, it can simply be copied over to become the new reference
- * log:</p>
+ * log:
  *
  * <blockquote><code>cp build/resources/test/com/acme/test/MyTest_actual.xml
  * src/test/resources/com/acme/test/MyTest.xml</code></blockquote>
  *
  * <p>If a resource or test case does not exist, <code>DiffRepository</code>
  * creates them in the log file. Because DiffRepository is so forgiving, it is
- * very easy to create new tests and test cases.</p>
+ * very easy to create new tests and test cases.
  *
  * <p>The {@link #lookup} method ensures that all test cases share the same
  * instance of the repository. This is important more than one test case fails.
diff --git a/testkit/src/main/java/org/apache/calcite/test/DiffTestCase.java b/testkit/src/main/java/org/apache/calcite/test/DiffTestCase.java
index e4f8918372..9029bd95ce 100644
--- a/testkit/src/main/java/org/apache/calcite/test/DiffTestCase.java
+++ b/testkit/src/main/java/org/apache/calcite/test/DiffTestCase.java
@@ -177,7 +177,7 @@ public abstract class DiffTestCase {
    *
    * <p>NOTE: if you wrap the Writer returned by openTestLog() (e.g. with a
    * PrintWriter), be sure to flush the wrapping Writer before calling this
-   * method.</p>
+   * method.
    *
    * @see #diffFile(File, File)
    */
diff --git a/testkit/src/main/java/org/apache/calcite/test/Matchers.java b/testkit/src/main/java/org/apache/calcite/test/Matchers.java
index e6975d9859..03553cecfe 100644
--- a/testkit/src/main/java/org/apache/calcite/test/Matchers.java
+++ b/testkit/src/main/java/org/apache/calcite/test/Matchers.java
@@ -299,6 +299,7 @@ public class Matchers {
   /**
    * Creates a {@link Matcher} that matches execution plan and trims {@code , id=123} node ids.
    * {@link RelNode#getId()} is not stable across runs, so this matcher enables to trim those.
+   *
    * @param value execpted execution plan
    * @return matcher
    */
diff --git a/testkit/src/main/java/org/apache/calcite/test/MockSqlOperatorTable.java b/testkit/src/main/java/org/apache/calcite/test/MockSqlOperatorTable.java
index 60e9e2559e..b4faea11c2 100644
--- a/testkit/src/main/java/org/apache/calcite/test/MockSqlOperatorTable.java
+++ b/testkit/src/main/java/org/apache/calcite/test/MockSqlOperatorTable.java
@@ -604,7 +604,7 @@ public class MockSqlOperatorTable extends ChainedSqlOperatorTable {
     }
   }
 
-  /** "COMPOSITE" user-defined scalar function. **/
+  /** "COMPOSITE" user-defined scalar function. */
   public static class CompositeFunction extends SqlFunction {
     public CompositeFunction() {
       super("COMPOSITE",
diff --git a/testkit/src/main/java/org/apache/calcite/test/Unsafe.java b/testkit/src/main/java/org/apache/calcite/test/Unsafe.java
index bde1999361..d5ca1d332c 100644
--- a/testkit/src/main/java/org/apache/calcite/test/Unsafe.java
+++ b/testkit/src/main/java/org/apache/calcite/test/Unsafe.java
@@ -33,6 +33,7 @@ public class Unsafe {
    * {@link Matcher#matches(Object)} is forbidden in regular test code in favour of
    * {@link org.hamcrest.MatcherAssert#assertThat}.
    * Note: {@code Matcher#matches} is still useful when testing matcher implementations.
+   *
    * @param matcher matcher
    * @param actual actual value
    * @return the result of matcher.matches(actual)
diff --git a/testkit/src/main/java/org/apache/calcite/test/catalog/CompoundNameColumnResolver.java b/testkit/src/main/java/org/apache/calcite/test/catalog/CompoundNameColumnResolver.java
index f4a02717ab..331b190f63 100644
--- a/testkit/src/main/java/org/apache/calcite/test/catalog/CompoundNameColumnResolver.java
+++ b/testkit/src/main/java/org/apache/calcite/test/catalog/CompoundNameColumnResolver.java
@@ -32,7 +32,7 @@ import java.util.List;
 import java.util.Map;
 
 /** ColumnResolver implementation that resolves CompoundNameColumn by simulating
- *  Phoenix behaviors. */
+ * Phoenix behaviors. */
 final class CompoundNameColumnResolver implements MockCatalogReader.ColumnResolver {
   private final Map<String, Integer> nameMap = new HashMap<>();
   private final Map<String, Map<String, Integer>> groupMap = new HashMap<>();
diff --git a/testkit/src/main/java/org/apache/calcite/util/Smalls.java b/testkit/src/main/java/org/apache/calcite/util/Smalls.java
index deba6b0105..6be22f3afe 100644
--- a/testkit/src/main/java/org/apache/calcite/util/Smalls.java
+++ b/testkit/src/main/java/org/apache/calcite/util/Smalls.java
@@ -512,7 +512,7 @@ public class Smalls {
   }
 
   /** As {@link MyPlusFunction} but constructor has a
-   *  {@link org.apache.calcite.schema.FunctionContext} parameter. */
+   * {@link org.apache.calcite.schema.FunctionContext} parameter. */
   public static class MyPlusInitFunction {
     public static final ThreadLocal<AtomicInteger> INSTANCE_COUNT =
         new ThreadLocal<>().withInitial(() -> new AtomicInteger(0));
diff --git a/testkit/src/main/java/org/apache/calcite/util/TestUtil.java b/testkit/src/main/java/org/apache/calcite/util/TestUtil.java
index 15c332c54e..68f753d6b1 100644
--- a/testkit/src/main/java/org/apache/calcite/util/TestUtil.java
+++ b/testkit/src/main/java/org/apache/calcite/util/TestUtil.java
@@ -87,13 +87,16 @@ public abstract class TestUtil {
    * literal.
    *
    * <p>For example,
-   * <pre><code>string with "quotes" split
-   * across lines</code></pre>
+   *
+   * <blockquote><pre>{@code
+   * string with "quotes" split
+   * across lines}</pre></blockquote>
    *
    * <p>becomes
    *
-   * <blockquote><pre><code>"string with \"quotes\" split" + NL +
-   *  "across lines"</code></pre></blockquote>
+   * <blockquote><pre>{@code
+   * "string with \"quotes\" split" + "\n"
+   *   + "across lines"}</pre></blockquote>
    */
   public static String quoteForJava(String s) {
     s = Util.replace(s, "\\", "\\\\");
@@ -112,16 +115,17 @@ public abstract class TestUtil {
    * Converts a string (which may contain quotes and newlines) into a java
    * literal.
    *
-   * <p>For example,</p>
+   * <p>For example,
    *
-   * <blockquote><pre><code>string with "quotes" split
-   * across lines</code></pre></blockquote>
+   * <blockquote><pre>{code
+   * string with "quotes" split
+   * across lines}</pre></blockquote>
    *
-   * <p>becomes</p>
+   * <p>becomes
    *
-   * <blockquote><pre><code>TestUtil.fold(
-   *  "string with \"quotes\" split\n",
-   *  + "across lines")</code></pre></blockquote>
+   * <blockquote><pre>{@code
+   * TestUtil.fold("string with \"quotes\" split\n",
+   *     + "across lines")}</pre></blockquote>
    */
   public static String toJavaString(String s) {
     // Convert [string with "quotes" split