Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 323893 - NullPointerException is thrown when entity is renamed
Summary: NullPointerException is thrown when entity is renamed
Status: CLOSED WORKSFORME
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: Diagram Editor (show other bugs)
Version: 0.5   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 0.5 RC2   Edit
Assignee: Project Inbox CLA
QA Contact: Stefan Dimov CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-28 18:21 EDT by Tuukka Mustonen CLA
Modified: 2011-01-17 07:48 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tuukka Mustonen CLA 2010-08-28 18:21:35 EDT
Steps to reproduce:
1. Install Eclipse Helios (build 20100617-1415). Install Graphiti nightly build (0.7.0.v20100827-0726). Install JPA Diagram Editor (0.5.0.201008131407).
2. Create new JPA project. Select "minimal JPA 1.0 configuration". Pick some implementation library.
3. Open JPA Diagram.
4. Drag-drop entity into diagram and try to rename it. If you don't change the name, no error is thrown, but if you give entity a new name, a NullPointerException is thrown.

Here's trace:

!ENTRY org.eclipse.jface 4 2 2010-08-29 01:19:24.155
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.jpt.ui.diagrameditor.util.JPAEditorUtil.isEntityOpenElsewhere(JPAEditorUtil.java:1055)
	at org.eclipse.jpt.ui.diagrameditor.util.JPASolver.restoreEntity(JPASolver.java:945)
	at org.eclipse.jpt.ui.diagrameditor.provider.JPAEditorFeatureProvider.restoreEntity(JPAEditorFeatureProvider.java:467)
	at org.eclipse.jpt.ui.diagrameditor.util.JpaArtifactFactory.restoreEntityClass(JpaArtifactFactory.java:241)
	at org.eclipse.jpt.ui.diagrameditor.feature.RestoreEntityFeature.execute(RestoreEntityFeature.java:38)
	at org.eclipse.jpt.ui.diagrameditor.feature.RemoveJPAEntityFeature.preRemove(RemoveJPAEntityFeature.java:63)
	at org.eclipse.graphiti.features.impl.DefaultRemoveFeature.remove(DefaultRemoveFeature.java:59)
	at org.eclipse.jpt.ui.diagrameditor.feature.RefactorEntityFeature$3.run(RefactorEntityFeature.java:207)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jpt.ui.diagrameditor.feature.RefactorEntityFeature.remapEntity(RefactorEntityFeature.java:165)
	at org.eclipse.jpt.ui.diagrameditor.feature.RefactorEntityFeature$2.doExecute(RefactorEntityFeature.java:155)
	at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
	at org.eclipse.emf.workspace.EMFCommandOperation.doExecute(EMFCommandOperation.java:119)
	at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
	at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:511)
	at org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl.doExecute(WorkspaceCommandStackImpl.java:208)
	at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
	at org.eclipse.graphiti.ui.internal.editor.GFWorkspaceCommandStackImpl.execute(GFWorkspaceCommandStackImpl.java:47)
	at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:219)
	at org.eclipse.graphiti.ui.internal.editor.GFWorkspaceCommandStackImpl.execute(GFWorkspaceCommandStackImpl.java:39)
	at org.eclipse.jpt.ui.diagrameditor.feature.RefactorEntityFeature.execute(RefactorEntityFeature.java:153)
	at org.eclipse.jpt.ui.diagrameditor.feature.RenameEntityWithoutUIFeature.execute(RenameEntityWithoutUIFeature.java:38)
	at org.eclipse.jpt.ui.diagrameditor.feature.DirectEditJPAEntityFeature.setValue(DirectEditJPAEntityFeature.java:102)
	at org.eclipse.graphiti.internal.command.DirectEditingFeatureCommandWithContext.execute(DirectEditingFeatureCommandWithContext.java:73)
	at org.eclipse.graphiti.ui.internal.command.GefCommandWrapper.execute(GefCommandWrapper.java:51)
	at org.eclipse.gef.commands.CommandStack.execute(CommandStack.java:197)
	at org.eclipse.graphiti.ui.internal.policy.DefaultDirectEditPolicy.getDirectEditCommand(DefaultDirectEditPolicy.java:110)
	at org.eclipse.gef.editpolicies.DirectEditPolicy.getCommand(DirectEditPolicy.java:59)
	at org.eclipse.gef.editparts.AbstractEditPart.getCommand(AbstractEditPart.java:501)
	at org.eclipse.gef.tools.DirectEditManager.commit(DirectEditManager.java:144)
	at org.eclipse.gef.tools.DirectEditManager$4.applyEditorValue(DirectEditManager.java:291)
	at org.eclipse.jface.viewers.CellEditor$1.run(CellEditor.java:333)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
	at org.eclipse.jface.viewers.CellEditor.fireApplyEditorValue(CellEditor.java:331)
	at org.eclipse.jface.viewers.TextCellEditor.handleDefaultSelection(TextCellEditor.java:293)
	at org.eclipse.graphiti.ui.internal.parts.directedit.TextCellEditor.access$0(TextCellEditor.java:1)
	at org.eclipse.graphiti.ui.internal.parts.directedit.TextCellEditor$1.widgetDefaultSelected(TextCellEditor.java:119)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:119)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	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:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)

!ENTRY org.eclipse.core.resources 4 368 2010-08-29 01:19:24.185
!MESSAGE Resource '/rtyrut/src/org/persistence/Entity1.java' does not exist.
Comment 1 Petya Sabeva CLA 2010-08-31 07:29:00 EDT
I cannot reproduce this issue.
Comment 2 Tuukka Mustonen CLA 2010-08-31 14:28:34 EDT
(In reply to comment #1)
> I cannot reproduce this issue.

Hmm, I will check this again on fresh instance when I have time.
Comment 3 Tuukka Mustonen CLA 2010-08-31 16:29:31 EDT
(In reply to comment #2)
> (In reply to comment #1)
> > I cannot reproduce this issue.
> 
> Hmm, I will check this again on fresh instance when I have time.

I couldn't reproduce this myself. No idea why it failed before as I also tested this on the very same instance and workspace as before. Probably there was just some... thing.
Comment 4 Kaloyan Raev CLA 2010-09-01 02:06:52 EDT
Just for the correct bookkeeping, I am changing the close status from INVALID to WORKSFORME. 

INVALID stands for "not a bug", while WORKSFORME - for "not reproducible bug". My understanding is that in this case we have a valid bug (NPE in the JPA Editor), which we cannot reproduce.
Comment 5 Tuukka Mustonen CLA 2010-09-01 02:50:57 EDT
Kaloyan, you are right (of course). Still trying to learn all the bells and whistles :)
Comment 6 Stefan Dimov CLA 2010-09-01 04:36:18 EDT
:)