Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 121110 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/core/internal/databinding/conversion/DateConversionSupport.java (-2 / +5 lines)
Lines 1-4 Link Here
1
/*
1
/*******************************************************************************
2
 * Copyright (C) 2005 db4objects Inc.  http://www.db4o.com
2
 * Copyright (C) 2005 db4objects Inc.  http://www.db4o.com
3
 *
3
 *
4
 * All rights reserved. This program and the accompanying materials
4
 * All rights reserved. This program and the accompanying materials
Lines 9-15 Link Here
9
 * Contributors:
9
 * Contributors:
10
 *     db4objects - Initial API and implementation
10
 *     db4objects - Initial API and implementation
11
 *     Tom Schindl<tom.schindl@bestsolution.at> - bugfix for 217940
11
 *     Tom Schindl<tom.schindl@bestsolution.at> - bugfix for 217940
12
 */
12
 *     Matthew Hall - bug 121110
13
 ******************************************************************************/
13
package org.eclipse.core.internal.databinding.conversion;
14
package org.eclipse.core.internal.databinding.conversion;
14
15
15
import java.text.ParsePosition;
16
import java.text.ParsePosition;
Lines 99-104 Link Here
99
	}
100
	}
100
101
101
	protected String format(Date date,int formatterIdx) {
102
	protected String format(Date date,int formatterIdx) {
103
		if (date == null)
104
			return null;
102
		if(formatterIdx>=0) {
105
		if(formatterIdx>=0) {
103
			return formatters[formatterIdx].format(date);
106
			return formatters[formatterIdx].format(date);
104
		}
107
		}
(-)src/org/eclipse/core/tests/internal/databinding/conversion/DateConversionSupportTest.java (+12 lines)
Lines 7-16 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Matthew Hall - bug 121110
10
 ******************************************************************************/
11
 ******************************************************************************/
11
12
12
package org.eclipse.core.tests.internal.databinding.conversion;
13
package org.eclipse.core.tests.internal.databinding.conversion;
13
14
15
import java.util.Date;
16
14
import junit.framework.TestCase;
17
import junit.framework.TestCase;
15
18
16
import org.eclipse.core.internal.databinding.BindingMessages;
19
import org.eclipse.core.internal.databinding.BindingMessages;
Lines 43-51 Link Here
43
		assertEquals(format, dateFormat.toPattern());
46
		assertEquals(format, dateFormat.toPattern());
44
	}
47
	}
45
	
48
	
49
	public void testFormat_NullDate() {
50
		StubConverter stub = new StubConverter();
51
		assertNull(stub.format(null));
52
	}
53
	
46
	static class StubConverter extends DateConversionSupport {
54
	static class StubConverter extends DateConversionSupport {
47
		protected DateFormat getDateFormat(int index) {
55
		protected DateFormat getDateFormat(int index) {
48
			return super.getDateFormat(index);
56
			return super.getDateFormat(index);
49
		}
57
		}
58
		
59
		protected String format(Date date) {
60
			return super.format(date);
61
		}
50
	}
62
	}
51
}
63
}

Return to bug 121110