Skip to content

Commit 5bf52d2

Browse files
authored
Set cell in ExcelWriter to blank if the contents is empty after replacing placeholders. (#362)
* Set cell in ExcelWriter to blank if the contents is empty after replacing placeholders. * Update release notes
1 parent 8ca2d74 commit 5bf52d2

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

core/src/main/java/com/devonfw/tools/solicitor/writer/xls/ExcelWriter.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,11 @@ private void iterateFromCell(Workbook wb, Cell cell, DataTable dataTable, String
339339
}
340340
}
341341
if (cellType == CellType.STRING) {
342-
oneCell.setCellValue(trimToMaxCellLength(text.replace("\r", "")));
342+
if (text.isBlank()) {
343+
oneCell.setBlank();
344+
} else {
345+
oneCell.setCellValue(trimToMaxCellLength(text.replace("\r", "")));
346+
}
343347
if (hasChanged) {
344348
addCommentToCell(oneCell, trimToMaxCellLength("Previous value: '" + oldModelText.replace("\r", "") + "'"));
345349
}

documentation/master-solicitor.asciidoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ _Solicitor_ if the includeFilter regex is matched and the excludeFilter regex is
416416
If the PackageURL of the component is not defined it will be represented as an empty string when doing the regular expression
417417
matching. (An empty/zero length regex string will match in this case.)
418418

419+
[[FromPackageURL,Deriving groupId, ArtifactId and Version from the PackageURL]]
419420
===== Deriving groupId, ArtifactId and Version from the PackageURL
420421

421422
If the data of components which is read via a Reader contains the coordinates groupId, artifactId and version as well as a PackageURL it might be possible that the mapping between the "coordinates" (which historically were initially defined for maven packages) and the PackageURL is not consistent to the standard mapping as used by Solicitor. By setting reader configuration property `deriveCoordinatesFromPurl` to `true` it is possible
@@ -2097,7 +2098,8 @@ creating a rule template file, defining the decision table as XLS or CSV file an
20972098
[appendix]
20982099
== Release Notes
20992100
Changes in 1.49.0::
2100-
* https://github.com/devonfw/solicitor/issues/360: Allow alignment of groupId, artifactId and version to PackageURL when reading component lists with Readers. See <<Deriving groupId, ArtifactId and Version from the PackageURL>>.
2101+
* https://github.com/devonfw/solicitor/issues/360: Allow alignment of groupId, artifactId and version to PackageURL when reading component lists with Readers. See <<FromPackageURL>>.
2102+
* https://github.com/devonfw/solicitor/pull/362: Set cell in ExcelWriter to blank if the contents is empty after replacing placeholders.
21012103

21022104
Changes in 1.48.0::
21032105
* https://github.com/devonfw/solicitor/pull/357: Refactor model import logic.

0 commit comments

Comments
 (0)