mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-10 02:26:18 +00:00
Further reduce usages of StringUtils (#9044)
* Remove usages of StringUtils#containsIgnoreCase Signed-off-by: Bob Du <i@bobdu.cc> * Remove usages of StringUtils#removeStart StringUtils#removeEnd Signed-off-by: Bob Du <i@bobdu.cc> * Remove usages of StringUtils#defaultString Signed-off-by: Bob Du <i@bobdu.cc> * Remove usages of StringUtils#defaultIfBlank Signed-off-by: Bob Du <i@bobdu.cc> * Remove usages of StringUtils#isAlphanumeric Signed-off-by: Bob Du <i@bobdu.cc> * Remove usages of StringUtils.EMPTY Signed-off-by: Bob Du <i@bobdu.cc> * Remove usages of StringUtils#split Signed-off-by: Bob Du <i@bobdu.cc> * Remove usages of StringUtils#startsWithIgnoreCase Signed-off-by: Bob Du <i@bobdu.cc> * Remove usages of StringUtils#countMatches Signed-off-by: Bob Du <i@bobdu.cc> * Remove usages of StringUtils#endsWithAny Signed-off-by: Bob Du <i@bobdu.cc> * fix spotbugs warning Signed-off-by: Bob Du <i@bobdu.cc> * Use Objects.toString Signed-off-by: Bob Du <i@bobdu.cc> * revert unrelated change Signed-off-by: Bob Du <i@bobdu.cc> --------- Signed-off-by: Bob Du <i@bobdu.cc>
This commit is contained in:
1 parent
e914bb6d76
commit
8197702484
17 files changed
+53
-43
No files matched your search
@@ -73,7 +73,6 @@ import jenkins.model.Jenkins;
|
||||
import jenkins.plugins.DetachedPluginsUtil;
|
||||
import jenkins.security.UpdateSiteWarningsMonitor;
|
||||
import jenkins.util.URLClassLoader2;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.kohsuke.accmod.Restricted;
|
||||
import org.kohsuke.accmod.restrictions.Beta;
|
||||
@@ -497,7 +496,12 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return StringUtils.removeStart(getLongName(), "Jenkins ");
|
||||
String displayName = getLongName();
|
||||
String removePrefix = "Jenkins ";
|
||||
if (displayName != null && displayName.startsWith(removePrefix)) {
|
||||
return displayName.substring(removePrefix.length());
|
||||
}
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public Api getApi() {
|
||||
|
||||
Reference in new issue
Block a user