Exception editing the Ruby Class template

Hi,

I am evaluating RubyMine for a new project. I have added a new require (require "require_all") in the Ruby Class template, and then when using it the "class name" prompt is visualized, and the exception: "org.jetbrains.plugins.ruby.ruby.lang.psi.impl.methodCall.RCallImpl cannot be cast to org.jetbrains.plugins.ruby.ruby.lang.psi.controlStructures.classes.RClass" is shown.

Although the class is then correctly created in the project, I would like to eliminate the annoying exception.

Could you help me?

Thanks in advance.

3 comments
Comment actions Permalink

Hi,

Please show full exception stacktrace  (because without stactrace it is quite hard to say something definite). Or better submit an issue with stacktrace and idea.log file  (seejavascript:;) at http://youtrack.jetbrains.net/issues/ruby

0
Comment actions Permalink

Hi,

here it is the incrimined part of idea.log:

{{{
2011-07-08 15:17:21,507 [  67150]   INFO - lij.ide.actions.ElementCreator - org.jetbrains.plugins.ruby.ruby.lang.psi.impl.methodCall.RCallImpl cannot be cast to org.jetbrains.plugins.ruby.ruby.lang.psi.controlStructures.classes.RClass
java.lang.ClassCastException: org.jetbrains.plugins.ruby.ruby.lang.psi.impl.methodCall.RCallImpl cannot be cast to org.jetbrains.plugins.ruby.ruby.lang.psi.controlStructures.classes.RClass
    at org.jetbrains.plugins.ruby.ruby.actions.CreateRubyClassAction.create(CreateRubyClassAction.java:74)
    at com.intellij.ide.actions.CreateElementActionBase$MyInputValidator.create(CreateElementActionBase.java:146)
    at com.intellij.ide.actions.ElementCreator$1.run(ElementCreator.java:81)
    at com.intellij.openapi.application.RunResult.run(RunResult.java:37)
    at com.intellij.openapi.command.WriteCommandAction$2$1.run(WriteCommandAction.java:122)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:844)
    at com.intellij.openapi.command.WriteCommandAction$2.run(WriteCommandAction.java:120)
    at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:115)
    at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:91)
    at com.intellij.openapi.command.WriteCommandAction.performWriteCommandAction(WriteCommandAction.java:118)
    at com.intellij.openapi.command.WriteCommandAction.access$000(WriteCommandAction.java:34)
    at com.intellij.openapi.command.WriteCommandAction$1.run(WriteCommandAction.java:73)
    at com.intellij.openapi.command.WriteCommandAction.execute(WriteCommandAction.java:78)
    at com.intellij.ide.actions.ElementCreator.tryCreate(ElementCreator.java:75)
    at com.intellij.ide.actions.CreateElementActionBase$MyInputValidator.canClose(CreateElementActionBase.java:155)
    at com.intellij.openapi.ui.Messages$InputDialog$1.actionPerformed(Messages.java:883)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
    at javax.swing.plaf.basic.BasicRootPaneUI$Actions.actionPerformed(BasicRootPaneUI.java:191)
    at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1639)
    at javax.swing.JComponent.processKeyBinding(JComponent.java:2851)
    at javax.swing.KeyboardManager.fireBinding(KeyboardManager.java:267)
    at javax.swing.KeyboardManager.fireKeyboardAction(KeyboardManager.java:216)
    at javax.swing.JComponent.processKeyBindingsForAllComponents(JComponent.java:2928)
    at javax.swing.JComponent.processKeyBindings(JComponent.java:2920)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2814)
    at java.awt.Component.processEvent(Component.java:6066)
    at java.awt.Container.processEvent(Container.java:2041)
    at java.awt.Component.dispatchEventImpl(Component.java:4652)
    at java.awt.Container.dispatchEventImpl(Container.java:2099)
    at java.awt.Component.dispatchEvent(Component.java:4482)
    at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1850)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712)
    at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676)
    at java.awt.Component.dispatchEventImpl(Component.java:4524)
    at java.awt.Container.dispatchEventImpl(Container.java:2099)
    at java.awt.Window.dispatchEventImpl(Window.java:2478)
    at java.awt.Component.dispatchEvent(Component.java:4482)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
    at java.awt.EventQueue.access$000(EventQueue.java:85)
    at java.awt.EventQueue$1.run(EventQueue.java:603)
    at java.awt.EventQueue$1.run(EventQueue.java:601)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
    at java.awt.EventQueue$2.run(EventQueue.java:617)
    at java.awt.EventQueue$2.run(EventQueue.java:615)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
    at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:652)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:492)
    at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:404)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:368)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
    at java.awt.Dialog$1.run(Dialog.java:1046)
    at java.awt.Dialog$3.run(Dialog.java:1098)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.Dialog.show(Dialog.java:1096)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:675)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:412)
    at com.intellij.openapi.ui.DialogWrapper.showAndGetOk(DialogWrapper.java:1175)
    at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1160)
    at com.intellij.openapi.ui.Messages.showInputDialog(Messages.java:367)
    at org.jetbrains.plugins.ruby.ruby.actions.CreateRubyClassAction.invokeDialog(CreateRubyClassAction.java:38)
    at com.intellij.ide.actions.CreateElementActionBase.actionPerformed(CreateElementActionBase.java:78)
    at com.intellij.ui.popup.PopupFactoryImpl$ActionPopupStep$1.run(PopupFactoryImpl.java:503)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.a(FocusManagerImpl.java:486)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.e(FocusManagerImpl.java:475)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.d(FocusManagerImpl.java:459)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.access$200(FocusManagerImpl.java:50)
    at com.intellij.openapi.wm.impl.FocusManagerImpl$1.runEdt(FocusManagerImpl.java:78)
    at com.intellij.openapi.util.EdtRunnable$1.run(EdtRunnable.java:25)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:642)
    at java.awt.EventQueue.access$000(EventQueue.java:85)
    at java.awt.EventQueue$1.run(EventQueue.java:603)
    at java.awt.EventQueue$1.run(EventQueue.java:601)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:612)
    at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:652)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:505)
    at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:404)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:368)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
}}}

and here it is the modified Ruby Class template:

{{{
#parse("Ruby File Header.rb")

require "require_all"
require_rel "."

class ${Class_Name}
  # To change this template use File | Settings | File Templates.
end
}}}

the exception is the same with RM 3.1.1 and 3.2.1.

Thanks,
Moreno

0
Comment actions Permalink

Hello Moreno,

Thanks for the issue, we've managed to reproduce and here is an issue: http://youtrack.jetbrains.net/issue/RUBY-8887
Feel free to watch, vote, comment and track progress.

Regards,
Oleg

0

Please sign in to leave a comment.