Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329838 - [KeyBindings] Exporting key preferences to CSV does not allow context being null
Summary: [KeyBindings] Exporting key preferences to CSV does not allow context being null
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.6.2   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 295557
Blocks:
  Show dependency tree
 
Reported: 2010-11-09 13:03 EST by Paul Webster CLA
Modified: 2011-01-20 12:30 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Webster CLA 2010-11-09 13:03:23 EST
+++ This bug was initially created as a clone of Bug #295557 +++

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.15) Gecko/2009101601 Firefox/3.0.15 (.NET CLR 3.5.30729)
Build Identifier: M20090917-0800

When exporting key preferences to CSV a NPE occurs when the context of one of the keys is null. 
The context being null is already considered for instance within BindingElementLabelProvider:

ModelElement context = bindingElement.getContext();
return context == null ? Util.ZERO_LENGTH_STRING : context.getName();

In the same way it should be considered within KeyController, where the NPE comes from:

buffer.append(ESCAPED_QUOTE + be.getContext().getName() + ESCAPED_QUOTE);


Reproducible: Always

Steps to Reproduce:
1. Only happens, when a key is listed without context
2. Could not reproduce with plain eclipse, because there is no key without context listet by default
Comment 1 Paul Webster CLA 2010-11-09 13:04:15 EST
Boris, this is a safe fix that should go in 3.6.2.  Could I get a +1?

PW
Comment 2 Boris Bokowski CLA 2010-11-15 10:09:38 EST
+1 for 3.6.2.
Comment 3 Paul Webster CLA 2010-11-15 11:00:39 EST
released for 3.6.2
Comment 4 Paul Webster CLA 2011-01-20 12:30:37 EST
In M20110119-0834
PW