chedim / idea-android

Automatically exported from code.google.com/p/idea-android
0 stars 0 forks source link

Create Activity with no package info some times results in IDEA #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create Activity with no package info some times results in IDEA 
exception
2. Create an empty project and create new activity directly
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

com.intellij.psi.impl.source.PsiPlainTextFileImpl cannot be cast to 
com.intellij.psi.PsiJavaFile
java.lang.ClassCastException: 
com.intellij.psi.impl.source.PsiPlainTextFileImpl cannot be cast to 
com.intellij.psi.PsiJavaFile
    at 
com.intellij.ide.fileTemplates.FileTemplateUtil.createClassOrInterface
(FileTemplateUtil.java:119)
    at com.intellij.ide.fileTemplates.FileTemplateUtil$3$1.run
(FileTemplateUtil.java:12)
    at com.intellij.openapi.application.impl.ApplicationImpl$13.compute
(ApplicationImpl.java:3)
    at 
com.intellij.psi.impl.source.PostprocessReformattingAspect.postponeFormatti
ngInside(PostprocessReformattingAspect.java:109)
    at 
com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction
(ApplicationImpl.java:214)
    at com.intellij.ide.fileTemplates.FileTemplateUtil$3.run
(FileTemplateUtil.java:1)
    at 
com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand
(CommandProcessorImpl.java:94)
    at 
com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand
(CommandProcessorImpl.java:68)
    at 
com.intellij.ide.fileTemplates.FileTemplateUtil.createFromTemplate
(FileTemplateUtil.java:145)
    at com.intellij.psi.impl.file.PsiDirectoryImpl.a
(PsiDirectoryImpl.java:198)
    at com.intellij.psi.impl.file.PsiDirectoryImpl.createClass
(PsiDirectoryImpl.java:126)
    at org.jetbrains.android.actions.CreateActivityAction.create
(CreateActivityAction.java:58)
    at 
com.intellij.ide.actions.CreateElementActionBase$MyInputValidator$1$1.run
(CreateElementActionBase.java:162)
    at com.intellij.openapi.application.impl.ApplicationImpl$13.compute
(ApplicationImpl.java:3)
    at 
com.intellij.psi.impl.source.PostprocessReformattingAspect.postponeFormatti
ngInside(PostprocessReformattingAspect.java:109)
    at 
com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction
(ApplicationImpl.java:214)
    at 
com.intellij.ide.actions.CreateElementActionBase$MyInputValidator$1.run
(CreateElementActionBase.java:177)
    at 
com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand
(CommandProcessorImpl.java:67)
    at 
com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand
(CommandProcessorImpl.java:68)
    at 
com.intellij.ide.actions.CreateElementActionBase$MyInputValidator.canClose
(CreateElementActionBase.java:180)
    at 
org.jetbrains.android.actions.CreateActivityAction$MyDialog.doOKAction
(CreateActivityAction.java:136)
    at com.intellij.openapi.ui.DialogWrapper$OkAction.actionPerformed
(DialogWrapper.java:882)
    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.plaf.basic.BasicButtonListener.mouseReleased
(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.java:6038)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
    at java.awt.Component.processEvent(Component.java:5803)
    at java.awt.Container.processEvent(Container.java:2058)
    at java.awt.Component.dispatchEventImpl(Component.java:4410)
    at java.awt.Container.dispatchEventImpl(Container.java:2116)
    at java.awt.Component.dispatchEvent(Component.java:4240)
    at java.awt.LightweightDispatcher.retargetMouseEvent
(Container.java:4322)
    at java.awt.LightweightDispatcher.processMouseEvent
(Container.java:3986)
    at java.awt.LightweightDispatcher.dispatchEvent
(Container.java:3916)
    at java.awt.Container.dispatchEventImpl(Container.java:2102)
    at java.awt.Window.dispatchEventImpl(Window.java:2429)
    at java.awt.Component.dispatchEvent(Component.java:4240)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at com.intellij.ide.IdeEventQueue.c(IdeEventQueue.java:111)
    at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:203)
    at com.intellij.ide.IdeEventQueue.dispatchEvent
(IdeEventQueue.java:92)
    at java.awt.EventDispatchThread.pumpOneEventForFilters
(EventDispatchThread.java:273)
    at java.awt.EventDispatchThread.pumpEventsForFilter
(EventDispatchThread.java:183)
    at java.awt.EventDispatchThread.pumpEventsForFilter
(EventDispatchThread.java:177)
    at java.awt.Dialog$1.run(Dialog.java:1039)
    at java.awt.Dialog$3.run(Dialog.java:1091)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.Dialog.show(Dialog.java:1089)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show
(DialogWrapperPeerImpl.java:30)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show
(DialogWrapperPeerImpl.java:76)
    at com.intellij.openapi.ui.DialogWrapper.show
(DialogWrapper.java:774)
    at org.jetbrains.android.actions.CreateActivityAction.invokeDialog
(CreateActivityAction.java:48)
    at com.intellij.ide.actions.CreateElementActionBase.actionPerformed
(CreateElementActionBase.java:84)
    at 
com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.act
ionPerformed(ActionMenuItem.java:14)
    at javax.swing.AbstractButton.fireActionPerformed
(AbstractButton.java:1995)
    at 
com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed
(ActionMenuItem.java:32)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.a(BegMenuItemUI.java:183)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300
(BegMenuItemUI.java:151)
    at 
com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased
(BegMenuItemUI.java:3)
    at java.awt.Component.processMouseEvent(Component.java:6038)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
    at java.awt.Component.processEvent(Component.java:5803)
    at java.awt.Container.processEvent(Container.java:2058)
    at java.awt.Component.dispatchEventImpl(Component.java:4410)
    at java.awt.Container.dispatchEventImpl(Container.java:2116)
    at java.awt.Component.dispatchEvent(Component.java:4240)
    at java.awt.LightweightDispatcher.retargetMouseEvent
(Container.java:4322)
    at java.awt.LightweightDispatcher.processMouseEvent
(Container.java:3986)
    at java.awt.LightweightDispatcher.dispatchEvent
(Container.java:3916)
    at java.awt.Container.dispatchEventImpl(Container.java:2102)
    at java.awt.Window.dispatchEventImpl(Window.java:2429)
    at java.awt.Component.dispatchEvent(Component.java:4240)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at com.intellij.ide.IdeEventQueue.c(IdeEventQueue.java:111)
    at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:203)
    at com.intellij.ide.IdeEventQueue.dispatchEvent
(IdeEventQueue.java:92)
    at java.awt.EventDispatchThread.pumpOneEventForFilters
(EventDispatchThread.java:273)
    at java.awt.EventDispatchThread.pumpEventsForFilter
(EventDispatchThread.java:183)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy
(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents
(EventDispatchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents
(EventDispatchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

Original issue reported on code.google.com by nagendra...@gmail.com on 15 Dec 2007 at 12:24