diff --git a/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaConflictNotificationProvider.java b/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaConflictNotificationProvider.java index 139ad3fa0db5..fb0da093362f 100644 --- a/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaConflictNotificationProvider.java +++ b/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaConflictNotificationProvider.java @@ -65,10 +65,12 @@ public class JsonSchemaConflictNotificationProvider extends EditorNotifications. final Worker worker = new Worker(); final String message = worker.createMessage(descriptors); + if (message == null) return null; + final EditorNotificationPanel panel = new EditorNotificationPanel() { @Override public Color getBackground() { - return worker.myIsOverridingSystemSchemaCase ? LightColors.SLIGHTLY_GREEN : LightColors.RED; + return LightColors.RED; } }; panel.setText(message); @@ -83,21 +85,15 @@ public class JsonSchemaConflictNotificationProvider extends EditorNotifications. } private static class Worker { - private boolean myIsOverridingSystemSchemaCase; - public String createMessage(@NotNull final List> descriptors) { int numOfSystemSchemas = 0; - String systemSchemaName = ""; for (Pair pair : descriptors) { if (!Boolean.TRUE.equals(pair.getFirst())) { ++ numOfSystemSchemas; - systemSchemaName = pair.getSecond(); } } - String additionalInfo = ""; if (numOfSystemSchemas == 1) { - myIsOverridingSystemSchemaCase = true; - additionalInfo = "
System schema '" + systemSchemaName + "' was not applied."; + return null; } boolean withTypes = numOfSystemSchemas > 0; final List names = new ArrayList<>(); @@ -108,7 +104,7 @@ public class JsonSchemaConflictNotificationProvider extends EditorNotifications. names.add(pair.getSecond()); } } - return "There are several JSON Schemas mapped to this file: " + StringUtil.join(names, "; ") + additionalInfo + ""; + return "There are several JSON Schemas mapped to this file: " + StringUtil.join(names, "; ") + ""; } } }