Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 103738

Summary: NPE when adding a component
Product: z_Archived Reporter: Ben <ben77>
Component: VEAssignee: Joe Winchester <Winchest>
Status: CLOSED DUPLICATE QA Contact:
Severity: major    
Priority: P3 CC: richkulp, sgunturi, walkerp
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Ben CLA 2005-07-13 18:47:31 EDT
To reproduce: create a Shell visual class.
Add a button, say ok to the popup name dialog.
The mouse pointer is still in the "add" cursor, and hovering over the shell
still gives feedback like before the button was added.
Clicking again resets it to normal and does not add another button.

Also works with a JFrame + JButton.

NPE trace:
Error 2005-07-13 18:42:48.932 java.lang.NullPointerException
java.lang.NullPointerException
	at org.eclipse.gef.tools.CreationTool.selectAddedObject(CreationTool.java:265)
	at org.eclipse.gef.tools.CreationTool.performCreation(CreationTool.java:254)
	at org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTool.java:178)
	at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1053)
	at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:259)
	at
org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:374)
	at
org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:548)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:137)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1021)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2867)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2572)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
	at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
	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:585)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
	at org.eclipse.core.launcher.Main.run(Main.java:973)
	at org.eclipse.core.launcher.Main.main(Main.java:948)
Comment 1 Richard Kulp CLA 2005-07-13 19:10:53 EDT
Sri, could you verify this with your Linux machine? Thanks.
Comment 2 Srimanth CLA 2005-07-14 10:36:25 EDT
On linux-gtk i created a new Shell class, and from the palette was able to drop
a button and drop-resize a button with no exceptions. everything was working as
expected. On 07132005 driver.
Comment 3 Srimanth CLA 2005-07-14 12:33:18 EDT
Doing more testing on linux-gtk I hit the same problem with Swing. Created an
empty class and tried to drop a JSplitPane on the freeform. Threw the exact same
exception and the cursor is still loaded. the source however is generated and
tree edit part is generated. Only the UI editpart is not and the cursor is loaded. 
Comment 4 Srimanth CLA 2005-07-14 15:20:58 EDT
This happens on linux-gtk when the bean name dialog pops up during the bean
creation. If one disables the dialog things work fine.
Comment 5 Joe Winchester CLA 2005-07-19 18:36:01 EDT
Fixed by making it so that the dialog does not appear on Linux that allows the 
field to be renamed on drop.  This is OK for 1.1 given the time left to do 
fixes, but I'll leave the bug open and defer to 1.2 for a more thorough 
investigation of the problem and fix post 1.1
Comment 6 Ben CLA 2005-07-20 18:17:01 EDT
(In reply to comment #5)
> Fixed by making it so that the dialog does not appear on Linux that allows the 
> field to be renamed on drop.  

I personally don't mind the bug much and would rather have the dialog + the bug
than have neither. Perhaps just change the default setting under Linux to be off?

Comment 7 Joe Winchester CLA 2005-07-21 05:12:20 EDT
(In reply to comment #6)
Hi Ben,

> I personally don't mind the bug much and would rather have the dialog + the 
bug
> than have neither. Perhaps just change the default setting under Linux to be 
off?

Sorry - I don't thinkg we have time to change this again before 1.1 GA

The exception might have been masking something more nasty and it's not a 
great idea for us to ship code that puts caught exceptions in the .log file, 
so what I did for Linux is make the default "don't prompt" but also disabled 
the ability to set it.
Right after drop however you can visit the JavaBean in the property sheet and 
change the "fieldName" property which allows you to set a new name.  It isn't 
as nice as the prompt on drop but it works.  Another option is to use 
the "Choose Bean" dialog from the palette (or toolbar) and on that you can 
search for the class to drop by name and also enter the field name right there 
on the dialog - JRW

Comment 8 Srimanth CLA 2005-08-05 13:24:42 EDT
*** Bug 105695 has been marked as a duplicate of this bug. ***
Comment 9 Srimanth CLA 2005-08-05 13:25:33 EDT
Would be nice to enable this for linux instead of disabling it in PS.
Comment 10 Peter Walker CLA 2005-08-05 13:40:21 EDT
I think you meant 1.1.0.1 as the target... not 1.0.1.1
Comment 11 Peter Walker CLA 2005-08-12 15:22:34 EDT
For TVT purposes, this shouldn't be a problem since you can verify the
properties are translated on a Windows system. The same properties files are
used on Linux.

We plan to fix this for 1.1.0.1 so the users on Linux will have this capability.
Comment 12 Peter Walker CLA 2005-08-15 11:51:55 EDT
This is a dup of a GEF bug which is supposed to be fixed in 3.1.1. For now we'll
have to leave the function (prompt when dropping a bean) disabled on Linux.

*** This bug has been marked as a duplicate of 96108 ***
Comment 13 Richard Kulp CLA 2006-04-07 13:44:38 EDT
closing