Skip to content

Bug 69935: Add short-based column setters to ClientAnchor#1006

Merged
pjfanning merged 3 commits intoapache:trunkfrom
jogakdal:bug-69935-clientanchor-short-setters
Feb 14, 2026
Merged

Bug 69935: Add short-based column setters to ClientAnchor#1006
pjfanning merged 3 commits intoapache:trunkfrom
jogakdal:bug-69935-clientanchor-short-setters

Conversation

@jogakdal
Copy link
Contributor

@jogakdal jogakdal commented Feb 9, 2026

This PR addresses Bug 69935,
where ClientAnchor exposes short-returning getters for the column indices (getCol1(), getCol2()) but only int-based setters (setCol1(int), setCol2(int)).

This mismatch makes it difficult to use Kotlin property syntax, which expects matching getter/setter types for a property.

What is changed

  • Add default short-based setters on ClientAnchor:

    • default void setCol1(short col1) delegating to setCol1(int).
    • default void setCol2(short col2) delegating to setCol2(int).

    This keeps the existing int-based setters intact and binary compatible, while exposing a short-typed getter/setter pair that works better with Kotlin properties.

  • Add TestClientAnchorShortSetter to cover:

    • The new short-based setters delegate correctly to the existing int-based setters.
    • The existing int-based setters still behave as before.

Notes

  • The @since tag on the new methods is left as TBD and can be adjusted by the committer to the appropriate release version.

Testing

Locally ran:

./gradlew :poi:test --tests 'org.apache.poi.ss.usermodel.TestClientAnchorShortSetter'

Introduce short-based column setters on ClientAnchor to complement the existing int-based setters and improve Kotlin property support.

- Add default short setters setCol1(short) and setCol2(short) that delegate to the existing int-based setters.
- Add TestClientAnchorShortSetter to verify both the new short-based setters and the existing int-based setters.

Tests:
- ./gradlew :poi:test --tests 'org.apache.poi.ss.usermodel.TestClientAnchorShortSetter'
@pjfanning
Copy link
Member

next release is 6.0.0 - could you replace the TBD?

…horShortSetterntAnchorShortSetter.java

Added license header to TestClientAnchorShortSetter.java
@jogakdal
Copy link
Contributor Author

Thanks for the review.

Added the standard ASF license header to TestClientAnchorShortSetter to match other POI source files.

Copy link
Member

@pjfanning pjfanning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - merged

@pjfanning pjfanning merged commit 8d53613 into apache:trunk Feb 14, 2026
1 check passed
@jogakdal jogakdal deleted the bug-69935-clientanchor-short-setters branch February 16, 2026 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants