mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
avoid null keys in indices
This commit is contained in:
+5
-2
@@ -88,7 +88,7 @@ public class RelaxSymbolIndex extends ScalarIndexExtension<String> {
|
||||
attributeHandler = new NanoXmlUtil.IXMLBuilderAdapter() {
|
||||
@Override
|
||||
public void addAttribute(String key, String nsPrefix, String nsURI, String value, String type) throws Exception {
|
||||
if ("name".equals(key) && (nsURI == null || nsURI.length() == 0)) {
|
||||
if ("name".equals(key) && (nsURI == null || nsURI.length() == 0) && value != null) {
|
||||
map.put(value, null);
|
||||
}
|
||||
}
|
||||
@@ -112,7 +112,10 @@ public class RelaxSymbolIndex extends ScalarIndexExtension<String> {
|
||||
grammar.acceptChildren(new CommonElement.Visitor() {
|
||||
@Override
|
||||
public void visitDefine(Define define) {
|
||||
map.put(define.getName(), null);
|
||||
final String name = define.getName();
|
||||
if (name != null) {
|
||||
map.put(name, null);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ public class XsltSymbolIndex extends FileBasedIndexExtension<String, XsltSymbolI
|
||||
|
||||
@Override
|
||||
public void addAttribute(String key, String nsPrefix, String nsURI, String value, String type) throws Exception {
|
||||
if (key.equals("name") && (nsURI == null || nsURI.length() == 0)) {
|
||||
if (key.equals("name") && (nsURI == null || nsURI.length() == 0) && value != null) {
|
||||
if (myMap.put(value, myKind) != null) {
|
||||
myMap.put(value, Kind.ANYTHING);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user