From 2fab2220ca3f3eb5bca515df676d2ed93d638e30 Mon Sep 17 00:00:00 2001 From: irengrig Date: Mon, 16 Jan 2017 15:52:40 +0100 Subject: [PATCH] json schema, additional check to do not get eternal cycle --- json/src/com/jetbrains/jsonSchema/impl/JsonSchemaWalker.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaWalker.java b/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaWalker.java index 4f6ec33fc6bf..b0f37226ce45 100644 --- a/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaWalker.java +++ b/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaWalker.java @@ -121,11 +121,13 @@ public class JsonSchemaWalker { public static void extractSchemaVariants(@NotNull final Project project, @NotNull final CompletionSchemesConsumer consumer, @NotNull VirtualFile rootSchemaFile, @NotNull JsonSchemaObject rootSchema, boolean isName, List position) { + final Set>> control = new HashSet<>(); final JsonSchemaServiceEx serviceEx = JsonSchemaServiceEx.Impl.getEx(project); final ArrayDeque>> queue = new ArrayDeque<>(); queue.add(Trinity.create(rootSchema, rootSchemaFile, position)); while (!queue.isEmpty()) { final Trinity> trinity = queue.removeFirst(); + if (!control.add(trinity)) break; final JsonSchemaObject object = trinity.getFirst(); final VirtualFile schemaFile = trinity.getSecond(); final List path = trinity.getThird();