editorconfig / editorconfig-jetbrains

A JetBrains IDE plugin supporting the EditorConfig standard
MIT License
291 stars 21 forks source link

"InvocationTargetException: null" appears sporadically in WebStorm #8

Closed bellkev closed 11 years ago

bellkev commented 11 years ago

This stack trace is a little hard to work out. I believe JetBrains code calling invoke() is just catching the error as an "Exception" instead of as an "InvocationTargetException" and getting it's target exception. So... I'll have to do some sleuthing...

null java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:146) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.access$000(FileDocumentManagerImpl.java:86) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl$1.invoke(FileDocumentManagerImpl.java:113) at com.sun.proxy.$Proxy23.beforeDocumentSaving(Unknown Source) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:416) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:390) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:311) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:290) at org.editorconfig.plugincomponents.ReplacementFileDocumentManager.saveAllDocuments(ReplacementFileDocumentManager.java:61) at com.intellij.openapi.application.impl.ApplicationImpl.saveAll(ApplicationImpl.java:1459) at com.intellij.ide.actions.SaveAllAction.actionPerformed(SaveAllAction.java:26) 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:476) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:332) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) Caused by: java.lang.NullPointerException at com.intellij.openapi.fileEditor.impl.TrailingSpacesStripper.a(TrailingSpacesStripper.java:70) at com.intellij.openapi.fileEditor.impl.TrailingSpacesStripper.beforeDocumentSaving(TrailingSpacesStripper.java:57) ... 27 more

bellkev commented 11 years ago

Okay, this is due to the "STRIP_TRAILING_SPACES" setting sometimes being null because of the way I'm trying to persist the non-EditorConfig settings for trailing white spaces.

bellkev commented 11 years ago

I believe that the way I'm persisting non-editor-config settings in this class is more robust now, and that this issue is fixed (I no longer see it in WebStorm 7)