Skip to content

Commit

Permalink
Fixed EDT access error in commit dialogue (#626).
Browse files Browse the repository at this point in the history
  • Loading branch information
jshiell committed Dec 16, 2023
1 parent 61b68c3 commit b3f8ebc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 22 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

# CheckStyle-IDEA Changelog

* **5.85.1** Fixed: EDT access error in commit dialogue (#626).
* **5.85.0** New: Added Checkstyle 10.12.5.
* **5.84.0** New: Added Checkstyle 10.12.4.
* **5.83.0** New: Add ability to add bundled rules via the `BundledConfigProvider` interface (#622) - thanks to @rhierlmeier.
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repositories {
// Project Metadata
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

version = '5.85.0'
version = '5.85.1'

intellij {
version = 'IC-2022.1.4'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.infernus.idea.checkstyle.handlers;

import com.intellij.CommonBundle;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.progress.ProgressIndicator;
Expand All @@ -11,6 +12,7 @@
import com.intellij.openapi.vcs.changes.CommitExecutor;
import com.intellij.openapi.vcs.checkin.CheckinHandler;
import com.intellij.openapi.vcs.ui.RefreshableOnComponent;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiFile;
import com.intellij.util.PairConsumer;
import com.intellij.util.ui.UIUtil;
Expand All @@ -27,6 +29,7 @@
import java.awt.*;
import java.util.List;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;

import static com.intellij.openapi.vcs.checkin.CheckinHandler.ReturnResult.*;
import static java.util.Optional.ofNullable;
Expand Down Expand Up @@ -85,7 +88,8 @@ public ReturnResult beforeCheckin(@Nullable final CommitExecutor executor,
public void run(@NotNull final ProgressIndicator progressIndicator) {
progressIndicator.setText(message("handler.before.checkin.scan.in-progress"));
progressIndicator.setIndeterminate(true);
scanResults.putAll(staticScanner.scanFiles(new ArrayList<>(checkinPanel.getVirtualFiles())));
scanResults.putAll(staticScanner.scanFiles(
new ArrayList<>(getVirtualFiles())));
}
}.queue();

Expand All @@ -100,6 +104,12 @@ public void run(@NotNull final ProgressIndicator progressIndicator) {
}
}

private Collection<VirtualFile> getVirtualFiles() {
AtomicReference<Collection<VirtualFile>> files = new AtomicReference<>();
ApplicationManager.getApplication().invokeAndWait(() -> files.set(checkinPanel.getVirtualFiles()));
return files.get();
}

private Optional<PluginConfigurationManager> settings() {
final Project project = checkinPanel.getProject();
return ofNullable(configurationManager(project));
Expand Down
21 changes: 1 addition & 20 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<change-notes>
<![CDATA[
<ul>
<li>5.85.1: Fixed: EDT access error in commit dialogue (#626).</li>
<li>5.85.0: New: Added Checkstyle 10.12.5.</li>
<li>5.84.0: New: Added Checkstyle 10.12.4.</li>
<li>5.83.0: New: New: Add ability to add bundled rules via the `BundledConfigProvider` interface (#622) - thanks to @rhierlmeier.</li>
Expand All @@ -40,26 +41,6 @@
<li>5.77.0: New: Now built against IDEA 2022.1.4 (was 2021.3.3).</li>
<li>5.77.0: New: Added Checkstyle 10.8.1.</li>
<li>5.76.0: New: Added Checkstyle 10.7.0.</li>
<li>5.75.0: Fixed: Set target component on toolbars (#602).</li>
<li>5.75.0: New: Added Checkstyle 10.6.0.</li>
<li>5.74.1: Fixed: Ensure scope is checked as read action (#595).</li>
<li>5.74.0: New: Added Checkstyle 10.5.0 - thanks to @kennysoft (#596).</li>
<li>5.73.0: New: Added Checkstyle 10.4.</li>
<li>5.72.0: Now built against IDEA 2021.3.3 (was 2021.1.3).</li>
<li>5.71.1: Fixed: commons-logging.properties is now ignored on the project classfile (#555).</li>
<li>5.71.1: New: Checkin dialogue now shows the number of errors and warnings found (#591).</li>
<li>5.71.0: New: Added Checkstyle 10.3.4.</li>
<li>5.70.0: New: Added Checkstyle 10.3.2.</li>
<li>5.69.1: Fix: handle URIs without userinfo (#583, #581).</li>
<li>5.69.0: New: Ensure passwords are hidden when display URIs (#581) - thanks to @austek.</li>
<li>5.68.0: New: Added Checkstyle 10.3.1.</li>
<li>5.68.0: Fix: User info requiring escaping in rules file URIs is now handled correctly (#535) - thanks to @austek.</li>
<li>5.67.4: Fix: Process exceptions from IDEA are now correctly rethrown during config deserialisation (#578).</li>
<li>5.67.3: Fix: Bundled configurations now have constant IDs when recreated or ported from earlier versions (#569).</li>
<li>5.67.3: Fix: Bundled configurations are restored if absent.</li>
<li>5.67.2: Fix: NPE in active modules configurations (#576).</li>
<li>5.67.1: Fix: Improve serialisation from legacy formats (#574).</li>
<li>5.67.1: Fix: Fix serialisation of property values (#573).</li>
<li><em>For older changes please see the changelog.</em></li>
</ul>
]]>
Expand Down

0 comments on commit b3f8ebc

Please sign in to comment.