From 3a3e0fd2f371438e6f3fabdbcba9ffeb5e345a35 Mon Sep 17 00:00:00 2001 From: "Dmitry.Krasilschikov" Date: Tue, 22 Jan 2019 15:08:14 +0200 Subject: [PATCH] allow to save only valid int value that fit bounds --- .../src/com/intellij/openapi/options/Configurable.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/platform-api/src/com/intellij/openapi/options/Configurable.java b/platform/platform-api/src/com/intellij/openapi/options/Configurable.java index 5b9b9bf1f427..40809a005972 100644 --- a/platform/platform-api/src/com/intellij/openapi/options/Configurable.java +++ b/platform/platform-api/src/com/intellij/openapi/options/Configurable.java @@ -194,7 +194,8 @@ public interface Configurable extends UnnamedConfigurable { default boolean isModified(@NotNull JTextField textField, int value, @NotNull UINumericRange range) { try { - return range.fit(Integer.parseInt(textField.getText().trim())) != value; + int currentValue = Integer.parseInt(textField.getText().trim()); + return range.fit(currentValue) == currentValue && currentValue != value; } catch (NumberFormatException e) { return false;