Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 280268 - In Table Data Editor, after deleting a row and using context menu on table header, to edit a cell, throws NPE
Summary: In Table Data Editor, after deleting a row and using context menu on table he...
Status: RESOLVED FIXED
Alias: None
Product: Data Tools
Classification: Tools
Component: Table Data Editor (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 1.9   Edit
Assignee: Brian Payton CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-15 08:54 EDT by Ivar Meikas CLA
Modified: 2012-08-10 16:30 EDT (History)
2 users (show)

See Also:
bpayton: iplog+


Attachments
Patch with defensive programming (2.68 KB, patch)
2009-06-15 08:54 EDT, Ivar Meikas CLA
no flags Details | Diff
Patch for plugin o.e.d.sqltools.data.ui (3.37 KB, patch)
2010-10-25 17:42 EDT, Brian Payton CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ivar Meikas CLA 2009-06-15 08:54:10 EDT
Created attachment 139168 [details]
Patch with defensive programming

In Mac after deleting a row (removes selection from table) you can get a context menu from table header. The menu doesn't know that there is no selection and allows to set the cell value to null and also edit it.

I created a patch that adds some defensive programming.
Comment 1 Brian Payton CLA 2009-07-30 19:48:22 EDT
Hi Quy, please evaluate the patch.
Comment 2 Quy V. On CLA 2009-07-31 16:17:11 EDT
Hi Brian,

The patch is fine.
Comment 3 Ahti Kitsik CLA 2009-08-24 11:53:34 EDT
Hi, is this patch already committed to HEAD?
Comment 4 Ahti Kitsik CLA 2009-11-03 14:15:57 EST
Any update on this?
Comment 5 Brian Payton CLA 2010-10-25 17:41:37 EDT
The patch didn't apply, since it also included a change done with bug 279786.  
I am attaching an updated patch.  I rewrote the other changes to avoid early exits.
Comment 6 Brian Payton CLA 2010-10-25 17:42:10 EDT
Created attachment 181684 [details]
Patch for plugin o.e.d.sqltools.data.ui
Comment 7 Brian Payton CLA 2010-10-25 18:08:07 EDT
With the patch, the "Edit Value" action on the header now does nothing when there is no selected row.  However, you can still do a "Set Null" action.  The table editor inserts a new row in that case.  That appears to be a feature.
Comment 8 Brian Payton CLA 2010-10-25 18:20:01 EDT
Checked in fix, tagged to v201010260615 in HEAD (DTP 1.9).

Let me know if this fix needs to be applied to the DTP 1.8.2 stream.