Skip to content

fix read access bug#41

Merged
cschar merged 2 commits into
mainfrom
feature/2025-fix-read-access-bug
Aug 10, 2025
Merged

fix read access bug#41
cschar merged 2 commits into
mainfrom
feature/2025-fix-read-access-bug

Conversation

@cschar
Copy link
Copy Markdown
Owner

@cschar cschar commented Aug 10, 2025

User has reported following bug:

com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Read access is allowed from inside read-action only (see Application.runReadAction()); If you access or modify model on EDT consider wrapping your code in WriteIntentReadAction ; see https://jb.gg/ij-platform-threading for details
Current thread: Thread[#82,AWT-EventQueue-0,6,main] 1648141412 (EventQueue.isDispatchThread()=true)
SystemEventQueueThread: (same)
        at com.intellij.util.concurrency.ThreadingAssertions.createThreadAccessException(ThreadingAssertions.java:257)
        at com.intellij.util.concurrency.ThreadingAssertions.throwThreadAccessException(ThreadingAssertions.java:248)
        at com.intellij.util.concurrency.ThreadingAssertions.assertReadAccess(ThreadingAssertions.java:138)
        at com.intellij.openapi.editor.impl.EditorThreading.assertInteractionAllowed(EditorThreading.kt:30)
        at com.intellij.openapi.editor.impl.CaretImpl.getOffset(CaretImpl.java:661)
        at com.intellij.openapi.editor.CaretModel.getOffset(CaretModel.java:129)
        at com.cschar.pmode3.ParticleContainerManager.getAnchors(ParticleContainerManager.java:185)
        at com.cschar.pmode3.ParticleContainerManager.updateInUI(ParticleContainerManager.java:174)
        at com.cschar.pmode3.ParticleContainerManager$2.run(ParticleContainerManager.java:157)
        at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:167)
        at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:167)
        at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:173)
        at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:167)
        at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
        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:595)
        at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:488)
        at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10$lambda$9(IdeEventQueue.kt:313)
        at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:865)
        at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10(IdeEventQueue.kt:312)
        at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:974)
        at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:110)
        at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:974)
        at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12(IdeEventQueue.kt:307)
        at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:347)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

@github-actions
Copy link
Copy Markdown
Contributor

Qodana Community for JVM

574 new problems were found

Inspection name Severity Problems
Field may be 'final' 🔶 Warning 141
Unused import 🔶 Warning 62
Javadoc declaration problems 🔶 Warning 36
Redundant type cast 🔶 Warning 28
Field can be local variable 🔶 Warning 25
Nullability and data flow problems 🔶 Warning 23
Unused assignment 🔶 Warning 22
Integer division in floating-point context 🔶 Warning 18
Access static member via instance reference 🔶 Warning 15
Incorrect string capitalization 🔶 Warning 9
Call to 'printStackTrace()' 🔶 Warning 9
Redundant local variable 🔶 Warning 9
'String.equals()' can be replaced with 'String.isEmpty()' 🔶 Warning 8
Unnecessary semicolon 🔶 Warning 7
Empty class initializer 🔶 Warning 4
Statement with empty body 🔶 Warning 4
Possibly lossy implicit cast in compound assignment 🔶 Warning 4
'@Serial' annotation can be used 🔶 Warning 4
String concatenation as argument to 'StringBuilder.append()' call 🔶 Warning 4
Suspicious variable/parameter name combination 🔶 Warning 4
Unnecessary call to 'toString()' 🔶 Warning 4
C-style array declaration 🔶 Warning 3
'size() == 0' can be replaced with 'isEmpty()' 🔶 Warning 3
Redundant 'if' statement 🔶 Warning 3
Busy wait 🔶 Warning 2
Catch block may ignore exception 🔶 Warning 2
Inner class may be 'static' 🔶 Warning 2
Redundant call to 'String.format()' 🔶 Warning 2
Unnecessary modifier 🔶 Warning 2
Too weak variable type leads to unnecessary cast 🔶 Warning 1
Caught exception is immediately rethrown 🔶 Warning 1
Early loop exit in 'if' condition 🔶 Warning 1
Result of method call ignored 🔶 Warning 1
Unused import directive 🔶 Warning 1
Method name same as class name 🔶 Warning 1
Mismatched read and write of array 🔶 Warning 1
Mismatched query and update of collection 🔶 Warning 1
@NotNull/@Nullable problems 🔶 Warning 1
Optional.get() is called without isPresent() check 🔶 Warning 1
Value passed as parameter never read 🔶 Warning 1
Pointless arithmetic expression 🔶 Warning 1
Local variable used and declared in different 'switch' branches 🔶 Warning 1
'Collection.toArray()' call style 🔶 Warning 1
Unnecessary 'return' statement 🔶 Warning 1
Wrapper type may be primitive 🔶 Warning 1
Commented out code ◽️ Notice 85
Method can be extracted ◽️ Notice 11
Function or property has platform type ◽️ Notice 2
Constant values ◽️ Notice 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked

View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2024.1.5
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

@cschar cschar merged commit 814fd44 into main Aug 10, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant