mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 04:22:16 +00:00
sort items case insensitively (#1211)
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6864 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
38cc646c24
commit
ec4f9c86d5
4 files changed
+30
-21
No files matched your search
@@ -1,15 +1,14 @@
|
||||
package hudson;
|
||||
|
||||
import hudson.remoting.VirtualChannel;
|
||||
import hudson.remoting.Callable;
|
||||
import hudson.remoting.VirtualChannel;
|
||||
import hudson.util.CaseInsensitiveComparator;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
import java.util.Comparator;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* Environment variables.
|
||||
@@ -27,11 +26,11 @@ import java.util.Collections;
|
||||
public class EnvVars extends TreeMap<String,String> {
|
||||
|
||||
public EnvVars() {
|
||||
super(CASE_INSENSITIVE_COMPARATOR);
|
||||
super(CaseInsensitiveComparator.INSTANCE);
|
||||
}
|
||||
|
||||
public EnvVars(Map<String,String> m) {
|
||||
super(CASE_INSENSITIVE_COMPARATOR);
|
||||
super(CaseInsensitiveComparator.INSTANCE);
|
||||
putAll(m);
|
||||
}
|
||||
|
||||
@@ -85,21 +84,8 @@ public class EnvVars extends TreeMap<String,String> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Compares strings case insensitively.
|
||||
*/
|
||||
private static final Comparator<String> CASE_INSENSITIVE_COMPARATOR = new CaseInsensitiveComparator();
|
||||
|
||||
/**
|
||||
* Environmental variables that we've inherited.
|
||||
*/
|
||||
public static final Map<String,String> masterEnvVars = new EnvVars(System.getenv());
|
||||
|
||||
private static class CaseInsensitiveComparator implements Comparator<String>, Serializable {
|
||||
public int compare(String lhs, String rhs) {
|
||||
return lhs.compareToIgnoreCase(rhs);
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user