Bug 121110 - [DataBinding] null value for model-side Date property causes NPE
Summary: [DataBinding] null value for model-side Date property causes NPE
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M6   Edit
Assignee: Matthew Hall CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2005-12-15 15:09 EST by Boris Bokowski CLA
Modified: 2009-04-28 19:07 EDT (History)
2 users (show)

See Also:


Attachments
Patch with test (2.98 KB, patch)
2009-01-26 13:21 EST, Matthew Hall CLA
no flags Details | Diff
mylyn/context/zip (2.75 KB, application/octet-stream)
2009-01-26 13:21 EST, Matthew Hall CLA
no flags Details
Same patch (can't remember if I changed anything, but just in case) (2.98 KB, patch)
2009-01-26 16:27 EST, Matthew Hall CLA
no flags Details | Diff
mylyn/context/zip (1.56 KB, application/octet-stream)
2009-01-26 16:27 EST, Matthew Hall CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Boris Bokowski CLA 2005-12-15 15:09:20 EST
java.lang.NullPointerException
	at java.util.Calendar.setTime(Unknown Source)
	at java.text.SimpleDateFormat.format(Unknown Source)
	at java.text.SimpleDateFormat.format(Unknown Source)
	at java.text.DateFormat.format(Unknown Source)
	at org.eclipse.jface.databinding.converterfunctions.DateConversionSupport.format(DateConversionSupport.java:91)
	at org.eclipse.jface.databinding.converterfunctions.DateConversionSupport.format(DateConversionSupport.java:86)
	at org.eclipse.jface.databinding.converterfunctions.ConvertDate2String.convert(ConvertDate2String.java:26)
	at org.eclipse.jface.databinding.converters.FunctionalConverter.convertModelToTarget(FunctionalConverter.java:42)
	at org.eclipse.jface.databinding.internal.ValueBinding.updateTargetFromModel(ValueBinding.java:144)
	at org.eclipse.jface.databinding.internal.DataBindingContext.bind(DataBindingContext.java:341)
	at org.eclipse.jface.databinding.internal.DataBindingContext.bind(DataBindingContext.java:375)
	at org.eclipse.jface.databinding.internal.DataBindingContext.bind(DataBindingContext.java:432)
	at org.eclipse.ui.examples.rcp.binding.scenarios.NullBinding.createLabelAndText(NullBinding.java:133)
	at org.eclipse.ui.examples.rcp.binding.scenarios.NullBinding.createGroup(NullBinding.java:119)
	at org.eclipse.ui.examples.rcp.binding.scenarios.NullBinding.initialize(NullBinding.java:94)
	at org.eclipse.ui.examples.rcp.binding.scenarios.NullBinding.<init>(NullBinding.java:82)
	... 8 more
Comment 1 Boris Bokowski CLA 2007-06-26 14:06:53 EDT
Not sure if this is still a problem.
Comment 2 Matthew Hall CLA 2009-01-21 22:10:12 EST
This bug is still relevant.  DateConversionSupport attempts to format a Date into a String without checking whether the Date is null
Comment 3 Boris Bokowski CLA 2009-01-22 00:08:00 EST
I hope you don't mind that I assign this bug to you.
Comment 4 Matthew Hall CLA 2009-01-22 10:59:04 EST
sure
Comment 5 Matthew Hall CLA 2009-01-26 13:21:39 EST
Created attachment 123783 [details]
Patch with test

Boris, +1 for M5?
Comment 6 Matthew Hall CLA 2009-01-26 13:21:43 EST
Created attachment 123784 [details]
mylyn/context/zip
Comment 7 Boris Bokowski CLA 2009-01-26 13:30:00 EST
Given the low traffic on this bug, I would vote for fixing this in M6 rather than M5.
Comment 8 Matthew Hall CLA 2009-01-26 13:38:35 EST
What is the value you would expect to have returned when DateFormatSupport.format(Date) is called with a null argument?  Null or empty string?
Comment 9 Matthew Hall CLA 2009-01-26 16:27:39 EST
Created attachment 123812 [details]
Same patch (can't remember if I changed anything, but just in case)
Comment 10 Matthew Hall CLA 2009-01-26 16:27:41 EST
Created attachment 123813 [details]
mylyn/context/zip
Comment 11 Matthew Hall CLA 2009-02-16 19:43:58 EST
Released to HEAD > 20090216
Comment 12 Matthew Hall CLA 2009-04-28 19:07:57 EDT
Verified in I20090428-0100