public final static int API_TYPE_CLOSE = 1;
public final static int API_TYPE_REALLOC = 2;
- HashMap<Integer, LeakData> leakHash;
- HashMap<Integer, LeakData> childHash;
+ HashMap<Long, LeakData> leakHash;
+ HashMap<Long, LeakData> childHash;
private int leakSeq = 0;
public LeakDetector() {
return leakList;
}
- public HashMap<Integer, LeakData> getLeakHash() {
+ public HashMap<Long, LeakData> getLeakHash() {
if (null == leakHash) {
- leakHash = new HashMap<Integer, LeakData>();
+ leakHash = new HashMap<Long, LeakData>();
}
return leakHash;
}
- public HashMap<Integer, LeakData> getChildHash() {
+ public HashMap<Long, LeakData> getChildHash() {
if (null == childHash) {
- childHash = new HashMap<Integer, LeakData>();
+ childHash = new HashMap<Long, LeakData>();
}
return childHash;
}
chk = LeakCheckList.getLeakCheckList().get(apiName);
}
- HashMap<Integer, LeakData> leaks = getLeakHash();
+ HashMap<Long, LeakData> leaks = getLeakHash();
if (chk.getApiType() == API_TYPE_OPEN) {
// if (chk.isCheckUserCall()) {
// checkUserFuncLeakData(logData, chk);
// } else {
LeakData newLeak = new LeakData(logData, this);
- leaks.put(logData.getKey(), newLeak);
+ leaks.put((long)logData.getKey(), newLeak);
// }
} else if (chk.getApiType() == API_TYPE_CLOSE) {
int key = log.getKey();
LeakData freeData = getChildHash().get(key);
if (null != freeData) {
- LeakData parent = leaks.get(freeData.getParentKey());
+ LeakData parent = leaks.get((long)freeData.getParentKey());
parent.removeChild(key);
getChildHash().remove(key);
if (parent.getChildren().isEmpty()) {
String inputParam = ((ProbeCommonData) log).getArgs();
String[] splitInputParam = inputParam.split("\\,"); //$NON-NLS-1$
String param = new String(splitInputParam[0]);
- int rmKey = -1;
- if (param.contains("0x")) {
- rmKey = Integer.decode(param);
- } else {
- rmKey = Integer.parseInt(splitInputParam[0]);
+ long rmKey = -1;
+ try {
+ if (param.contains("0x")) {
+ rmKey = Long.decode(param);
+ } else {
+ rmKey = Integer.parseInt(splitInputParam[0]);
+ }
+ leaks.remove(rmKey);
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
}
- leaks.remove(rmKey);
// internal check
// if (chk.isCheckUserCall()) {
// String key = input[chk.getKeyIndex()];
// leaks.put(key, new LeakData(key, input, this));
int key = log.getKey();
- leaks.put(key, new LeakData(log, this));
+ leaks.put((long)key, new LeakData(log, this));
// }
}
}