Skip to content

Commit d705a95

Browse files
authored
Merge pull request #532 from SeeSharpSoft/main
Release 3.2.2
2 parents 389be04 + 3345b03 commit d705a95

File tree

8 files changed

+45
-7
lines changed

8 files changed

+45
-7
lines changed

.github/workflows/PublishStable.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
gkVersion: 2021.1.2
2323
- ideaVersion: 2023.1.1
2424
gkVersion: 2021.1.2
25+
- ideaVersion: 2023.2.1
26+
gkVersion: 2021.1.2
2527
- ideaVersion: LATEST-EAP-SNAPSHOT
2628
gkVersion: 2021.1.2
2729

CHANGELOG

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
3.2.2
2+
Oct 14, 2023
3+
4+
FIX: NullPointerException: Cannot invoke "getSelectedColumn()" because "tblEditor" is null #519
5+
FIX: IllegalStateException: Attempt to modify PSI for non-committed Document! #516
6+
FIX: StringIndexOutOfBoundsException: begin 0, end -1, length 5995 #511
7+
FIX: ArrayIndexOutOfBoundsException: 12 >= 12 #482
8+
19
3.2.1
210
Jul 08, 2023
311

build.gradle

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ idea {
6767
}
6868

6969
var final EAP_VERSION = 'LATEST-EAP-SNAPSHOT'
70-
var final EAP_BUILD = '232'
70+
var final EAP_BUILD = '233'
7171

7272
var final DEFAULT_VERSION = '2022.2.1' //'LATEST-EAP-SNAPSHOT' //
7373

7474
// IDE version - https://www.jetbrains.com/intellij-repository/releases
7575
var idea_version = System.getenv().getOrDefault('IDEA_VERSION', DEFAULT_VERSION)
7676
var build_version = idea_version == EAP_VERSION ? EAP_BUILD : idea_version.substring(2, 4) + idea_version.charAt(5) // extract e.g. '221' from '2022.1.1'
7777

78-
version '3.2.1-' + build_version
78+
version '3.2.2-' + build_version
7979

8080
apply plugin: 'org.jetbrains.intellij'
8181
intellij {
@@ -96,8 +96,10 @@ patchPluginXml {
9696
sinceBuild = build_version
9797

9898
changeNotes = """<pre style="font-family: sans-serif">
99-
NEW: add support for upcoming IntelliJ version 2023.2.*
100-
FIX: broken tests
99+
FIX: NullPointerException: Cannot invoke "getSelectedColumn()" because "tblEditor" is null #519
100+
FIX: IllegalStateException: Attempt to modify PSI for non-committed Document! #516
101+
FIX: StringIndexOutOfBoundsException: begin 0, end -1, length 5995 #511
102+
FIX: ArrayIndexOutOfBoundsException: 12 >= 12 #482
101103
</pre>"""
102104
}
103105
publishPlugin {

src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvGithubIssueSubmitter.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
public class CsvGithubIssueSubmitter extends ErrorReportSubmitter {
3030

31+
private static final int FALLBACK_ISSUE_TITLE_LENGTH = 600;
32+
3133
public static final String GIT_USER = "SeeSharpSoft";
3234
public static final String GIT_REPO = "intellij-csv-validator";
3335
public static final GHRepositoryPath GITHUB_FULL_PATH = new GHRepositoryPath(GIT_USER, GIT_REPO);
@@ -132,7 +134,7 @@ protected GithubApiRequest createNewIssue(String title, String content) throws I
132134
}
133135

134136
protected String searchExistingIssues(GithubApiRequestExecutor githubExecutor, String title, ProgressIndicator progressIndicator) throws IOException {
135-
String needle = title.replaceAll("\\s*\\[.*?]\\s*", "");
137+
String needle = title.replaceAll("\\s*(\\[.*?]|\\(.*?\\)|\\{.*?})\\s*", "");
136138
if (needle.length() > 255) {
137139
needle = needle.substring(0, needle.substring(0, 255).lastIndexOf(" "));
138140
}
@@ -158,9 +160,18 @@ protected String searchExistingIssues(GithubApiRequestExecutor githubExecutor, S
158160
return null;
159161
}
160162

163+
protected int getIssueTitleCutIndex(String throwableTextArg) {
164+
String throwableText = throwableTextArg.replaceAll("\r", "\n");
165+
int index = throwableText.indexOf("\n");
166+
if (index == -1) {
167+
index = throwableText.indexOf(" ", FALLBACK_ISSUE_TITLE_LENGTH);
168+
}
169+
return index == -1 ? Math.min(throwableText.length(), FALLBACK_ISSUE_TITLE_LENGTH) : index;
170+
}
171+
161172
protected String getIssueTitle(IdeaLoggingEvent event) {
162173
String throwableText = event.getThrowableText();
163-
int index = Math.min(throwableText.indexOf("\r"), throwableText.indexOf("\n"));
174+
int index = getIssueTitleCutIndex(throwableText);
164175
return "[Automated Report] " + event.getThrowableText().substring(0, index);
165176
}
166177

src/main/java/net/seesharpsoft/intellij/plugins/csv/editor/table/swing/CsvTable.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ public boolean isCommentRow(int row) {
4848
return getModel().isCommentRow(convertRowIndexToModel(row));
4949
}
5050

51+
@Override
52+
public int getSelectedColumn() {
53+
int selectedColumn = super.getSelectedColumn();
54+
return Math.min(selectedColumn, getColumnCount() - 1);
55+
}
56+
5157
@Override
5258
public Rectangle getCellRect(int row, int column, boolean includeSpacing) {
5359
Rectangle rect = super.getCellRect(row, column, includeSpacing);

src/main/java/net/seesharpsoft/intellij/plugins/csv/editor/table/swing/CsvTableEditorSwing.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,17 @@ protected boolean isInCellEditMode() {
156156

157157
@Override
158158
public void beforeTableModelUpdate() {
159+
if (tblEditor == null) return;
160+
159161
mySelectedColumn = tblEditor.getSelectedColumn();
160162
mySelectedRow = tblEditor.getSelectedRow();
161163
myIsInCellEditMode = tblEditor.isEditing();
162164
}
163165

164166
@Override
165167
public void afterTableModelUpdate() {
168+
if (tblEditor == null) return;
169+
166170
removeTableChangeListener();
167171
try {
168172
this.tblEditor.tableChanged(new TableModelEvent(tblEditor.getModel(), TableModelEvent.ALL_COLUMNS));

src/main/java/net/seesharpsoft/intellij/plugins/csv/psi/CsvPsiTreeUpdater.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ private boolean doCommit(@NotNull Runnable runnable) {
350350
PsiFile psiFile = getPsiFile();
351351
Document document = getDocument();
352352

353-
if (psiFile == null || !psiFile.isWritable() || document == null || !document.isWritable())
353+
if (psiFile == null || !psiFile.isWritable() || document == null || !document.isWritable() || document.isInBulkUpdate())
354354
{
355355
return false;
356356
}

src/main/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettingsProvider.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.intellij.openapi.options.ConfigurationException;
66
import com.intellij.openapi.project.ProjectManager;
77
import com.intellij.openapi.ui.ComboBox;
8+
import com.intellij.openapi.util.text.StringUtil;
89
import com.intellij.ui.CheckBoxWithColorChooser;
910
import com.intellij.util.FileContentUtilCore;
1011
import net.seesharpsoft.intellij.plugins.csv.CsvEscapeCharacter;
@@ -74,6 +75,10 @@ public boolean isModified(@NotNull JToggleButton toggleButton, boolean value) {
7475
return toggleButton.isSelected() != value;
7576
}
7677

78+
public boolean isModified(@NotNull JTextField textField, @NotNull String value) {
79+
return !StringUtil.equals(textField.getText().trim(), value);
80+
}
81+
7782
@Override
7883
public boolean isModified() {
7984
CsvEditorSettings csvEditorSettings = CsvEditorSettings.getInstance();

0 commit comments

Comments
 (0)