Migrates to Apache POI 3.17
org.openrewrite.apache.poi.UpgradeApachePoi_3_17
Migrates to the last Apache POI 3.x release. This recipe modifies build files and makes changes to deprecated/preferred APIs that have changed between versions.
Tags
apache
poi
Recipe source
GitHub, Issue Tracker, Maven Central
groupId: org.openrewrite.recipe
artifactId: rewrite-apache
version: 1.6.0
This recipe is composed of more than one recipe. If you want to customize the set of recipes this is composed of, you can find and copy the GitHub source for the recipe from the link above.
Definition
Change Gradle or Maven dependency
oldGroupId:
poi
oldArtifactId:
poi
newGroupId:
org.apache.poi
newArtifactId:
poi
newVersion:
3.x
Upgrade Gradle or Maven dependency versions
groupId:
org.apache.poi
artifactId:
poi*
newVersion:
3.x
Change method invocation return type
methodPattern:
org.apache.poi.ss.usermodel.Cell getCellType()
newReturnType:
org.apache.poi.ss.usermodel.CellType
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.Cell.CELL_TYPE_NUMERIC
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellType.NUMERIC
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.Cell.CELL_TYPE_STRING
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellType.STRING
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.Cell.CELL_TYPE_FORMULA
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellType.FORMULA
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.Cell.CELL_TYPE_BLANK
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellType.BLANK
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.Cell.CELL_TYPE_BOOLEAN
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellType.BOOLEAN
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.Cell.CELL_TYPE_ERROR
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellType.ERROR
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.VERTICAL_TOP
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.VerticalAlignment.TOP
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.VERTICAL_CENTER
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.VerticalAlignment.CENTER
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.VERTICAL_BOTTOM
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.VerticalAlignment.BOTTOM
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.VERTICAL_JUSTIFY
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.VerticalAlignment.JUSTIFY
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.ALIGN_LEFT
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.HorizontalAlignment.LEFT
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.ALIGN_CENTER
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.HorizontalAlignment.CENTER
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.ALIGN_RIGHT
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.HorizontalAlignment.RIGHT
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.ALIGN_FILL
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.HorizontalAlignment.FILL
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.ALIGN_JUSTIFY
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.HorizontalAlignment.JUSTIFY
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.ALIGN_CENTER_SELECTION
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.HorizontalAlignment.CENTER_SELECTION
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.ALIGN_CENTER_SELECTION
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.HorizontalAlignment.CENTER_SELECTION
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_NONE
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.NONE
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_THIN
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.THIN
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_MEDIUM
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.MEDIUM
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_DASHED
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.DASHED
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_DOTTED
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.DOTTED
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_THICK
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.THICK
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_DOUBLE
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.DOUBLE
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_HAIR
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.HAIR
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_MEDIUM_DASHED
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.MEDIUM_DASHED
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_DASH_DOT
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.DASH_DOT
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_MEDIUM_DASH_DOT
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.MEDIUM_DASH_DOT
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_DASH_DOT_DOT
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.DASH_DOT_DOT
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_MEDIUM_DASH_DOT_DOT
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.MEDIUM_DASH_DOT_DOT
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_SLANTED_DASH_DOT
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.SLANTED_DASH_DOT
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.NO_FILL
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.NO_FILL
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.SOLID_FOREGROUND
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.SOLID_FOREGROUND
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.FINE_DOTS
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.FINE_DOTS
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.ALT_BARS
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.ALT_BARS
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.SPARSE_DOTS
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.SPARSE_DOTS
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.THICK_HORZ_BANDS
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.THICK_HORZ_BANDS
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.THICK_VERT_BANDS
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.THICK_VERT_BANDS
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.THICK_BACKWARD_DIAG
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.THICK_BACKWARD_DIAG
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.THICK_FORWARD_DIAG
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.THICK_FORWARD_DIAG
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BIG_SPOTS
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.BIG_SPOTS
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BRICKS
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.BRICKS
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.THIN_HORZ_BANDS
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.THIN_HORZ_BANDS
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.THIN_VERT_BANDS
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.THIN_VERT_BANDS
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.THIN_BACKWARD_DIAG
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.THIN_BACKWARD_DIAG
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.THIN_FORWARD_DIAG
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.THIN_FORWARD_DIAG
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.SQUARES
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.SQUARES
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.DIAMONDS
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.DIAMONDS
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.LESS_DOTS
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.LESS_DOTS
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.LEAST_DOTS
fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.LEAST_DOTS
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.common.usermodel.Hyperlink.LINK_URL
fullyQualifiedConstantName:
org.apache.poi.common.usermodel.HyperlinkType.URL
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.common.usermodel.Hyperlink.LINK_DOCUMENT
fullyQualifiedConstantName:
org.apache.poi.common.usermodel.HyperlinkType.DOCUMENT
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.common.usermodel.Hyperlink.LINK_EMAIL
fullyQualifiedConstantName:
org.apache.poi.common.usermodel.HyperlinkType.EMAIL
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.common.usermodel.Hyperlink.LINK_FILE
fullyQualifiedConstantName:
org.apache.poi.common.usermodel.HyperlinkType.FILE
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.xssf.usermodel.XSSFHyperlink.LINK_URL
fullyQualifiedConstantName:
org.apache.poi.common.usermodel.HyperlinkType.URL
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.xssf.usermodel.XSSFHyperlink.LINK_DOCUMENT
fullyQualifiedConstantName:
org.apache.poi.common.usermodel.HyperlinkType.DOCUMENT
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.xssf.usermodel.XSSFHyperlink.LINK_EMAIL
fullyQualifiedConstantName:
org.apache.poi.common.usermodel.HyperlinkType.EMAIL
Replace constant with another constant
existingFullyQualifiedConstantName:
org.apache.poi.xssf.usermodel.XSSFHyperlink.LINK_FILE
fullyQualifiedConstantName:
org.apache.poi.common.usermodel.HyperlinkType.FILE
Usage
This recipe has no required configuration options. It can be activated by adding a dependency on org.openrewrite.recipe:rewrite-apache:1.6.0
in your build file or by running a shell command (in which case no build changes are needed):
Add the following to your
build.gradle
file:
Run
gradle rewriteRun
to run the recipe.
See how this recipe works across multiple open-source repositories
The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories.
Please contact Moderne for more information about safely running the recipes on your own codebase in a private SaaS.
Data Tables
Source files that had results
org.openrewrite.table.SourcesFileResults
Source files that were modified by the recipe run.
Column Name | Description |
---|---|
Source path before the run | The source path of the file before the run. |
Source path after the run | A recipe may modify the source path. This is the path after the run. |
Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. |
Recipe that made changes | The specific recipe that made a change. |
Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. |
Cycle | The recipe cycle in which the change was made. |
Source files that errored on a recipe
org.openrewrite.table.SourcesFileErrors
The details of all errors produced by a recipe run.
Column Name | Description |
---|---|
Source path | The file that failed to parse. |
Recipe that made changes | The specific recipe that made a change. |
Stack trace | The stack trace of the failure. |
Recipe performance
org.openrewrite.table.RecipeRunStats
Statistics used in analyzing the performance of recipes.
Column Name | Description |
---|---|
The recipe | The recipe whose stats are being measured both individually and cumulatively. |
Source file count | The number of source files the recipe ran over. |
Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. |
Cumulative scanning time | The total time spent across the scanning phase of this recipe. |
99th percentile scanning time | 99 out of 100 scans completed in this amount of time. |
Max scanning time | The max time scanning any one source file. |
Cumulative edit time | The total time spent across the editing phase of this recipe. |
99th percentile edit time | 99 out of 100 edits completed in this amount of time. |
Max edit time | The max time editing any one source file. |
Last updated