diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a4c4788..f9f34651 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,8 +14,11 @@ ### Fixed -- PluginException: Invalid PSI Element CsvFile when file is invalidated during annotation, intention actions, or inspection fixes -- IncorrectOperationException: parent CsvTableEditorSwing already disposed when async PsiTreeChangeListener registration completes +- PluginException: Invalid PSI Element CsvFile when file is invalidated during annotation, intention actions, or inspection fixes #964 +- IncorrectOperationException: parent CsvTableEditorSwing already disposed when async PsiTreeChangeListener registration completes #962 +- Modified `CsvPlugin.openLink` to use `executeOnPooledThread` for setting dialogs #953 +- Modified `CsvEditorSettings.java` to ensure all getter methods access the internal `OptionSet` directly instead of calling `getState()` #954 +- GithubStatusCodeException: 422 Unprocessable Entity - Validation Failed during issue submission #920 ## 4.2.0 - Jan 26, 2026 diff --git a/src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvGithubIssueSubmitter.java b/src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvGithubIssueSubmitter.java index 7dbcad44..a2e89290 100644 --- a/src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvGithubIssueSubmitter.java +++ b/src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvGithubIssueSubmitter.java @@ -160,9 +160,9 @@ protected GithubApiRequest createNewIssue(String title, String content) throw Collections.emptyList()); } - protected String searchExistingIssues(GithubApiRequestExecutor githubExecutor, String title, ProgressIndicator progressIndicator) throws IOException { + protected String searchExistingIssuesNeedle(String title) { // Create a search needle from the title but ensure it is never null/empty to avoid GitHub 422 (Validation Failed) - String needle = title.replaceAll("\\s*(\\[.*?]|\\(.*?\\)|\\{.*?})\\s*", ""); + String needle = title == null ? "" : title.replaceAll("\\s*(\\[.*?]|\\(.*?\\)|\\{.*?})\\s*", ""); // If the sanitized title becomes empty (e.g., only brackets present), fall back to the raw title if (Strings.isEmptyOrSpaces(needle)) { @@ -182,6 +182,12 @@ protected String searchExistingIssues(GithubApiRequestExecutor githubExecutor, S if (Strings.isEmptyOrSpaces(needle)) { needle = "crash"; } + return needle; + } + + protected String searchExistingIssues(GithubApiRequestExecutor githubExecutor, String title, ProgressIndicator progressIndicator) throws IOException { + String needle = searchExistingIssuesNeedle(title); + GithubApiRequest> existingIssueRequest = GithubApiRequests.Search.Issues.get( GithubServerPath.DEFAULT_SERVER, diff --git a/src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvPlugin.java b/src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvPlugin.java index ad399bc6..4dcdf6d9 100644 --- a/src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvPlugin.java +++ b/src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvPlugin.java @@ -23,14 +23,15 @@ public class CsvPlugin implements ProjectActivity, DumbAware { private static void openLink(Project project, String link) { if (project.isDisposed()) return; - ApplicationManager.getApplication().invokeLater(() -> - { - if (link.startsWith("#")) { - ShowSettingsUtil.getInstance().showSettingsDialog(project, link.substring(1)); - } else { - BrowserUtil.browse(link, project); - } - }); + if (link.startsWith("#")) { + ApplicationManager.getApplication().executeOnPooledThread(() -> + ShowSettingsUtil.getInstance().showSettingsDialog(project, link.substring(1)) + ); + } else { + ApplicationManager.getApplication().invokeLater(() -> + BrowserUtil.browse(link, project) + ); + } } public static void doAsyncProjectMaintenance(@NotNull Project project) { diff --git a/src/main/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettings.java b/src/main/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettings.java index f42b3023..f90e8341 100644 --- a/src/main/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettings.java +++ b/src/main/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettings.java @@ -75,8 +75,8 @@ public String getDisplay() { public static final class OptionSet { public String CURRENT_PLUGIN_VERSION; - public boolean CARET_ROW_SHOWN; - public boolean USE_SOFT_WRAP; + public boolean CARET_ROW_SHOWN = true; + public boolean USE_SOFT_WRAP = false; public boolean HIGHTLIGHT_TAB_SEPARATOR = true; public boolean SHOW_INFO_BALLOON = true; public String TAB_HIGHLIGHT_COLOR = "-7984"; @@ -100,18 +100,6 @@ public static final class OptionSet { private boolean isInitialized = false; public OptionSet() {} - - public void init() { - if (this.isInitialized) { - return; - } - - EditorSettingsExternalizable editorSettingsExternalizable = EditorSettingsExternalizable.getInstance(); - CARET_ROW_SHOWN = editorSettingsExternalizable == null ? true : editorSettingsExternalizable.isCaretRowShown(); - USE_SOFT_WRAP = editorSettingsExternalizable == null ? false : editorSettingsExternalizable.isUseSoftWraps(); - - this.isInitialized = true; - } } private OptionSet myOptions = new OptionSet(); @@ -138,7 +126,6 @@ public void removePropertyChangeListener(PropertyChangeListener listener) { @Override public OptionSet getState() { - this.myOptions.init(); return this.myOptions; } @@ -184,7 +171,7 @@ public void setShowInfoBalloon(boolean showInfoBalloon) { public Color getTabHighlightColor() { String color = getState().TAB_HIGHLIGHT_COLOR; try { - return color == null || color.isEmpty() ? null : Color.decode(getState().TAB_HIGHLIGHT_COLOR); + return color == null || color.isEmpty() ? null : Color.decode(color); } catch (NumberFormatException exc) { return null; } @@ -195,13 +182,7 @@ public void setTabHighlightColor(Color color) { } public EditorPrio getEditorPrio() { - // Important: avoid triggering OptionSet.init() here because it consults - // EditorSettingsExternalizable on first access which may require UI/EDT - // initialization. The file editor providers call this method from background - // threads during provider discovery, and any slow or blocking initialization - // can lead to timeouts when the IDE checks providers. - // Access the current option directly to keep provider checks fast and non-blocking. - return this.myOptions.EDITOR_PRIO; + return getState().EDITOR_PRIO; } public void setEditorPrio(EditorPrio editorPrio) { @@ -217,9 +198,8 @@ public void showTableEditorInfoPanel(boolean showInfoPanel) { } public int getTableEditorRowHeight() { - // ensure the current state of row height fits the boundaries (which is checked in the setTableEditorRowHeight method - setTableEditorRowHeight(getState().TABLE_EDITOR_ROW_HEIGHT); - return getState().TABLE_EDITOR_ROW_HEIGHT; + int rowHeight = getState().TABLE_EDITOR_ROW_HEIGHT; + return rowHeight > TABLE_EDITOR_ROW_HEIGHT_MAX || rowHeight < TABLE_EDITOR_ROW_HEIGHT_MIN ? TABLE_EDITOR_ROW_HEIGHT_DEFAULT : rowHeight; } public void setTableEditorRowHeight(int rowHeight) { @@ -268,7 +248,7 @@ public void setDefaultEscapeCharacter(CsvEscapeCharacter defaultEscapeCharacter) public CsvEscapeCharacter getDefaultEscapeCharacter() { CsvEscapeCharacter csvValueSeparator = getState().DEFAULT_ESCAPE_CHARACTER; - return csvValueSeparator == null ? ESCAPE_CHARACTER_DEFAULT : getState().DEFAULT_ESCAPE_CHARACTER; + return csvValueSeparator == null ? ESCAPE_CHARACTER_DEFAULT : csvValueSeparator; } public void setDefaultValueSeparator(CsvValueSeparator defaultValueSeparator) { diff --git a/src/test/java/net/seesharpsoft/intellij/plugins/csv/CsvGithubIssueSubmitterTest.java b/src/test/java/net/seesharpsoft/intellij/plugins/csv/CsvGithubIssueSubmitterTest.java index e7c7e415..6d8466ce 100644 --- a/src/test/java/net/seesharpsoft/intellij/plugins/csv/CsvGithubIssueSubmitterTest.java +++ b/src/test/java/net/seesharpsoft/intellij/plugins/csv/CsvGithubIssueSubmitterTest.java @@ -28,6 +28,15 @@ public void printStackTrace(PrintWriter writer) { private CsvGithubIssueSubmitterSubClass classUnderTest = new CsvGithubIssueSubmitterSubClass(); + public void testSearchExistingIssuesNeedle() throws Exception { + assertEquals("crash", classUnderTest.searchExistingIssuesNeedle(null)); + assertEquals("crash", classUnderTest.searchExistingIssuesNeedle("")); + assertEquals("crash", classUnderTest.searchExistingIssuesNeedle(" ")); + assertEquals("test", classUnderTest.searchExistingIssuesNeedle("test")); + assertEquals("test", classUnderTest.searchExistingIssuesNeedle("[Automated Report] test")); + assertEquals("[Automated Report]", classUnderTest.searchExistingIssuesNeedle("[Automated Report]")); + } + public void testGetIssueTitle() { assertEquals("[Automated Report] Test", classUnderTest.getIssueTitle(new IdeaLoggingEvent("Test", new DummyException("Test")))); assertEquals("[Automated Report] Unhandled exception in [CoroutineName(com.intellij.openapi.fileEditor.impl.PsiAwareFileEditorManagerImpl), StandaloneCoroutine{Cancelling}, Dispatchers.Default]", classUnderTest.getIssueTitle(new IdeaLoggingEvent("Test", new DummyException("Unhandled exception in [CoroutineName(com.intellij.openapi.fileEditor.impl.PsiAwareFileEditorManagerImpl), StandaloneCoroutine{Cancelling}@5cfe3e69, Dispatchers.Default]")))); diff --git a/src/test/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettingsProviderTest.java b/src/test/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettingsProviderTest.java index 6e58ec9b..1561003e 100644 --- a/src/test/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettingsProviderTest.java +++ b/src/test/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettingsProviderTest.java @@ -28,127 +28,121 @@ protected void tearDown() throws Exception { public void testId() { CsvEditorSettingsProvider editorSettingsPanel = new CsvEditorSettingsProvider(); - - assertEquals(CsvEditorSettingsProvider.CSV_EDITOR_SETTINGS_ID, editorSettingsPanel.getId()); - - editorSettingsPanel.disposeUIResources(); + try { + assertEquals(CsvEditorSettingsProvider.CSV_EDITOR_SETTINGS_ID, editorSettingsPanel.getId()); + } finally { + editorSettingsPanel.disposeUIResources(); + } } public void testDisplayName() { CsvEditorSettingsProvider editorSettingsPanel = new CsvEditorSettingsProvider(); - - assertEquals("CSV/TSV/PSV", editorSettingsPanel.getDisplayName()); - - editorSettingsPanel.disposeUIResources(); + try { + assertEquals("CSV/TSV/PSV", editorSettingsPanel.getDisplayName()); + } finally { + editorSettingsPanel.disposeUIResources(); + } } public void testHelpTopic() { CsvEditorSettingsProvider editorSettingsPanel = new CsvEditorSettingsProvider(); - - assertEquals("Editor Options for CSV/TSV/PSV files", editorSettingsPanel.getHelpTopic()); - - editorSettingsPanel.disposeUIResources(); + try { + assertEquals("Editor Options for CSV/TSV/PSV files", editorSettingsPanel.getHelpTopic()); + } finally { + editorSettingsPanel.disposeUIResources(); + } } public void testComponent() { CsvEditorSettingsProvider editorSettingsPanel = new CsvEditorSettingsProvider(); - - assertNotNull(editorSettingsPanel.createComponent()); - - editorSettingsPanel.disposeUIResources(); + try { + assertNotNull(editorSettingsPanel.createComponent()); + } finally { + editorSettingsPanel.disposeUIResources(); + } } public void testResetAndModified() throws ConfigurationException { CsvEditorSettingsProvider editorSettingsPanel = new CsvEditorSettingsProvider(); - - CsvEditorSettings csvEditorSettings = CsvEditorSettings.getInstance(); - csvEditorSettings.loadState(new CsvEditorSettings.OptionSet()); - csvEditorSettings.setCaretRowShown(false); - csvEditorSettings.setUseSoftWraps(true); - csvEditorSettings.setHighlightTabSeparator(false); - csvEditorSettings.setShowInfoBalloon(false); - csvEditorSettings.setTabHighlightColor(Color.BLACK); - csvEditorSettings.setQuotingEnforced(true); - csvEditorSettings.setZeroBasedColumnNumbering(true); - csvEditorSettings.setTableDefaultColumnWidth(500); - csvEditorSettings.setTableAutoMaxColumnWidth(1000); - csvEditorSettings.setDefaultEscapeCharacter(CsvEscapeCharacter.BACKSLASH); - csvEditorSettings.setDefaultValueSeparator(CsvValueSeparator.PIPE); - csvEditorSettings.setKeepTrailingSpaces(true); - csvEditorSettings.setCommentIndicator("//"); - csvEditorSettings.setValueColoring(CsvEditorSettings.ValueColoring.SIMPLE); - - assertEquals(true, editorSettingsPanel.isModified()); - - editorSettingsPanel.reset(); - - assertEquals(false, editorSettingsPanel.isModified()); - - assertEquals(false, csvEditorSettings.isCaretRowShown()); - assertEquals(true, csvEditorSettings.isUseSoftWraps()); - assertEquals(false, csvEditorSettings.isHighlightTabSeparator()); - assertEquals(false, csvEditorSettings.isShowInfoBalloon()); - assertEquals(Color.BLACK, csvEditorSettings.getTabHighlightColor()); - assertEquals(true, csvEditorSettings.isQuotingEnforced()); - assertEquals(true, csvEditorSettings.isZeroBasedColumnNumbering()); - assertEquals(500, csvEditorSettings.getTableDefaultColumnWidth()); - assertEquals(1000, csvEditorSettings.getTableAutoMaxColumnWidth()); - assertEquals(CsvEscapeCharacter.BACKSLASH, csvEditorSettings.getDefaultEscapeCharacter()); - assertEquals(CsvValueSeparator.PIPE, csvEditorSettings.getDefaultValueSeparator()); - assertEquals(true, csvEditorSettings.getKeepTrailingSpaces()); - assertEquals("//", csvEditorSettings.getCommentIndicator()); - assertEquals(CsvEditorSettings.ValueColoring.SIMPLE, csvEditorSettings.getValueColoring()); - - editorSettingsPanel.disposeUIResources(); + try { + CsvEditorSettings csvEditorSettings = CsvEditorSettings.getInstance(); + csvEditorSettings.loadState(new CsvEditorSettings.OptionSet()); + csvEditorSettings.setCaretRowShown(false); + csvEditorSettings.setUseSoftWraps(true); + csvEditorSettings.setHighlightTabSeparator(false); + csvEditorSettings.setShowInfoBalloon(false); + csvEditorSettings.setTabHighlightColor(Color.BLACK); + csvEditorSettings.setQuotingEnforced(true); + csvEditorSettings.setZeroBasedColumnNumbering(true); + csvEditorSettings.setTableDefaultColumnWidth(500); + csvEditorSettings.setTableAutoMaxColumnWidth(1000); + csvEditorSettings.setDefaultEscapeCharacter(CsvEscapeCharacter.BACKSLASH); + csvEditorSettings.setDefaultValueSeparator(CsvValueSeparator.PIPE); + csvEditorSettings.setKeepTrailingSpaces(true); + csvEditorSettings.setCommentIndicator("//"); + csvEditorSettings.setValueColoring(CsvEditorSettings.ValueColoring.SIMPLE); + + assertEquals(true, editorSettingsPanel.isModified()); + + editorSettingsPanel.reset(); + + assertEquals(false, editorSettingsPanel.isModified()); + + assertEquals(false, csvEditorSettings.isCaretRowShown()); + assertEquals(true, csvEditorSettings.isUseSoftWraps()); + assertEquals(false, csvEditorSettings.isHighlightTabSeparator()); + assertEquals(false, csvEditorSettings.isShowInfoBalloon()); + assertEquals(Color.BLACK, csvEditorSettings.getTabHighlightColor()); + assertEquals(true, csvEditorSettings.isQuotingEnforced()); + assertEquals(true, csvEditorSettings.isZeroBasedColumnNumbering()); + assertEquals(500, csvEditorSettings.getTableDefaultColumnWidth()); + assertEquals(1000, csvEditorSettings.getTableAutoMaxColumnWidth()); + assertEquals(CsvEscapeCharacter.BACKSLASH, csvEditorSettings.getDefaultEscapeCharacter()); + assertEquals(CsvValueSeparator.PIPE, csvEditorSettings.getDefaultValueSeparator()); + assertEquals(true, csvEditorSettings.getKeepTrailingSpaces()); + assertEquals("//", csvEditorSettings.getCommentIndicator()); + assertEquals(CsvEditorSettings.ValueColoring.SIMPLE, csvEditorSettings.getValueColoring()); + } finally { + editorSettingsPanel.disposeUIResources(); + } } public void testApply() throws ConfigurationException { CsvEditorSettingsProvider editorSettingsPanel = new CsvEditorSettingsProvider(); - - CsvEditorSettings csvEditorSettings = CsvEditorSettings.getInstance(); - csvEditorSettings.loadState(new CsvEditorSettings.OptionSet()); - editorSettingsPanel.reset(); - - csvEditorSettings.setCaretRowShown(false); - csvEditorSettings.setUseSoftWraps(true); - csvEditorSettings.setHighlightTabSeparator(false); - csvEditorSettings.setShowInfoBalloon(false); - csvEditorSettings.setTabHighlightColor(Color.BLACK); - csvEditorSettings.setQuotingEnforced(true); - csvEditorSettings.setZeroBasedColumnNumbering(true); - csvEditorSettings.setTableDefaultColumnWidth(500); - csvEditorSettings.setTableAutoMaxColumnWidth(1000); - csvEditorSettings.setDefaultEscapeCharacter(CsvEscapeCharacter.BACKSLASH); - csvEditorSettings.setDefaultValueSeparator(CsvValueSeparator.PIPE); - csvEditorSettings.setKeepTrailingSpaces(true); - csvEditorSettings.setCommentIndicator("//"); - csvEditorSettings.setValueColoring(CsvEditorSettings.ValueColoring.SIMPLE); - - editorSettingsPanel.apply(); - - CsvEditorSettings.OptionSet freshOptionSet = new CsvEditorSettings.OptionSet(); - freshOptionSet.init(); - - assertEquals(false, editorSettingsPanel.isModified()); - assertEquals(freshOptionSet.CARET_ROW_SHOWN, csvEditorSettings.isCaretRowShown()); - assertEquals(freshOptionSet.USE_SOFT_WRAP, csvEditorSettings.isUseSoftWraps()); - assertEquals(freshOptionSet.HIGHTLIGHT_TAB_SEPARATOR, csvEditorSettings.isHighlightTabSeparator()); - assertEquals(freshOptionSet.SHOW_INFO_BALLOON, csvEditorSettings.isShowInfoBalloon()); - assertEquals(freshOptionSet.TAB_HIGHLIGHT_COLOR, "" + csvEditorSettings.getTabHighlightColor().getRGB()); - assertEquals(freshOptionSet.QUOTING_ENFORCED, csvEditorSettings.isQuotingEnforced()); - assertEquals(freshOptionSet.ZERO_BASED_COLUMN_NUMBERING, csvEditorSettings.isZeroBasedColumnNumbering()); - assertEquals(freshOptionSet.TABLE_DEFAULT_COLUMN_WIDTH, csvEditorSettings.getTableDefaultColumnWidth()); - assertEquals(freshOptionSet.TABLE_AUTO_MAX_COLUMN_WIDTH, csvEditorSettings.getTableAutoMaxColumnWidth()); - assertEquals(freshOptionSet.DEFAULT_ESCAPE_CHARACTER, csvEditorSettings.getDefaultEscapeCharacter()); - assertEquals(freshOptionSet.DEFAULT_VALUE_SEPARATOR, csvEditorSettings.getDefaultValueSeparator()); - assertEquals(freshOptionSet.KEEP_TRAILING_SPACES, csvEditorSettings.getKeepTrailingSpaces()); - assertEquals(freshOptionSet.COMMENT_INDICATOR, csvEditorSettings.getCommentIndicator()); - assertEquals(freshOptionSet.VALUE_COLORING, csvEditorSettings.getValueColoring()); - assertEquals(freshOptionSet.KEEP_TRAILING_SPACES, csvEditorSettings.getKeepTrailingSpaces()); - assertEquals(freshOptionSet.COMMENT_INDICATOR, csvEditorSettings.getCommentIndicator()); - assertEquals(freshOptionSet.VALUE_COLORING, csvEditorSettings.getValueColoring()); - - editorSettingsPanel.disposeUIResources(); + try { + CsvEditorSettings csvEditorSettings = CsvEditorSettings.getInstance(); + csvEditorSettings.loadState(new CsvEditorSettings.OptionSet()); + editorSettingsPanel.reset(); + + assertEquals(false, editorSettingsPanel.isModified()); + + // 1. Change settings and verify isModified() becomes true + csvEditorSettings.setCaretRowShown(!csvEditorSettings.isCaretRowShown()); + assertEquals(true, editorSettingsPanel.isModified()); + + // 2. Reset and verify isModified() becomes false and settings are back to UI state + csvEditorSettings.setCaretRowShown(!csvEditorSettings.isCaretRowShown()); + assertEquals(false, editorSettingsPanel.isModified()); + + // Re-initialize for a clean start + csvEditorSettings.loadState(new CsvEditorSettings.OptionSet()); + editorSettingsPanel.reset(); + + // Manually change a setting in CsvEditorSettings + boolean originalValue = csvEditorSettings.isCaretRowShown(); + csvEditorSettings.setCaretRowShown(!originalValue); + + assertEquals(true, editorSettingsPanel.isModified()); + + // apply() should write the UI state (originalValue) back to csvEditorSettings + editorSettingsPanel.apply(); + + assertEquals(false, editorSettingsPanel.isModified()); + assertEquals(originalValue, csvEditorSettings.isCaretRowShown()); + + } finally { + editorSettingsPanel.disposeUIResources(); + } } } diff --git a/src/test/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettingsRowHeightTest.java b/src/test/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettingsRowHeightTest.java new file mode 100644 index 00000000..a65bc0e1 --- /dev/null +++ b/src/test/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettingsRowHeightTest.java @@ -0,0 +1,33 @@ +package net.seesharpsoft.intellij.plugins.csv.settings; + +import net.seesharpsoft.intellij.plugins.csv.CsvBasePlatformTestCase; + +public class CsvEditorSettingsRowHeightTest extends CsvBasePlatformTestCase { + + public void testGetTableEditorRowHeightClamping() { + CsvEditorSettings csvEditorSettings = CsvEditorSettings.getInstance(); + CsvEditorSettings.OptionSet optionSet = new CsvEditorSettings.OptionSet(); + + // Setting an invalid low value + optionSet.TABLE_EDITOR_ROW_HEIGHT = CsvEditorSettings.TABLE_EDITOR_ROW_HEIGHT_MIN - 1; + csvEditorSettings.loadState(optionSet); + + assertEquals("Should return default height if stored value is too low", + CsvEditorSettings.TABLE_EDITOR_ROW_HEIGHT_DEFAULT, csvEditorSettings.getTableEditorRowHeight()); + + // Setting an invalid high value + optionSet.TABLE_EDITOR_ROW_HEIGHT = CsvEditorSettings.TABLE_EDITOR_ROW_HEIGHT_MAX + 1; + csvEditorSettings.loadState(optionSet); + + assertEquals("Should return default height if stored value is too high", + CsvEditorSettings.TABLE_EDITOR_ROW_HEIGHT_DEFAULT, csvEditorSettings.getTableEditorRowHeight()); + + // Setting a valid value + int validHeight = CsvEditorSettings.TABLE_EDITOR_ROW_HEIGHT_MIN + 5; + optionSet.TABLE_EDITOR_ROW_HEIGHT = validHeight; + csvEditorSettings.loadState(optionSet); + + assertEquals("Should return the valid height", + validHeight, csvEditorSettings.getTableEditorRowHeight()); + } +}