Fix Java 9 compile failure (type inference does not work for this example: Java 9 compiler is right!)

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1707843 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2015-10-10 08:38:23 +00:00
parent 6085c0a4c2
commit 4edfc729df
1 changed files with 2 additions and 1 deletions

View File

@ -99,6 +99,7 @@ public class ImplicitPlugins {
public static PluginInfo getReqHandlerInfo(String name, Class clz, Map defaults){
if(defaults == null) defaults= Collections.emptyMap();
Map m = makeMap(NAME, name, "class", clz.getName());
return new PluginInfo(SolrRequestHandler.TYPE, m, new NamedList<>(singletonMap(DEFAULTS, new NamedList(defaults))),null);
// be explicit with generics, because Java 9 fails to compile otherwise (type inference: Map.Entry[] vs. singletonMap):
return new PluginInfo(SolrRequestHandler.TYPE, m, new NamedList<>(Collections.<String,Object>singletonMap(DEFAULTS, new NamedList<>(defaults))),null);
}
}