Bug 118736 - Fix some NSDictionary misuse pointed out by the clang static analyzer
Summary: Fix some NSDictionary misuse pointed out by the clang static analyzer
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jessie Berlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-16 09:16 PDT by Jessie Berlin
Modified: 2013-07-16 11:03 PDT (History)
2 users (show)

See Also:


Attachments
Patch (5.56 KB, patch)
2013-07-16 09:52 PDT, Jessie Berlin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jessie Berlin 2013-07-16 09:16:50 PDT
When I run the clang static analyzer against ToT (152721), it points out some places where WebKit and WebKit2 are misusing NSDictionary. We should fix that.
Comment 1 Jessie Berlin 2013-07-16 09:52:01 PDT
Created attachment 206791 [details]
Patch
Comment 2 Anders Carlsson 2013-07-16 10:20:33 PDT
Comment on attachment 206791 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=206791&action=review

> Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm:380
>      NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: excludedElements, NSExcludedElementsDocumentAttribute, 

Seems like this can just use dictionaryWithObject:forKey:

> Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:114
> -        NSExcludedElementsDocumentAttribute, nil, @"WebResourceHandler", nil];
> +        NSExcludedElementsDocumentAttribute, nil];

Ditto.
Comment 3 Jessie Berlin 2013-07-16 10:49:24 PDT
(In reply to comment #2)
> (From update of attachment 206791 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=206791&action=review
> 
> > Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm:380
> >      NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: excludedElements, NSExcludedElementsDocumentAttribute, 
> 
> Seems like this can just use dictionaryWithObject:forKey:

Heh, yes. Done.

> 
> > Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:114
> > -        NSExcludedElementsDocumentAttribute, nil, @"WebResourceHandler", nil];
> > +        NSExcludedElementsDocumentAttribute, nil];
> 
> Ditto.

Done.

Thanks for the review!
Comment 4 Jessie Berlin 2013-07-16 11:03:33 PDT
Comment on attachment 206791 [details]
Patch

Committed in http://trac.webkit.org/changeset/152730