Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalAccessError when I click on "Add to .gitignore file" #149

Closed
lopotun opened this issue Jun 25, 2015 · 5 comments
Closed
Labels
Milestone

Comments

@lopotun
Copy link

lopotun commented Jun 25, 2015

So, when I right-click on a file in project and call "Add to .gitignore file" menu item, I get the error mentioned below. It happens on Windows7, IntelliJ 12.1.6, plugin version: 1.1.4.

As I can see, mobi.hsz.idea.gitignore.actions.IgnoreFileAction tries to call com.intellij.openapi.util.text.StringUtil.escapeChar(String, char) method while this method is private (see http://grepcode.com/file/repository.grepcode.com/java/ext/com.jetbrains/intellij-idea/12.1.2/com/intellij/openapi/util/text/StringUtil.java#StringUtil.escapeChar%28java.lang.String%2Cchar%29 )

Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(549,1074),absolute(541,1066),button=1,modifiers=Button1,clickCount=1] on frame0: tried to access method com.intellij.openapi.util.text.StringUtil.escapeChar(Ljava/lang/String;C)Ljava/lang/String; from class mobi.hsz.idea.gitignore.actions.IgnoreFileAction
java.lang.IllegalAccessError: tried to access method com.intellij.openapi.util.text.StringUtil.escapeChar(Ljava/lang/String;C)Ljava/lang/String; from class mobi.hsz.idea.gitignore.actions.IgnoreFileAction
    at mobi.hsz.idea.gitignore.actions.IgnoreFileAction.getPath(IgnoreFileAction.java:160)
    at mobi.hsz.idea.gitignore.actions.IgnoreFileAction.actionPerformed(IgnoreFileAction.java:121)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:162)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:259)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:892)
    at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:114)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:230)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:104)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.a(BegMenuItemUI.java:512)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:44)
    at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:532)
    at java.awt.Component.processMouseEvent(Component.java:6505)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
    at java.awt.Component.processEvent(Component.java:6270)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4861)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
    at java.awt.Container.dispatchEventImpl(Container.java:2273)
    at java.awt.Window.dispatchEventImpl(Window.java:2719)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:688)
    at java.awt.EventQueue$3.run(EventQueue.java:686)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.awt.EventQueue$4.run(EventQueue.java:702)
    at java.awt.EventQueue$4.run(EventQueue.java:700)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
    at com.intellij.ide.IdeEventQueue.d(IdeEventQueue.java:700)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:521)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:348)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
@hsz hsz added the bug label Jun 25, 2015
@hsz hsz added this to the 1.2 milestone Jun 25, 2015
@hsz
Copy link
Member

hsz commented Jun 25, 2015

@lopotun Thank you for reporting. Indeed - this method was private in the IntelliJ 12.x - since I'm working with later API it didn't report me any issues. Anyway - I've made a fix for that and it'll be pushed in the next release of the plugin.

@hsz hsz closed this as completed in 41aec26 Jun 25, 2015
@lopotun
Copy link
Author

lopotun commented Jun 25, 2015

@hsz Thank you for your prompt responce! :-)
Do you succeed to compile the project? I don't. For example mobi.hsz.idea.gitignore.util.CacheMap uses mobi.hsz.idea.gitignore.psi.IgnoreEntry and mobi.hsz.idea.gitignore.psi.IgnoreVisitor that don't exist in the project.
Thanks.

@hsz
Copy link
Member

hsz commented Jun 25, 2015

@lopotun It looks like you didn't generate sources from BNF and Flex files.

Have you read Compiling the source code in README ?

@lopotun
Copy link
Author

lopotun commented Jun 25, 2015

@hsz Oh, sorry! That's my fault. I'll do it according to instructions. Thanks!

@lopotun
Copy link
Author

lopotun commented Jun 30, 2015

@hsz Well, it seems we're about to move to IDEA 14.X next week, so this won't be relevant anymore for me.
For those who still want/need to compile the plugin in IDEA 12.X there are some notes that arn't covered by README.md:

  1. There is no "Resources" configuration section in IDEA 12.X.
  2. JFlex plugin's configuration points to ".../JetBrains/IntelliJ IDEA 12.1.4/tools/jflex" directory that actually does not exist (IDEA 12.X problem? JFlex plugin's problem?).
  3. When you run "JFlex Generator" IDEA 12.X fails to download some file fron GitHub.com due to untrusted certificate issue. There are chances, however, that this is our local problem since we're behind strict corporate firewall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants