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

Bug 329838

Summary: [KeyBindings] Exporting key preferences to CSV does not allow context being null
Product: [Eclipse Project] Platform Reporter: Paul Webster <pwebster>
Component: UIAssignee: Paul Webster <pwebster>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bokowski, caroline.rieder, mattias.mohlin, mober.at+eclipse, remy.suen
Version: 3.5.1   
Target Milestone: 3.6.2   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 295557    
Bug Blocks:    

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