MINOR: Fix withLogicalTypeAnnotation Javadoc @return description#3648
Open
anxkhn wants to merge 1 commit into
Open
MINOR: Fix withLogicalTypeAnnotation Javadoc @return description#3648anxkhn wants to merge 1 commit into
anxkhn wants to merge 1 commit into
Conversation
The @return tag on PrimitiveType.withLogicalTypeAnnotation read "a new PrimitiveType with the same fields and a new id null", which was a mangled copy-paste from the sibling withId(int) method. The method does not assign a new id: it returns a copy carrying the given logical type annotation while preserving the existing id via getId(). Correct the description to match the actual behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
The
@returntag on the public methodPrimitiveType.withLogicalTypeAnnotation(LogicalTypeAnnotation)reads:That description is self-contradicting ("a new id null") and factually wrong. The
method body is:
It passes
getId()straight through to the constructor, so the existing field idis preserved unchanged; only the logical type annotation is replaced. The method
never assigns a new id and never nulls it.
The wording is a mangled copy-paste from the sibling
withId(int)method justabove it, whose
@return a new PrimitiveType with the same fields and a new idiscorrect there because
withIdpassesnew ID(id).What changes are included in this PR?
A single-line Javadoc correction on that
@returntag (inparquet-column/src/main/java/org/apache/parquet/schema/PrimitiveType.java):/** * @param logicalType LogicalTypeAnnotation - * @return a new PrimitiveType with the same fields and a new id null + * @return a new PrimitiveType with the same fields and the given logical type annotation */ public PrimitiveType withLogicalTypeAnnotation(LogicalTypeAnnotation logicalType) {No code behavior changes.
Are these changes tested?
No new test. This is a Javadoc
@returncorrection with no runtime behaviorchange, so a unit test would not assert anything meaningful. I confirmed the
module still builds and produces valid Javadoc:
mvn -pl parquet-column spotless:check-> BUILD SUCCESS (palantir-java-formatgate passes)
mvn -pl parquet-column -am -DskipTests package-> BUILD SUCCESSmvn -pl parquet-column javadoc:javadoc-> BUILD SUCCESS (no new warnings; thecorrected
@returntag is well-formed)Are there any user-facing changes?
No. Documentation (Javadoc) only; no API or behavior change.