lower case names in translation index table
This commit is contained in:
parent
da89d13c77
commit
2c9b1f638a
|
@ -94,6 +94,7 @@ public class Pdh extends Win32 {
|
||||||
//called by RegistryKey.getMultiStringValue
|
//called by RegistryKey.getMultiStringValue
|
||||||
//format description see: http://support.microsoft.com/kb/q287159/
|
//format description see: http://support.microsoft.com/kb/q287159/
|
||||||
public boolean add(Object o) {
|
public boolean add(Object o) {
|
||||||
|
o = ((String)o).trim().toLowerCase();
|
||||||
if (index == null) {
|
if (index == null) {
|
||||||
index = (String)o;
|
index = (String)o;
|
||||||
return true;
|
return true;
|
||||||
|
@ -147,7 +148,9 @@ public class Pdh extends Win32 {
|
||||||
public static String getCounterName(int index)
|
public static String getCounterName(int index)
|
||||||
throws Win32Exception {
|
throws Win32Exception {
|
||||||
|
|
||||||
return pdhLookupPerfName(index).trim();
|
String name = pdhLookupPerfName(index).trim();
|
||||||
|
|
||||||
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -168,10 +171,14 @@ public class Pdh extends Win32 {
|
||||||
|
|
||||||
private static final String DELIM = "\\";
|
private static final String DELIM = "\\";
|
||||||
|
|
||||||
|
private static int[] getCounterIndex(String englishName) {
|
||||||
|
return (int[])counters.get(englishName.toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
private static String getCounterName(String englishName)
|
private static String getCounterName(String englishName)
|
||||||
throws Win32Exception {
|
throws Win32Exception {
|
||||||
|
|
||||||
int[] ix = (int[])counters.get(englishName);
|
int[] ix = getCounterIndex(englishName);
|
||||||
if (ix == null) {
|
if (ix == null) {
|
||||||
return englishName;
|
return englishName;
|
||||||
}
|
}
|
||||||
|
@ -214,7 +221,7 @@ public class Pdh extends Win32 {
|
||||||
String counter = tok.nextToken();
|
String counter = tok.nextToken();
|
||||||
trans.append(DELIM);
|
trans.append(DELIM);
|
||||||
|
|
||||||
int[] cix = (int[])counters.get(counter);
|
int[] cix = getCounterIndex(counter);
|
||||||
if (cix != null) {
|
if (cix != null) {
|
||||||
if (cix.length == 1) {
|
if (cix.length == 1) {
|
||||||
counter = getCounterName(cix[0]);
|
counter = getCounterName(cix[0]);
|
||||||
|
|
Loading…
Reference in New Issue