I think I got the same error when surrounding with if {}
It seems to happen when the first line of the selected block to surround is blank, and the cursor is _not_ at the beginning of the blank line. For example (| is the cursor, ~ indicates the boundaries of the selected text):
~|
String a = "a";~
This, however, works:
~|
String a = "a";~
[10322623] ERROR - com.intellij.command.a.b -
[10322673] ERROR - com.intellij.command.a.b - IntelliJ IDEA (Ariadna) B
uild #607
[10322693] ERROR - com.intellij.command.a.b - JDK: 1.3.1_01
[10322693] ERROR - com.intellij.command.a.b - VM: Java HotSpot(TM) Client
VM
[10322693] ERROR - com.intellij.command.a.b - Vendor: Sun Microsystems In
c.
[10322693] ERROR - com.intellij.command.a.b - OS: Windows 2000
[10322763] ERROR - com.intellij.command.a.b -
java.lang.IllegalArgumentException
at com.intellij.psi.impl.source.i.b(i.java:166)
at com.intellij.codeInsight.generation.surroundWith.l.a(l.java:18)
at com.intellij.codeInsight.generation.surroundWith.h.a(h.java:6)
at com.intellij.codeInsight.bb.run(bb.java)
at com.intellij.psi.impl.o.run(o.java:16)
at com.intellij.vfs.VirtualFileManager.b(VirtualFileManager.java:79)
at com.intellij.psi.impl.v.c(v.java:42)
at com.intellij.codeInsight.ba.run(ba.java:4)
at com.intellij.command.a.b.a(b.java:8)
at com.intellij.codeInsight.z.actionPerformed(z.java:0)
at com.intellij.ui.bu.a(bu.java:29)
at com.intellij.ui.bu.a(bu.java:7)
at com.intellij.ui.da.actionPerformed(da.java)
at javax.swing.JComponent$ActionStandin.actionPerformed(JComponent.java:
2377)
at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1384)
at javax.swing.JComponent.processKeyBinding(JComponent.java:2078)
at javax.swing.JComponent.processKeyBindings(JComponent.java:2115)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2041)
at java.awt.Component.processEvent(Component.java:3553)
at java.awt.Container.processEvent(Container.java:1164)
at java.awt.Component.dispatchEventImpl(Component.java:2593)
at java.awt.Container.dispatchEventImpl(Container.java:1213)
at java.awt.Component.dispatchEvent(Component.java:2497)
at java.awt.LightweightDispatcher.processKeyEvent(Container.java:2155)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2135)
at java.awt.Container.dispatchEventImpl(Container.java:1200)
at java.awt.Window.dispatchEventImpl(Window.java:926)
at java.awt.Component.dispatchEvent(Component.java:2497)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
at com.intellij.ide.c.dispatchEvent(c.java:26)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:131)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:98)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 28, 2002 5:05 AM
> To: [EMAIL PROTECTED]
> Subject: [Eap-list] #607 - NPE in surround with try/catch
>
>
>
> Win2k sp2, jdk1.3.1, idea #607
>
> Not reproducible NPE when doing a surround with try/catch
>
> Carlos
>
>
> [2912929] ERROR - com.intellij.command.a.b -
> [2912939] ERROR - com.intellij.command.a.b - IntelliJ IDEA
> (Ariadna) Build #607
> [2912939] ERROR - com.intellij.command.a.b - JDK: 1.3.1
> [2912939] ERROR - com.intellij.command.a.b - VM: Java
> HotSpot(TM) Client VM
> [2912939] ERROR - com.intellij.command.a.b - Vendor: Sun
> Microsystems Inc.
> [2912939] ERROR - com.intellij.command.a.b - OS: Windows 2000
> [2912959] ERROR - com.intellij.command.a.b -
> java.lang.NullPointerException
> at com.intellij.psi.impl.source.ce.a(ce.java:6)
> at com.intellij.codeInsight.s.a(s.java:131)
> at com.intellij.codeInsight.s.a(s.java:17)
> at com.intellij.codeInsight.s.a(s.java:246)
> at com.intellij.codeInsight.s.a(s.java:17)
> at com.intellij.codeInsight.s.a(s.java:246)
> at com.intellij.codeInsight.s.a(s.java:17)
> at
> com.intellij.codeInsight.generation.surroundWith.r.a(r.java:27)
> at
> com.intellij.codeInsight.generation.surroundWith.h.a(h.java:6)
> at com.intellij.codeInsight.bb.run(bb.java)
> at com.intellij.psi.impl.o.run(o.java:16)
> at
> com.intellij.vfs.VirtualFileManager.b(VirtualFileManager.java:79)
> at com.intellij.psi.impl.v.c(v.java:42)
> at com.intellij.codeInsight.ba.run(ba.java:4)
> at com.intellij.command.a.b.a(b.java:8)
> at com.intellij.codeInsight.z.actionPerformed(z.java:0)
> at com.intellij.codeInsight.d.keyPressed(d.java:0)
> at
> java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:191)
> at java.awt.Component.processKeyEvent(Component.java:3677)
> at
> javax.swing.JComponent.processKeyEvent(JComponent.java:2014)
> at java.awt.Component.processEvent(Component.java:3553)
> at java.awt.Container.processEvent(Container.java:1164)
> at java.awt.Component.dispatchEventImpl(Component.java:2593)
> at java.awt.Container.dispatchEventImpl(Container.java:1213)
> at java.awt.Component.dispatchEvent(Component.java:2497)
> at
> java.awt.LightweightDispatcher.processKeyEvent(Container.java:2155)
> at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2135)
> at java.awt.Container.dispatchEventImpl(Container.java:1200)
> at java.awt.Window.dispatchEventImpl(Window.java:914)
> at java.awt.Component.dispatchEvent(Component.java:2497)
> at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
> at com.intellij.ide.c.dispatchEvent(c.java:26)
> at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDis
> patchThrea
> d.java:131)
> at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispa
> tchThread.
> java:98)
> at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
> at
> java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
>
>
> _______________________________________________
> Eap-list mailing list
> [EMAIL PROTECTED]
> http://www.intellij.com/mailman/listinfo/eap-list
>
The information contained in this e-mail including any attachments may constitute Corvis Corporation Proprietary Information that is subject to Non-Disclosure Agreement and cannot be disclosed to any other party without the express consent of Corvis Corporation.
If you are neither the intended recipient of this e-mail nor responsible for delivering this e-mail to the intended recipient, note that any dissemination, distribution, copying, or retention of this e-mail is prohibited.
If you believe you have received this e-mail in error, we request that you notify the sender by return e-mail and then delete this e-mail and any return e-mail immediately.
