Skip to content

Commit 6f929fc

Browse files
committed
review : remove wildcard imports and use isEmpty from Apache commons
Signed-off-by: Rohan Kumar <rohaan@redhat.com>
1 parent d249767 commit 6f929fc

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/main/java/io/fabric8/maven/docker/util/ContainerNamingUtil.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
package io.fabric8.maven.docker.util;
22

3-
import java.util.*;
3+
import java.util.ArrayList;
4+
import java.util.Collection;
5+
import java.util.Collections;
6+
import java.util.Date;
7+
import java.util.HashMap;
8+
import java.util.HashSet;
9+
import java.util.Map;
10+
import java.util.Set;
411
import java.util.function.Function;
512
import java.util.stream.Collectors;
613

src/main/java/io/fabric8/maven/docker/util/ImageNameFormatter.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import io.fabric8.maven.docker.config.ConfigHelper;
2626
import org.apache.maven.project.MavenProject;
2727

28+
import static org.apache.commons.lang3.StringUtils.isEmpty;
29+
2830
/**
2931
* Replace placeholders in an image name with certain properties found in the
3032
* project
@@ -178,7 +180,7 @@ public String doTransform(String tag, Date now) {
178180

179181
public String transform(MavenProject project, String tag, Date now) {
180182
// In case the Maven property is also a placeholder, replace it as well
181-
if(isNullorEmpty(tag) || tag.equals("%" + letter)) {
183+
if(isEmpty(tag) || tag.equals("%" + letter)) {
182184
tag = project.getVersion();
183185
}
184186
return doTransform(tag, now);
@@ -248,8 +250,4 @@ private static String sanitizeName(String name) {
248250
// All characters must be lowercase
249251
return ret.toString().toLowerCase();
250252
}
251-
252-
private static boolean isNullorEmpty(String s) {
253-
return Objects.isNull(s) || s.isEmpty();
254-
}
255253
}

0 commit comments

Comments
 (0)