bugGNUstep - Bugs: bug #52011, Remove incorrect init from...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #52011: Remove incorrect init from NSDateFormatter, and fix call to udat_open

Submitted by:  David Lobron <dlobron>
Submitted on:  Wed 13 Sep 2017 04:54:48 PM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Confirmed
Privacy: PublicAssigned to: Stef <stefanbidi>
Open/Closed: Open

Wed 13 Sep 2017 05:14:28 PM UTC, comment #2:

I've attached a test program that tests both bugs. The first test passes when the extra code is removed from [NSDateFormatter init]. The second passes when the call to udat_open is fixed.

David Lobron <dlobron>
Wed 13 Sep 2017 04:57:54 PM UTC, comment #1:

A few more data points:

- This bug revealed itself on my system only when I switched from libicu version 52 to version 55.

- The test cases I used that triggered the bug work correctly on Mac OSX.

- The proposed patch does not break the existing NSDateFormatter test in the gnustep-base test suite.

David Lobron <dlobron>
Wed 13 Sep 2017 04:54:48 PM UTC, original submission:

In NSDateFormatter.m, the [NSDateFormatter init] method has code that is called when GS_USE_ICU is enabled. When run on GNU/Linux (Ubuntu 3.13.0-113-generic), I found that it causes NSDateFormatter to have an invalid initial dateFormat. On an Apple system, the initial dateFormat is nil, and that seems correct for Linux also. I propose removing this code, which is at NSDateFormatter.m:113-148 in my source.

Also, the call to udat_open should pass UDAT_PATTERN for the first two arguments, if the pattern argument is unused. That is the usage described in the doc, and I verified that this change fixes another bug I observed. The doc is here:

http://www.icu-project.org/apiref/icu4c/udat_8h.html#a4261e9fd5382197c3d86a00211c48079

I've attached a diff with both changes.

David Lobron <dlobron>

 

Attached Files
file #41797:  icutest.m added by dlobron (1KiB - application/octet-stream - Test program that passes with the proposed changes and libicu v55)
file #41796:  NSDateFormatter.m.patch added by dlobron (2KiB - application/octet-stream - Suggested patch file, based on 1.24.9)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by stefanbidi (Updated the item)
  • -unavailable- added by dlobron (Submitted the item)
  • -unavailable- added by dlobron
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 16 Sep 2017 04:31:07 PM UTCstefanbidiStatusNone=>Confirmed
      Assigned toNone=>stefanbidi
    Wed 13 Sep 2017 05:13:35 PM UTCdlobronAttached File-=>Added icutest.m, #41797
    Wed 13 Sep 2017 04:54:48 PM UTCdlobronAttached File-=>Added NSDateFormatter.m.patch, #41796
      Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1