Skip to content

Add migration recipe for Apache POI 4.1.2#119

Merged
timtebeek merged 2 commits intoopenrewrite:mainfrom
krlittle:krlittle/poi-4.1.2-recipe
Feb 17, 2026
Merged

Add migration recipe for Apache POI 4.1.2#119
timtebeek merged 2 commits intoopenrewrite:mainfrom
krlittle:krlittle/poi-4.1.2-recipe

Conversation

@krlittle
Copy link
Contributor

@krlittle krlittle commented Feb 17, 2026

Summary

  • Adds UpgradeApachePoi_4_1 recipe that migrates projects from any version of Apache POI to the last 4.x release (4.1.2)
  • Chains the existing UpgradeApachePoi_3_17 recipe to handle pre-3.17 migrations, then applies 4.x-specific changes on top
  • Handles dependency version upgrades, class renames (NPOIFSFileSystem -> POIFSFileSystem, OPOIFSFileSystem -> POIFSFileSystem), typo fix (TextSegement -> TextSegment), package move (ExtractorFactory), and Nullable -> Optional

Test plan

  • Unit tests pass for all POI recipes (./gradlew test --tests "org.openrewrite.apache.poi.*")
  • Full build passes (./gradlew build)
  • Tested against sample-apache-poi-project — recipe correctly migrates NPOIFSFileSystem, Cell.CELL_TYPE_* constants, and getCellType() return types

Supporting documentation

Adds UpgradeApachePoi_4_1 recipe that migrates projects from any
version of Apache POI to 4.1.2. The recipe chains the existing 3.17
recipe and adds 4.x-specific changes:

- Upgrade dependency versions to 4.x
- NPOIFSFileSystem -> POIFSFileSystem (merged in 4.0)
- OPOIFSFileSystem -> POIFSFileSystem (removed in 4.0)
- TextSegement -> TextSegment (typo fix)
- ExtractorFactory package move for Java 9 modules
- Nullable -> java.util.Optional
@github-project-automation github-project-automation bot moved this from In Progress to Ready to Review in OpenRewrite Feb 17, 2026
@timtebeek timtebeek merged commit b7e2138 into openrewrite:main Feb 17, 2026
1 check passed
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants