From fd34271b0feda8cc9a7845d09f971a1266fcb538 Mon Sep 17 00:00:00 2001 From: Anton Lobov Date: Tue, 31 Dec 2019 10:33:32 +0100 Subject: [PATCH] IDEA-CR-57054 simplify and fix the blinking test GitOrigin-RevId: 9c3baeb6e85e31fd73f9b26c8eae3d6f0ab204b9 --- .../jsonSchema/impl/JsonSchemaAnnotatorChecker.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaAnnotatorChecker.java b/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaAnnotatorChecker.java index d03349cef5e2..40964c4e4b6e 100644 --- a/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaAnnotatorChecker.java +++ b/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaAnnotatorChecker.java @@ -159,12 +159,8 @@ class JsonSchemaAnnotatorChecker { boolean checkedObject = false; if (type != null) { JsonSchemaType schemaType = getMatchingSchemaType(schema, type); - if (schemaType != null && !schemaType.equals(type)) { - JsonSchemaType altType = value.getAlternateType(type); - JsonSchemaType matchingAltType = getMatchingSchemaType(schema, altType); - if (altType == type || matchingAltType != null && !schemaType.equals(matchingAltType)) { - typeError(value.getDelegate(), altType, getExpectedTypes(Collections.singleton(schema))); - } + if (schemaType != null && !schemaType.equals(type) && !schemaType.equals(value.getAlternateType(type))) { + typeError(value.getDelegate(), value.getAlternateType(type), getExpectedTypes(Collections.singleton(schema))); } else { if (JsonSchemaType._string_number.equals(type)) {