Bug 288538

Summary: [DOM/AST] "Paste" did not complete normally
Product: [Eclipse Project] JDT Reporter: George Lindholm <javadev>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, Olivier_Thomann, zdenek.zikan
Version: 3.5Keywords: needinfo
Target Milestone: 3.6 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description George Lindholm CLA 2009-09-03 14:37:53 EDT
What steps will reproduce the problem?
1.  Cut and paste


-- Error Details --
Date: Thu Sep 03 11:35:17 PDT 2009
Message: java.lang.IllegalArgumentException
Severity: Error
Product: Eclipse 1.2.0.20090618-0904 (org.eclipse.epp.package.jee.product)
Plugin: org.eclipse.ui
Session Data:
eclipse.buildId=I20090611-1540
java.version=1.6.0_15
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_CA
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product -clean -data e:\java\workspace-ks


Exception Stack Trace:
java.lang.IllegalArgumentException
at org.eclipse.jdt.core.dom.ASTNode.setSourceRange(ASTNode.java:2614)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:558)
at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:179)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2694)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1264)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.convert(CompilationUnitResolver.java:256)
at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:933)
at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:657)
at org.eclipse.jdt.core.dom.rewrite.ImportRewrite.rewriteImports(ImportRewrite.java:980)
at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.addImports(ClipboardOperationAction.java:526)
at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.doPasteWithImportsOperation(ClipboardOperationAction.java:492)
at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.internalDoOperation(ClipboardOperationAction.java:287)
at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction$1.run(ClipboardOperationAction.java:258)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.run(ClipboardOperationAction.java:256)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185)
at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:470)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:824)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:880)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:569)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:510)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:125)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1191)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1002)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1040)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1036)
at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1368)
at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4053)
at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:346)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3946)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:342)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4589)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2409)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3471)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
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 org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Comment 1 Olivier Thomann CLA 2009-09-03 14:50:16 EDT
Could you please provide the source code that you copy/paste ?
It would be helpful to get a complete description of the issue.
1) where the code is coming from (what package)
2) where the code is copied to

Some imports are modified and something is wrong with their positions.

So more details are required for investigation.
Comment 2 Olivier Thomann CLA 2009-10-02 09:03:36 EDT
Closing as WORKSFORME.
Please reopen when the requested information is provided.
Comment 3 Jay Arthanareeswaran CLA 2009-10-27 03:57:32 EDT
Verified for 3.6 M3
Comment 4 Zdenek Zikan CLA 2009-11-05 09:35:28 EST
The same problem here. Eclipse 3.5 Galileo. However, the stack trace is different. However, I tried pasting the same text into same file on the same position and it worked, so it probably makes no sense to include the clipboard content here. So unfortunately, I'm unable to provide more information than what you see below.

eclipse.buildId=M20090917-0800
java.version=1.6.0_16
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments:  -vm /opt/java/jre/bin/java -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os linux -ws gtk -arch x86 -vm /opt/java/jre/bin/java -product org.eclipse.epp.package.jee.product

java.lang.IllegalArgumentException: Index out of bounds
at org.eclipse.swt.SWT.error(SWT.java:3865)
at org.eclipse.swt.SWT.error(SWT.java:3799)
at org.eclipse.swt.SWT.error(SWT.java:3770)
at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java:4252)
at org.eclipse.swt.custom.StyledTextDropTargetEffect$1.handleEvent(StyledTextDropTargetEffect.java:71)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1176)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1200)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1185)
at org.eclipse.swt.widgets.Control.gtk_expose_event(Control.java:2779)
at org.eclipse.swt.widgets.Composite.gtk_expose_event(Composite.java:670)
at org.eclipse.swt.widgets.Canvas.gtk_expose_event(Canvas.java:170)
at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1566)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4587)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4191)
at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:7588)
at org.eclipse.swt.widgets.Display.eventProc(Display.java:1185)
at org.eclipse.swt.internal.gtk.OS._gdk_window_process_updates(Native Method)
at org.eclipse.swt.internal.gtk.OS.gdk_window_process_updates(OS.java:4865)
at org.eclipse.swt.widgets.Control.update(Control.java:4546)
at org.eclipse.swt.widgets.Control.update(Control.java:4537)
at org.eclipse.swt.widgets.Canvas.scroll(Canvas.java:264)
at org.eclipse.swt.custom.StyledText.scroll(StyledText.java:7266)
at org.eclipse.swt.custom.StyledText.scrollVertical(StyledText.java:7347)
at org.eclipse.swt.custom.StyledText.showLocation(StyledText.java:9344)
at org.eclipse.swt.custom.StyledText.showCaret(StyledText.java:9367)
at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:6640)
at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:7442)
at org.eclipse.swt.custom.StyledText.paste(StyledText.java:6690)
at org.eclipse.jface.text.TextViewer.paste(TextViewer.java:4026)
at org.eclipse.jface.text.TextViewer.doOperation(TextViewer.java:3970)
at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:921)
at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1533)
at org.eclipse.wst.sse.ui.internal.StructuredTextViewer.doOperation(StructuredTextViewer.java:431)
at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:131)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.java:129)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185)
at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:470)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:824)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:880)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:569)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:510)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:125)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1467)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1175)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1200)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1185)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1212)
at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:706)
at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:2837)
at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:703)
at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1570)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4587)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4191)
at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:7588)
at org.eclipse.swt.widgets.Display.eventProc(Display.java:1185)
at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1860)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3110)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
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 org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)