avoid putting null elements in the symbol addon information list, causes issues when reading such a json and setting the array data back in

This commit is contained in:
Martin Lippert
2019-08-07 16:47:11 +02:00
parent b0e8e53bfc
commit 2768a29f09

View File

@@ -104,9 +104,13 @@ public class WebfluxRouterSymbolProvider extends AbstractSymbolProvider {
Location location = new Location(doc.getUri(), doc.toRange(methodNameStart, node.getLength() - (methodNameStart - invocationStart)));
WebfluxHandlerInformation handler = extractHandlerInformation(node, path, httpMethods, contentTypes, acceptTypes);
WebfluxElementsInformation elements = extractElementsInformation(pathElements, httpMethods, contentTypes, acceptTypes);
SymbolAddOnInformation[] addon = handler != null ?
new SymbolAddOnInformation[] {handler, elements} :
new SymbolAddOnInformation[] {elements};
EnhancedSymbolInformation enhancedSymbol = RouteUtils.createRouteSymbol(location, path, getElementStrings(httpMethods),
getElementStrings(contentTypes), getElementStrings(acceptTypes), new SymbolAddOnInformation[] {handler, elements});
getElementStrings(contentTypes), getElementStrings(acceptTypes), addon);
context.getGeneratedSymbols().add(new CachedSymbol(context.getDocURI(), context.getLastModified(), enhancedSymbol));