Skip to content

Commit

Permalink
[MNG-6829] Replace StringUtils#isEmpty(String) & #isNotEmpty(String)
Browse files Browse the repository at this point in the history
Last batch of is(Not)Empty for https://issues.apache.org/jira/browse/MNG-6829
These are the smallest change sets, hence why I opened more at the same time.
After this we can target the next most often used method from the StringUtils classes.


Use this link to re-run the recipe: https://public.moderne.io/recipes/org.openrewrite.java.migrate.apache.commons.lang.IsNotEmptyToJdk?organizationId=QXBhY2hlIE1hdmVu

Co-authored-by: Moderne <team@moderne.io>
  • Loading branch information
2 people authored and slachiewicz committed Jun 30, 2023
1 parent 357268a commit ab0a1a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/apache/maven/archiver/MavenArchiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ private void addManifestAttribute(Manifest manifest, Map<String, String> map, St
}

private void addManifestAttribute(Manifest manifest, String key, String value) throws ManifestException {
if (!StringUtils.isEmpty(value)) {
if (!(value == null || value.isEmpty())) {
Manifest.Attribute attr = new Manifest.Attribute(key, value);
manifest.addConfiguredAttribute(attr);
} else {
Expand Down Expand Up @@ -772,7 +772,7 @@ public static Optional<Instant> parseBuildOutputTimestamp(String outputTimestamp
}

// Number representing seconds since the epoch
if (StringUtils.isNotEmpty(outputTimestamp) && StringUtils.isNumeric(outputTimestamp)) {
if ((outputTimestamp != null && !outputTimestamp.isEmpty()) && StringUtils.isNumeric(outputTimestamp)) {
return Optional.of(Instant.ofEpochSecond(Long.parseLong(outputTimestamp)));
}

Expand Down

0 comments on commit ab0a1a3

Please sign in to comment.