Skip to content

Fix IncorrectOperationException when editor disposed before async PsiTreeChangeListener registration#971

Merged
SeeSharpSoft merged 4 commits intomainfrom
copilot/fix-incorrect-operation-exception
Mar 29, 2026
Merged

Fix IncorrectOperationException when editor disposed before async PsiTreeChangeListener registration#971
SeeSharpSoft merged 4 commits intomainfrom
copilot/fix-incorrect-operation-exception

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 21, 2026

  • Fix race condition in CsvTableModelBase.addPsiTreeChangeListener(): guard async finishOnUiThread callback with volatile myDisposed check
  • Rebased/merged onto latest main (includes 4.2.1 section with prior fix)
  • Updated CHANGELOG.md: added the fix entry under the 4.2.1 Fixed section
Original prompt

This section details on the original issue you should resolve

<issue_title>[Automated Report] com.intellij.util.IncorrectOperationException: Sorry but parent: net.seesharpsoft.intellij.plugins.csv.editor.table.swing.CsvTableEditorSwing (class net.seesharpsoft.intellij.plugins.csv.editor.table.swing.CsvTableEditorSwing) has already been disposed (see the cause for stacktrace) so the child: com.intellij.psi.impl.PsiManagerImpl$$Lambda/0x0000025cc656f750 (class com.intellij.psi.impl.PsiManagerImpl$$Lambda/0x0000025cc656f750) will never be disposed</issue_title>
<issue_description>Message

Stacktrace

com.intellij.util.IncorrectOperationException: Sorry but parent: net.seesharpsoft.intellij.plugins.csv.editor.table.swing.CsvTableEditorSwing@fb2cfbd (class net.seesharpsoft.intellij.plugins.csv.editor.table.swing.CsvTableEditorSwing) has already been disposed (see the cause for stacktrace) so the child: com.intellij.psi.impl.PsiManagerImpl$$Lambda/0x0000025cc656f750@11a671c9 (class com.intellij.psi.impl.PsiManagerImpl$$Lambda/0x0000025cc656f750) will never be disposed
at com.intellij.openapi.util.ObjectTree.register(ObjectTree.java:43)
at com.intellij.openapi.util.Disposer.register(Disposer.java:162)
at com.intellij.psi.impl.PsiManagerImpl.addPsiTreeChangeListener(PsiManagerImpl.java:236)
at net.seesharpsoft.intellij.plugins.csv.editor.table.CsvTableModelBase.lambda$addPsiTreeChangeListener$1(CsvTableModelBase.java:61)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$safeTransferToEdt$9(NonBlockingReadActionImpl.java:801)
at com.intellij.concurrency.ThreadContext.installThreadContext(threadContext.kt:305)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$safeTransferToEdt$10(NonBlockingReadActionImpl.java:800)
at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:204)
at com.intellij.openapi.application.impl.AppImplKt$runnableUnitFunction$1.invoke(appImpl.kt:124)
at com.intellij.openapi.application.impl.AppImplKt$runnableUnitFunction$1.invoke(appImpl.kt:124)
at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.doRunWriteIntentReadAction(NestedLocksThreadingSupport.kt:736)
at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.runPreventiveWriteIntentReadAction(NestedLocksThreadingSupport.kt:710)
at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.runWriteIntentReadAction(NestedLocksThreadingSupport.kt:664)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:1048)
at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:582)
at com.intellij.openapi.application.impl.NonBlockingFlushQueue.runNextEvent$lambda$1$1$0(NonBlockingFlushQueue.kt:334)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:901)
at com.intellij.openapi.application.impl.NonBlockingFlushQueue.runNextEvent$lambda$1$1(NonBlockingFlushQueue.kt:333)
at com.intellij.concurrency.ThreadContext.resetThreadContext(threadContext.kt:294)
at com.intellij.openapi.application.impl.NonBlockingFlushQueue.runNextEvent$lambda$1(NonBlockingFlushQueue.kt:330)
at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.tryRunWriteIntentReadAction(NestedLocksThreadingSupport.kt:689)
at com.intellij.openapi.application.impl.NonBlockingFlushQueue.runNextEvent(NonBlockingFlushQueue.kt:326)
at com.intellij.openapi.application.impl.NonBlockingFlushQueue.flushNow(NonBlockingFlushQueue.kt:305)
at com.intellij.openapi.application.impl.NonBlockingFlushQueue.FLUSH_NOW$lambda$0(NonBlockingFlushQueue.kt:167)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:664)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:517)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$0$0$0(IdeEventQueue.kt:333)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1065)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:109)
at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1065)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$0(IdeEventQueue.kt:331)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:371)
a...


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

…eChangeListener registration

Co-authored-by: SeeSharpSoft <3205800+SeeSharpSoft@users.noreply.github.com>
Agent-Logs-Url: https://github.com/SeeSharpSoft/intellij-csv-validator/sessions/0c0b9df9-c4a1-4307-ab7f-554c71abc7d3
Copilot AI changed the title [WIP] Fix IncorrectOperationException in CsvTableEditorSwing Fix IncorrectOperationException when editor disposed before async PsiTreeChangeListener registration Mar 21, 2026
Copilot AI requested a review from SeeSharpSoft March 21, 2026 13:30
Copy link
Copy Markdown
Owner

@SeeSharpSoft SeeSharpSoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase on latest main. Update CHANGELOG.MD and add the fix to under the Fixed section of version 4.2.1

Copilot AI and others added 2 commits March 29, 2026 22:01
Co-authored-by: SeeSharpSoft <3205800+SeeSharpSoft@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 29, 2026

Rebase on latest main. Update CHANGELOG.MD and add the fix to under the Fixed section of version 4.2.1

Done in 96c8a54. Merged latest main (which introduced the 4.2.1 section) and added the fix entry to the 4.2.1 Fixed section in CHANGELOG.md.

@SeeSharpSoft SeeSharpSoft marked this pull request as ready for review March 29, 2026 22:09
@SeeSharpSoft SeeSharpSoft merged commit 13c3345 into main Mar 29, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment