Ticket #6361 (closed defect: fixed)

Bug contains 1 commit(s) | SVN Diffs for #6361

 

Opened 2 years ago

Last modified 1 year ago

Invalid behiavour in MessageFormat for null values

Reported by: tisler@... Assigned to: yoshito
Priority: minor Milestone: 4.1.2
Component: formatting Version: 3.8
Keywords: Cc:
Load: Xref:
Java Version: jdk1.4 Operating System: windows xp/vista
Project (C/J): ICU4J Weeks: 0.1
Review: doug

Description

There is problem with message format:

with code:

 Object[] args = new Object[] {null};
    System.out.println(java.text.MessageFormat.format("java.text: {0, date, dd.MM.yyyy};{0}", args));
    System.out.println(com.ibm.icu.text.MessageFormat.format("ibm.icu: {0, date, dd.MM.yyyy};{0}", args));

I will get results

java.text: null;null
ibm.icu: {0};{0}

i.e. icu format handles differently null values, in my opinion in wrong way ... in javadoc for icu.MessageFormat is sentence: An argument is unavailable if arguments is null or has fewer than argumentIndex+1 elements. But in this case argument is aviable, only its value is null ...

Attachments

Change History

06/18/08 04:07:36 changed by tisler@...

Affected versions are 3.8, 3.8.1, 4.0.d02.

06/18/08 06:21:12 changed by yoshito

  • owner changed from somebody to yoshito.
  • weeks changed.
  • xref changed.
  • revw changed.

07/10/08 14:52:16 changed by yoshito

  • priority changed from major to minor.
  • milestone changed from UNSCH to 4.2.

10/06/08 21:20:11 changed by yoshito

  • weeks set to 0.1.
  • revw set to doug.
  • milestone changed from 4.2 to 4.1.2.

01/14/09 11:36:16 changed by doug

  • status changed from new to closed.
  • resolution set to fixed.

Add/Change #6361 (Invalid behiavour in MessageFormat for null values)




Anti spam check: