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.8.2
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
- Recipe List
- Yaml Recipe List
- Change Gradle or Maven dependency
- oldGroupId:
poi
- oldArtifactId:
poi
- newGroupId:
org.apache.poi
- newArtifactId:
poi
- newVersion:
3.x
- oldGroupId:
- Upgrade Gradle or Maven dependency versions
- groupId:
org.apache.poi
- artifactId:
poi*
- newVersion:
3.x
- groupId:
- Replace
Font.setBoldweight(short)
withFont.setBold(boolean)
- Replace
Cell.setCellType(int)
withCell.setCellType(CellType)
- Change method invocation return type
- methodPattern:
org.apache.poi.ss.usermodel.Cell getCellType()
- newReturnType:
org.apache.poi.ss.usermodel.CellType
- methodPattern:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.Cell.CELL_TYPE_NUMERIC
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellType.NUMERIC
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.Cell.CELL_TYPE_STRING
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellType.STRING
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.Cell.CELL_TYPE_FORMULA
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellType.FORMULA
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.Cell.CELL_TYPE_BLANK
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellType.BLANK
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.Cell.CELL_TYPE_BOOLEAN
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellType.BOOLEAN
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.Cell.CELL_TYPE_ERROR
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellType.ERROR
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.VERTICAL_TOP
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.VerticalAlignment.TOP
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.VERTICAL_CENTER
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.VerticalAlignment.CENTER
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.VERTICAL_BOTTOM
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.VerticalAlignment.BOTTOM
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.VERTICAL_JUSTIFY
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.VerticalAlignment.JUSTIFY
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.ALIGN_LEFT
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.HorizontalAlignment.LEFT
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.ALIGN_CENTER
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.HorizontalAlignment.CENTER
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.ALIGN_RIGHT
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.HorizontalAlignment.RIGHT
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.ALIGN_FILL
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.HorizontalAlignment.FILL
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.ALIGN_JUSTIFY
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.HorizontalAlignment.JUSTIFY
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.ALIGN_CENTER_SELECTION
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.HorizontalAlignment.CENTER_SELECTION
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.ALIGN_CENTER_SELECTION
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.HorizontalAlignment.CENTER_SELECTION
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_NONE
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.NONE
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_THIN
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.THIN
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_MEDIUM
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.MEDIUM
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_DASHED
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.DASHED
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_DOTTED
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.DOTTED
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_THICK
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.THICK
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_DOUBLE
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.DOUBLE
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_HAIR
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.HAIR
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_MEDIUM_DASHED
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.MEDIUM_DASHED
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BORDER_DASH_DOT
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.BorderStyle.DASH_DOT
- existingFullyQualifiedConstantName:
- 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
- existingFullyQualifiedConstantName:
- 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
- existingFullyQualifiedConstantName:
- 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
- existingFullyQualifiedConstantName:
- 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
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.NO_FILL
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.NO_FILL
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.SOLID_FOREGROUND
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.SOLID_FOREGROUND
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.FINE_DOTS
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.FINE_DOTS
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.ALT_BARS
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.ALT_BARS
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.SPARSE_DOTS
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.SPARSE_DOTS
- existingFullyQualifiedConstantName:
- 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
- existingFullyQualifiedConstantName:
- 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
- existingFullyQualifiedConstantName:
- 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
- existingFullyQualifiedConstantName:
- 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
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BIG_SPOTS
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.BIG_SPOTS
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.BRICKS
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.BRICKS
- existingFullyQualifiedConstantName:
- 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
- existingFullyQualifiedConstantName:
- 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
- existingFullyQualifiedConstantName:
- 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
- existingFullyQualifiedConstantName:
- 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
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.SQUARES
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.SQUARES
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.DIAMONDS
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.DIAMONDS
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.LESS_DOTS
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.LESS_DOTS
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.ss.usermodel.CellStyle.LEAST_DOTS
- fullyQualifiedConstantName:
org.apache.poi.ss.usermodel.FillPatternType.LEAST_DOTS
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.common.usermodel.Hyperlink.LINK_URL
- fullyQualifiedConstantName:
org.apache.poi.common.usermodel.HyperlinkType.URL
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.common.usermodel.Hyperlink.LINK_DOCUMENT
- fullyQualifiedConstantName:
org.apache.poi.common.usermodel.HyperlinkType.DOCUMENT
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.common.usermodel.Hyperlink.LINK_EMAIL
- fullyQualifiedConstantName:
org.apache.poi.common.usermodel.HyperlinkType.EMAIL
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.common.usermodel.Hyperlink.LINK_FILE
- fullyQualifiedConstantName:
org.apache.poi.common.usermodel.HyperlinkType.FILE
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.xssf.usermodel.XSSFHyperlink.LINK_URL
- fullyQualifiedConstantName:
org.apache.poi.common.usermodel.HyperlinkType.URL
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.xssf.usermodel.XSSFHyperlink.LINK_DOCUMENT
- fullyQualifiedConstantName:
org.apache.poi.common.usermodel.HyperlinkType.DOCUMENT
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.xssf.usermodel.XSSFHyperlink.LINK_EMAIL
- fullyQualifiedConstantName:
org.apache.poi.common.usermodel.HyperlinkType.EMAIL
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
org.apache.poi.xssf.usermodel.XSSFHyperlink.LINK_FILE
- fullyQualifiedConstantName:
org.apache.poi.common.usermodel.HyperlinkType.FILE
- existingFullyQualifiedConstantName:
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.apache.poi.UpgradeApachePoi_3_17
displayName: Migrates to Apache POI 3.17
description: 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
recipeList:
- org.openrewrite.java.dependencies.ChangeDependency:
oldGroupId: poi
oldArtifactId: poi
newGroupId: org.apache.poi
newArtifactId: poi
newVersion: 3.x
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.apache.poi
artifactId: poi*
newVersion: 3.x
- org.openrewrite.apache.poi.ReplaceSetBoldweightWithSetBoldRecipes
- org.openrewrite.apache.poi.ReplaceSetCellTypeRecipes
- org.openrewrite.java.migrate.ChangeMethodInvocationReturnType:
methodPattern: org.apache.poi.ss.usermodel.Cell getCellType()
newReturnType: org.apache.poi.ss.usermodel.CellType
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.Cell.CELL_TYPE_NUMERIC
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellType.NUMERIC
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.Cell.CELL_TYPE_STRING
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellType.STRING
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.Cell.CELL_TYPE_FORMULA
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellType.FORMULA
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.Cell.CELL_TYPE_BLANK
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellType.BLANK
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.Cell.CELL_TYPE_BOOLEAN
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellType.BOOLEAN
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.Cell.CELL_TYPE_ERROR
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellType.ERROR
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.VERTICAL_TOP
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.VerticalAlignment.TOP
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.VERTICAL_CENTER
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.VerticalAlignment.CENTER
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.VERTICAL_BOTTOM
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.VerticalAlignment.BOTTOM
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.VERTICAL_JUSTIFY
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.VerticalAlignment.JUSTIFY
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.ALIGN_LEFT
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.HorizontalAlignment.LEFT
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.ALIGN_CENTER
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.HorizontalAlignment.CENTER
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.ALIGN_RIGHT
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.HorizontalAlignment.RIGHT
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.ALIGN_FILL
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.HorizontalAlignment.FILL
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.ALIGN_JUSTIFY
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.HorizontalAlignment.JUSTIFY
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.ALIGN_CENTER_SELECTION
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.HorizontalAlignment.CENTER_SELECTION
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.ALIGN_CENTER_SELECTION
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.HorizontalAlignment.CENTER_SELECTION
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.BORDER_NONE
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.BorderStyle.NONE
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.BORDER_THIN
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.BorderStyle.THIN
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.BORDER_MEDIUM
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.BorderStyle.MEDIUM
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.BORDER_DASHED
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.BorderStyle.DASHED
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.BORDER_DOTTED
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.BorderStyle.DOTTED
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.BORDER_THICK
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.BorderStyle.THICK
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.BORDER_DOUBLE
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.BorderStyle.DOUBLE
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.BORDER_HAIR
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.BorderStyle.HAIR
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.BORDER_MEDIUM_DASHED
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.BorderStyle.MEDIUM_DASHED
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.BORDER_DASH_DOT
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.BorderStyle.DASH_DOT
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.BORDER_MEDIUM_DASH_DOT
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.BorderStyle.MEDIUM_DASH_DOT
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.BORDER_DASH_DOT_DOT
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.BorderStyle.DASH_DOT_DOT
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.BORDER_MEDIUM_DASH_DOT_DOT
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.BorderStyle.MEDIUM_DASH_DOT_DOT
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.BORDER_SLANTED_DASH_DOT
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.BorderStyle.SLANTED_DASH_DOT
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.NO_FILL
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.FillPatternType.NO_FILL
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.SOLID_FOREGROUND
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.FillPatternType.SOLID_FOREGROUND
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.FINE_DOTS
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.FillPatternType.FINE_DOTS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.ALT_BARS
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.FillPatternType.ALT_BARS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.SPARSE_DOTS
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.FillPatternType.SPARSE_DOTS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.THICK_HORZ_BANDS
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.FillPatternType.THICK_HORZ_BANDS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.THICK_VERT_BANDS
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.FillPatternType.THICK_VERT_BANDS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.THICK_BACKWARD_DIAG
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.FillPatternType.THICK_BACKWARD_DIAG
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.THICK_FORWARD_DIAG
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.FillPatternType.THICK_FORWARD_DIAG
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.BIG_SPOTS
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.FillPatternType.BIG_SPOTS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.BRICKS
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.FillPatternType.BRICKS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.THIN_HORZ_BANDS
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.FillPatternType.THIN_HORZ_BANDS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.THIN_VERT_BANDS
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.FillPatternType.THIN_VERT_BANDS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.THIN_BACKWARD_DIAG
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.FillPatternType.THIN_BACKWARD_DIAG
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.THIN_FORWARD_DIAG
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.FillPatternType.THIN_FORWARD_DIAG
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.SQUARES
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.FillPatternType.SQUARES
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.DIAMONDS
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.FillPatternType.DIAMONDS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.LESS_DOTS
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.FillPatternType.LESS_DOTS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.ss.usermodel.CellStyle.LEAST_DOTS
fullyQualifiedConstantName: org.apache.poi.ss.usermodel.FillPatternType.LEAST_DOTS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.common.usermodel.Hyperlink.LINK_URL
fullyQualifiedConstantName: org.apache.poi.common.usermodel.HyperlinkType.URL
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.common.usermodel.Hyperlink.LINK_DOCUMENT
fullyQualifiedConstantName: org.apache.poi.common.usermodel.HyperlinkType.DOCUMENT
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.common.usermodel.Hyperlink.LINK_EMAIL
fullyQualifiedConstantName: org.apache.poi.common.usermodel.HyperlinkType.EMAIL
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.common.usermodel.Hyperlink.LINK_FILE
fullyQualifiedConstantName: org.apache.poi.common.usermodel.HyperlinkType.FILE
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.xssf.usermodel.XSSFHyperlink.LINK_URL
fullyQualifiedConstantName: org.apache.poi.common.usermodel.HyperlinkType.URL
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.xssf.usermodel.XSSFHyperlink.LINK_DOCUMENT
fullyQualifiedConstantName: org.apache.poi.common.usermodel.HyperlinkType.DOCUMENT
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.poi.xssf.usermodel.XSSFHyperlink.LINK_EMAIL
fullyQualifiedConstantName: org.apache.poi.common.usermodel.HyperlinkType.EMAIL
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
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.8.2
in your build file or by running a shell command (in which case no build changes are needed):
- Gradle
- Gradle init script
- Maven POM
- Maven Command Line
- Moderne CLI
- Add the following to your
build.gradle
file:
plugins {
id("org.openrewrite.rewrite") version("6.27.1")
}
rewrite {
activeRecipe("org.openrewrite.apache.poi.UpgradeApachePoi_3_17")
setExportDatatables(true)
}
repositories {
mavenCentral()
}
dependencies {
rewrite("org.openrewrite.recipe:rewrite-apache:1.8.2")
}
- Run
gradle rewriteRun
to run the recipe.
- Create a file named
init.gradle
in the root of your project.
initscript {
repositories {
maven { url "https://plugins.gradle.org/m2" }
}
dependencies { classpath("org.openrewrite:plugin:6.27.1") }
}
rootProject {
plugins.apply(org.openrewrite.gradle.RewritePlugin)
dependencies {
rewrite("org.openrewrite.recipe:rewrite-apache:1.8.2")
}
rewrite {
activeRecipe("org.openrewrite.apache.poi.UpgradeApachePoi_3_17")
setExportDatatables(true)
}
afterEvaluate {
if (repositories.isEmpty()) {
repositories {
mavenCentral()
}
}
}
}
- Run the recipe.
gradle --init-script init.gradle rewriteRun
- Add the following to your
pom.xml
file:
<project>
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>5.45.0</version>
<configuration>
<exportDatatables>true</exportDatatables>
<activeRecipes>
<recipe>org.openrewrite.apache.poi.UpgradeApachePoi_3_17</recipe>
</activeRecipes>
</configuration>
<dependencies>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-apache</artifactId>
<version>1.8.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
- Run
mvn rewrite:run
to run the recipe.
You will need to have Maven installed on your machine before you can run the following command.
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-apache:RELEASE -Drewrite.activeRecipes=org.openrewrite.apache.poi.UpgradeApachePoi_3_17 -Drewrite.exportDatatables=true
You will need to have configured the Moderne CLI on your machine before you can run the following command.
mod run . --recipe UpgradeApachePoi_3_17
See how this recipe works across multiple open-source repositories
Run this recipe on OSS repos at scale with the Moderne SaaS.
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. null when a source file was created during the run. |
Source path after the run | A recipe may modify the source path. This is the path after the run. null when a source file was deleted during 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. |