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

 
 

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

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

Submitted by:  Larry Campbell <lcampbel>
Submitted on:  Fri 09 Dec 2005 08:33:40 PM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Invalid
Privacy: PublicAssigned to: None
Open/Closed: Closed

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>
Project 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>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

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 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sat 10 Dec 2005 07:14:51 AM UTCCaSStatusNone=>Invalid
  Open/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1