Menu

#20 Issuing the log macro in class scope leads to an exception.

v1.0.11
open
None
5
2014-08-23
2013-11-04
No

The attached exception can appear when issuing the macro in the following invalid scope:


class MyClass {
logi + TAB
}


Leads to the exception:

Element: class com.intellij.psi.impl.source.tree.java.PsiIdentifierImpl because: containing file is null; com.intellij.psi.impl.source.tree.java.PsiIdentifierImpl:IDENTIFIER / com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl:JAVA_CODE_REFERENCE / com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl:JAVA_CODE_REFERENCE: Element: class com.intellij.psi.impl.source.tree.java.PsiIdentifierImpl because: containing file is null; com.intellij.psi.impl.source.tree.java.PsiIdentifierImpl:IDENTIFIER / com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl:JAVA_CODE_REFERENCE / com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl:JAVA_CODE_REFERENCE
com.intellij.psi.PsiInvalidElementAccessException: Element: class com.intellij.psi.impl.source.tree.java.PsiIdentifierImpl because: containing file is null; com.intellij.psi.impl.source.tree.java.PsiIdentifierImpl:IDENTIFIER / com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl:JAVA_CODE_REFERENCE / com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl:JAVA_CODE_REFERENCE
at com.intellij.psi.impl.source.tree.LeafPsiElement.a(LeafPsiElement.java:107)
at com.intellij.psi.impl.source.tree.LeafPsiElement.getContainingFile(LeafPsiElement.java:91)
at com.intellij.psi.util.PsiUtil.getTopLevelClass(PsiUtil.java:623)
at net.sf.logsupport.util.LoggerFieldBuilder.classForPlace(LoggerFieldBuilder.java:41)
at net.sf.logsupport.util.LoggerFieldBuilder.access$000(LoggerFieldBuilder.java:36)
at net.sf.logsupport.util.LoggerFieldBuilder$1.run(LoggerFieldBuilder.java:118)
at net.sf.logsupport.livetemplates.TemplatePostProcessor.processText(TemplatePostProcessor.java:85)
at com.intellij.codeInsight.template.impl.TemplateState.a(TemplateState.java:1016)
at com.intellij.codeInsight.template.impl.TemplateState.access$2100(TemplateState.java:69)
at com.intellij.codeInsight.template.impl.TemplateState$5.run(TemplateState.java:380)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1013)
at com.intellij.codeInsight.template.impl.TemplateState.doReformat(TemplateState.java:385)
at com.intellij.codeInsight.template.impl.TemplateState$4.run(TemplateState.java:344)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1013)
at com.intellij.codeInsight.template.impl.TemplateState.a(TemplateState.java:330)
at com.intellij.codeInsight.template.impl.TemplateState.start(TemplateState.java:312)
at com.intellij.codeInsight.template.impl.TemplateManagerImpl$6.run(TemplateManagerImpl.java:453)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:117)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:99)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:85)
at com.intellij.codeInsight.template.impl.TemplateManagerImpl.startTemplateWithPrefix(TemplateManagerImpl.java:441)
at com.intellij.codeInsight.template.impl.TemplateManagerImpl$5.run(TemplateManagerImpl.java:382)
at com.intellij.codeInsight.template.impl.TemplateManagerImpl.startTemplate(TemplateManagerImpl.java:137)
at com.intellij.codeInsight.template.impl.editorActions.ExpandLiveTemplateByTabAction$1.executeWriteAction(ExpandLiveTemplateByTabAction.java:36)
at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.run(EditorWriteActionHandler.java:54)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1013)
at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.execute(EditorWriteActionHandler.java:37)
at com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAction.java:82)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:124)
at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:93)
at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:67)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$3.performAction(IdeKeyEventDispatcher.java:564)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:611)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.d(IdeKeyEventDispatcher.java:463)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:206)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:494)
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)


Discussion


Log in to post a comment.