VCS plugin problem

I am writing a VCS plugin for BitKeeper. BitKeeper files are normally read-only, users can check them out for editing with 'bk edit' command, at which point file(s) turn writable
(on the filesystem level, physical file(s) is deleted and recreated from the local repository).

I've created a class that extends AbstractVCS and returns editFileProvider.
Whenever I go to Refactor->Rename or Move, a clear R/O status (using Bitkeeper) dialog comes up. Upon pressing OK, editFileProvider.editFile is called. In that method, I call 'bk edit' external command and refresh vFile (in WriteAction). At that point, I get the exception below. Rename class dialog shows up however it doesn't do anything (produces another exception). One interesting piece of information is that if I call 'attrib -r' or chmod u+w' instead of 'bk edit', file becomes writable and refactoring goes through ok.

Am I missing something in OpenAPI? What could be wrong?

Please advise.

Thanks,
Eddie




java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:78)
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:86)
at com.intellij.usageView.UsageViewUtil.getShortName(UsageViewUtil.java:102)
at com.intellij.refactoring.rename.RenameDialog.c(RenameDialog.java:15)
at com.intellij.refactoring.rename.RenameDialog.b(RenameDialog.java:102)
at com.intellij.refactoring.rename.RenameDialog.]]>(RenameDialog.java:215)
at com.intellij.refactoring.rename.PsiElementRenameHandler.a(PsiElementRenameHandler.java:3)
at com.intellij.refactoring.rename.PsiElementRenameHandler.invoke(PsiElementRenameHandler.java:81)
at com.intellij.refactoring.rename.PsiElementRenameHandler.invoke(PsiElementRenameHandler.java:51)
at com.intellij.refactoring.actions.BaseRefactoringAction.actionPerformed(BaseRefactoringAction.java:26)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:9)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:22)
at com.intellij.ui.plaf.beg.BegMenuItemUI.a(BegMenuItemUI.java:258)
at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:97)
at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:3)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:56)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:94)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:132)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
ERROR - tellij.usageView.UsageViewUtil - Assertion failed
ERROR - tellij.usageView.UsageViewUtil - IntelliJ IDEA 5.1.2 Build #4267
ERROR - tellij.usageView.UsageViewUtil - JDK: 1.5.0_07
ERROR - tellij.usageView.UsageViewUtil - VM: Java HotSpot(TM) Client VM
ERROR - tellij.usageView.UsageViewUtil - Vendor: Sun Microsystems Inc.
ERROR - tellij.usageView.UsageViewUtil - OS: Windows XP
ERROR - tellij.usageView.UsageViewUtil - Last Action: RenameElement
ERROR - tellij.usageView.UsageViewUtil - Assertion failed
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:78)
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:86)
at com.intellij.usageView.UsageViewUtil.getShortName(UsageViewUtil.java:102)
at com.intellij.refactoring.rename.RenameDialog.c(RenameDialog.java:15)
at com.intellij.refactoring.rename.RenameDialog.b(RenameDialog.java:102)
at com.intellij.refactoring.rename.RenameDialog.(RenameDialog.java:215) at com.intellij.refactoring.rename.PsiElementRenameHandler.a(PsiElementRenameHandler.java:3) at com.intellij.refactoring.rename.PsiElementRenameHandler.invoke(PsiElementRenameHandler.java:81) at com.intellij.refactoring.rename.PsiElementRenameHandler.invoke(PsiElementRenameHandler.java:51) at com.intellij.refactoring.actions.BaseRefactoringAction.actionPerformed(BaseRefactoringAction.java:26) at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:9) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:22) at com.intellij.ui.plaf.beg.BegMenuItemUI.a(BegMenuItemUI.java:258) at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:97) at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:3) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:56) at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:94) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:132) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) java.lang.Throwable at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:78) at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:86) at com.intellij.usageView.UsageViewUtil.getDescriptiveName(UsageViewUtil.java:10) at com.intellij.refactoring.rename.RenameDialog.a(RenameDialog.java:143) at com.intellij.refactoring.rename.RenameDialog.]]>(RenameDialog.java:216)
at com.intellij.refactoring.rename.PsiElementRenameHandler.a(PsiElementRenameHandler.java:3)
at com.intellij.refactoring.rename.PsiElementRenameHandler.invoke(PsiElementRenameHandler.java:81)
at com.intellij.refactoring.rename.PsiElementRenameHandler.invoke(PsiElementRenameHandler.java:51)
at com.intellij.refactoring.actions.BaseRefactoringAction.actionPerformed(BaseRefactoringAction.java:26)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:9)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:22)
at com.intellij.ui.plaf.beg.BegMenuItemUI.a(BegMenuItemUI.java:258)
at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:97)
at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:3)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:56)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:94)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:132)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
ERROR - tellij.usageView.UsageViewUtil - Assertion failed
ERROR - tellij.usageView.UsageViewUtil - IntelliJ IDEA 5.1.2 Build #4267
ERROR - tellij.usageView.UsageViewUtil - JDK: 1.5.0_07
ERROR - tellij.usageView.UsageViewUtil - VM: Java HotSpot(TM) Client VM
ERROR - tellij.usageView.UsageViewUtil - Vendor: Sun Microsystems Inc.
ERROR - tellij.usageView.UsageViewUtil - OS: Windows XP
ERROR - tellij.usageView.UsageViewUtil - Last Action: RenameElement
ERROR - tellij.usageView.UsageViewUtil - Assertion failed
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:78)
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:86)
at com.intellij.usageView.UsageViewUtil.getDescriptiveName(UsageViewUtil.java:10)
at com.intellij.refactoring.rename.RenameDialog.a(RenameDialog.java:143)
at com.intellij.refactoring.rename.RenameDialog.]]>(RenameDialog.java:216)
at com.intellij.refactoring.rename.PsiElementRenameHandler.a(PsiElementRenameHandler.java:3)
at com.intellij.refactoring.rename.PsiElementRenameHandler.invoke(PsiElementRenameHandler.java:81)
at com.intellij.refactoring.rename.PsiElementRenameHandler.invoke(PsiElementRenameHandler.java:51)
at com.intellij.refactoring.actions.BaseRefactoringAction.actionPerformed(BaseRefactoringAction.java:26)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:9)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:22)
at com.intellij.ui.plaf.beg.BegMenuItemUI.a(BegMenuItemUI.java:258)
at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:97)
at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:3)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:56)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:94)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:132)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

1 comment
Comment actions Permalink

Hello Edward,

If the 'bk edit' does delete and recreate the file, this explains quite well
why the exception happens. All the code in IDEA expects that the file passed
to EditFileProvider remains valid (that is, is not deleted and recreated),
and I'm afraid it would be quite hard to change that.

EJ> I am writing a VCS plugin for BitKeeper. BitKeeper files are
EJ> normally read-only, users can check them out for editing with 'bk
EJ> edit' command, at which point file(s) turn writable (on the
EJ> filesystem level, physical file(s) is deleted and recreated from the
EJ> local repository).
EJ>
EJ> I've created a class that extends AbstractVCS and returns
EJ> editFileProvider.
EJ>
EJ> Whenever I go to Refactor->Rename or Move, a clear R/O status (using
EJ> Bitkeeper) dialog comes up. Upon pressing OK,
EJ> editFileProvider.editFile is called. In that method, I call 'bk
EJ> edit' external command and refresh vFile (in WriteAction). At that
EJ> point, I get the exception below. Rename class dialog shows up
EJ> however it doesn't do anything (produces another exception). One
EJ> interesting piece of information is that if I call 'attrib -r' or
EJ> chmod u+w' instead of 'bk edit', file becomes writable and
EJ> refactoring goes through ok.
EJ>
EJ> Am I missing something in OpenAPI? What could be wrong?
EJ>
EJ> Please advise.
EJ>
EJ> Thanks,
EJ> Eddie
EJ> java.lang.Throwable
EJ> at
EJ> com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:78)
EJ> at
EJ> com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:86)
EJ> at
EJ> com.intellij.usageView.UsageViewUtil.getShortName(UsageViewUtil.java
EJ> :102)
EJ> at
EJ> com.intellij.refactoring.rename.RenameDialog.c(RenameDialog.java:15)
EJ> at
EJ> com.intellij.refactoring.rename.RenameDialog.b(RenameDialog.java:102
EJ> )
EJ> at
EJ> com.intellij.refactoring.rename.RenameDialog.(RenameDialog.jav EJ> a:215) EJ> at EJ> com.intellij.refactoring.rename.PsiElementRenameHandler.a(PsiElement EJ> RenameHandler.java:3) EJ> at EJ> com.intellij.refactoring.rename.PsiElementRenameHandler.invoke(PsiEl EJ> ementRenameHandler.java:81) EJ> at EJ> com.intellij.refactoring.rename.PsiElementRenameHandler.invoke(PsiEl EJ> ementRenameHandler.java:51) EJ> at EJ> com.intellij.refactoring.actions.BaseRefactoringAction.actionPerform EJ> ed(BaseRefactoringAction.java:26) EJ> at EJ> com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmit EJ> ter.actionPerformed(ActionMenuItem.java:9) EJ> at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) EJ> at EJ> com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerf EJ> ormed(ActionMenuItem.java:22) EJ> at com.intellij.ui.plaf.beg.BegMenuItemUI.a(BegMenuItemUI.java:258) EJ> at EJ> com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java EJ> :97) EJ> at EJ> com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseRele EJ> ased(BegMenuItemUI.java:3) EJ> at java.awt.Component.processMouseEvent(Unknown Source) EJ> at javax.swing.JComponent.processMouseEvent(Unknown Source) EJ> at java.awt.Component.processEvent(Unknown Source) EJ> at java.awt.Container.processEvent(Unknown Source) EJ> at java.awt.Component.dispatchEventImpl(Unknown Source) EJ> at java.awt.Container.dispatchEventImpl(Unknown Source) EJ> at java.awt.Component.dispatchEvent(Unknown Source) EJ> at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown EJ> Source) EJ> at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) EJ> at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) EJ> at java.awt.Container.dispatchEventImpl(Unknown Source) EJ> at java.awt.Window.dispatchEventImpl(Unknown Source) EJ> at java.awt.Component.dispatchEvent(Unknown Source) EJ> at java.awt.EventQueue.dispatchEvent(Unknown Source) EJ> at EJ> com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.ja EJ> va:56) EJ> at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:94) EJ> at EJ> com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:132) EJ> at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown EJ> Source) EJ> at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown EJ> Source) EJ> at java.awt.EventDispatchThread.pumpEvents(Unknown Source) EJ> at java.awt.EventDispatchThread.pumpEvents(Unknown Source) EJ> at java.awt.EventDispatchThread.run(Unknown Source) EJ>]]> ERROR - tellij.usageView.UsageViewUtil - Assertion failed
EJ> ERROR - tellij.usageView.UsageViewUtil - IntelliJ IDEA
EJ> 5.1.2 Build #4267
EJ> ERROR - tellij.usageView.UsageViewUtil - JDK: 1.5.0_07
EJ> ERROR - tellij.usageView.UsageViewUtil - VM: Java
EJ> HotSpot(TM) Client VM
EJ> ERROR - tellij.usageView.UsageViewUtil - Vendor: Sun
EJ> Microsystems Inc.
EJ> ERROR - tellij.usageView.UsageViewUtil - OS: Windows XP
EJ> ERROR - tellij.usageView.UsageViewUtil - Last Action:
EJ> RenameElement
EJ> ERROR - tellij.usageView.UsageViewUtil - Assertion failed
EJ> java.lang.Throwable
EJ> at
EJ> com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:78)
EJ> at
EJ> com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:86)
EJ> at
EJ> com.intellij.usageView.UsageViewUtil.getShortName(UsageViewUtil.java
EJ> :102)
--
Dmitry Jemerov
Software Developer
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.