bugGNUstep - Bugs: bug #15177, -[GSMutableSet copyWithZone:]...

Group
 
 

bug #15177: -[GSMutableSet copyWithZone:] produces an immutable set

Submitter:  Larry Campbell <lcampbel>
Submitted:  Fri 09 Dec 2005 08:33:40 PM UTC
   
 
Category:  Base/Foundation Severity:  3 - Normal
Item Group:  Bug Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 10 Dec 2005 07:16:54 PM UTC, comment #2: 

You're right; I was misled by the fact that Apple's -[NSMutableSet copyWithZone:] method returns an NSMutableSet, a bug even according to Apple's documentation.

Larry Campbell <lcampbel>
Sat 10 Dec 2005 07:14:51 AM UTC, comment #1: 

copyWithZone: should produce an immutable object.
ifg you want a mutable object, use a mutableCopyWithZone:

Richard Frith-Macdonald <CaS>
Group Member
Fri 09 Dec 2005 08:33:40 PM UTC, original submission:  

/* Override version from GSSet */
- (id) copyWithZone: (NSZone*)z
{
  NSSet *copy = [setClass allocWithZone: z];

  return [copy initWithSet: self copyItems: NO];
}


This is incorrect. It should be:


/* Override version from GSSet */
- (id) copyWithZone: (NSZone*)z
{
  NSSet *copy = [mutableSetClass allocWithZone: z];

  return [copy initWithSet: self copyItems: NO];
}

Larry Campbell <lcampbel>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-12-10 CaS StatusNone Invalid
    Open/ClosedOpen Closed

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code