test logging: key by hashCode

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1484795 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2013-05-21 13:23:03 +00:00
parent 697133b10f
commit 2e716bad60
1 changed files with 3 additions and 11 deletions

View File

@ -81,15 +81,7 @@ public class SolrLogLayout extends Layout {
Map<String,Object> coreProps;
}
Map<SolrCore,CoreInfo> coreInfoMap = new WeakHashMap<SolrCore,CoreInfo>(); // TODO:
// use
// something
// that
// survives
// across
// a
// core
// reload?
Map<Integer,CoreInfo> coreInfoMap = new WeakHashMap<Integer,CoreInfo>();
public Map<String,String> classAliases = new HashMap<String,String>();
@ -145,11 +137,11 @@ public class SolrLogLayout extends Layout {
CoreInfo info = null;
if (core != null) {
info = coreInfoMap.get(core);
info = coreInfoMap.get(core.hashCode());
if (info == null) {
info = new CoreInfo();
info.shortId = "C" + Integer.toString(CoreInfo.maxCoreNum++);
coreInfoMap.put(core, info);
coreInfoMap.put(core.hashCode(), info);
if (sb.length() == 0) sb.append("ASYNC ");
sb.append(" NEW_CORE " + info.shortId);