alibaba / alibaba/Alibaba-Java-Coding-Guidelines

idea 2020.1报错

Open
#14 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
1.1k
Forks
246
PR merge metrics
No merged PRs in 30d

Description

`java.lang.Throwable: Do not call commitAllDocumentsUnderProgress inside write-action
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:146)
at com.intellij.psi.impl.PsiDocumentManagerBase.commitAllDocumentsUnderProgress(PsiDocumentManagerBase.java:229)
at com.intellij.refactoring.actions.BaseRefactoringAction.actionPerformed(BaseRefactoringAction.java:94)
at com.alibaba.p3c.idea.quickfix.AliQuickFix$Companion.doQuickFix(AliQuickFix.kt:75)
at com.alibaba.p3c.idea.quickfix.ConstantFieldShouldBeUpperCaseQuickFix.applyFix(ConstantFieldShouldBeUpperCaseQuickFix.kt:46)
at com.alibaba.p3c.idea.quickfix.ConstantFieldShouldBeUpperCaseQuickFix.applyFix(ConstantFieldShouldBeUpperCaseQuickFix.kt:30)
at com.intellij.codeInspection.ex.QuickFixWrapper.invoke(QuickFixWrapper.java:70)
at com.intellij.codeInsight.intention.impl.IntentionActionWithTextCaching$MyIntentionAction.invoke(IntentionActionWithTextCaching.java:186)
at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$invokeIntention$4(ShowIntentionActionsHandler.java:244)
at com.intellij.openapi.application.WriteAction.run(WriteAction.java:102)
at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.invokeIntention(ShowIntentionActionsHandler.java:246)
at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$chooseActionAndInvoke$3(ShowIntentionActionsHandler.java:221)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:220)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:178)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:168)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:154)
at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.chooseActionAndInvoke(ShowIntentionActionsHandler.java:220)
at com.intellij.codeInsight.intention.impl.IntentionListStep.lambda$applyAction$3(IntentionListStep.java:119)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94)
at com.intellij.ui.popup.AbstractPopup.lambda$dispose$13(AbstractPopup.java:1454)
at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:2319)
at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.java:188)
at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.java:140)
at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:171)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.doWhenFocusSettlesDown(IdeFocusManagerImpl.java:36)
at com.intellij.ui.popup.AbstractPopup.dispose(AbstractPopup.java:1450)
at com.intellij.ui.popup.WizardPopup.dispose(WizardPopup.java:152)
at com.intellij.ui.popup.list.ListPopupImpl.dispose(ListPopupImpl.java:326)
at com.intellij.openapi.util.ObjectNode.lambda$execute$0(ObjectNode.java:111)
at com.intellij.openapi.util.ObjectTree.executeActionWithRecursiveGuard(ObjectTree.java:184)
at com.intellij.openapi.util.ObjectNode.execute(ObjectNode.java:71)
at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:134)
at com.intellij.openapi.util.Disposer.dispose(Disposer.java:116)
at com.intellij.openapi.util.Disposer.dispose(Disposer.java:106)
at com.intellij.ui.popup.WizardPopup.disposeAllParents(WizardPopup.java:255)
at com.intellij.ui.popup.list.ListPopupImpl.handleNextStep(ListPopupImpl.java:461)
at com.intellij.ui.popup.list.ListPopupImpl._handleSelect(ListPopupImpl.java:415)
at com.intellij.ui.popup.list.ListPopupImpl.handleSelect(ListPopupImpl.java:356)
at com.intellij.ui.popup.list.ListPopupImpl$1.actionPerformed(ListPopupImpl.java:269)
at com.intellij.ui.popup.WizardPopup.proceedKeyEvent(WizardPopup.java:370)
at com.intellij.ui.popup.WizardPopup.dispatch(WizardPopup.java:350)
at com.intellij.ui.popup.PopupDispatcher.dispatchKeyEvent(PopupDispatcher.java:112)
at com.intellij.ui.popup.PopupDispatcher.dispatch(PopupDispatcher.java:148)
at com.intellij.ide.IdePopupManager.dispatch(IdePopupManager.java:93)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:814)
at com.intellij.ide.IdeEventQueue.lambda$null$8(IdeEventQueue.java:449)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:741)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:502)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the error in IntelliJ IDEA 2020.1, then inspect AliQuickFix.kt at doQuickFix and ConstantFieldShouldBeUpperCaseQuickFix.kt at applyFix. Trace how the quick fix enters the write action and verify the completed fix no longer reports the commitAllDocumentsUnderProgress exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.