Skip to content

Commit 8f45d51

Browse files
committed
Prefer using String.isEmpty over String.length()>0
1 parent 0897955 commit 8f45d51

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

api/maven-api-core/src/main/java/org/apache/maven/api/Artifact.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ default String key() {
4343
+ getArtifactId()
4444
+ ':'
4545
+ getExtension()
46-
+ (getClassifier().length() > 0 ? ":" + getClassifier() : "")
46+
+ (getClassifier().isEmpty() ? "" : ":" + getClassifier())
4747
+ ':'
4848
+ getVersion();
4949
}

maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifact.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public DefaultArtifact(@Nonnull AbstractSession session, @Nonnull org.eclipse.ae
4343
+ getArtifactId()
4444
+ ':'
4545
+ getExtension()
46-
+ (getClassifier().length() > 0 ? ":" + getClassifier() : "")
46+
+ (getClassifier().isEmpty() ? "" : ":" + getClassifier())
4747
+ ':'
4848
+ getVersion();
4949
}

0 commit comments

Comments
 (0)