Skip to content

Commit

Permalink
Use consistent initialization to keep analyzer happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
radiantcapsule committed Sep 5, 2011
1 parent ab1e0af commit 320abe4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
12 changes: 4 additions & 8 deletions OAMutableURLRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,10 @@ - (id)initWithURL:(NSURL *)aUrl
signatureProvider:(id<OASignatureProviding>)aProvider
nonce:(NSString *)aNonce
timestamp:(NSString *)aTimestamp {
[self initWithURL:aUrl
consumer:aConsumer
token:aToken
realm:aRealm
signatureProvider:aProvider];

nonce = [aNonce copy];
timestamp = [aTimestamp copy];
if ((self = [self initWithURL:aUrl consumer:aConsumer token:aToken realm:aRealm signatureProvider:aProvider])) {
nonce = [aNonce copy];
timestamp = [aTimestamp copy];
}

return self;
}
Expand Down
27 changes: 14 additions & 13 deletions OAToken.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,20 @@ - (id)initWithHTTPResponseBody:(const NSString *)body {
}

- (id)initWithUserDefaultsUsingServiceProviderName:(const NSString *)provider prefix:(const NSString *)prefix {
[super init];
self.key = [OAToken loadSetting:@"key" provider:provider prefix:prefix];
self.secret = [OAToken loadSetting:@"secret" provider:provider prefix:prefix];
self.session = [OAToken loadSetting:@"session" provider:provider prefix:prefix];
self.duration = [OAToken loadSetting:@"duration" provider:provider prefix:prefix];
self.attributes = [OAToken loadSetting:@"attributes" provider:provider prefix:prefix];
created = [OAToken loadSetting:@"created" provider:provider prefix:prefix];
renewable = [[OAToken loadSetting:@"renewable" provider:provider prefix:prefix] boolValue];

if (![self isValid]) {
[self autorelease];
return nil;
}
if ((self = [super init])) {
self.key = [OAToken loadSetting:@"key" provider:provider prefix:prefix];
self.secret = [OAToken loadSetting:@"secret" provider:provider prefix:prefix];
self.session = [OAToken loadSetting:@"session" provider:provider prefix:prefix];
self.duration = [OAToken loadSetting:@"duration" provider:provider prefix:prefix];
self.attributes = [OAToken loadSetting:@"attributes" provider:provider prefix:prefix];
created = [OAToken loadSetting:@"created" provider:provider prefix:prefix];
renewable = [[OAToken loadSetting:@"renewable" provider:provider prefix:prefix] boolValue];

if (![self isValid]) {
[self autorelease];
return nil;
}
}

return self;
}
Expand Down

0 comments on commit 320abe4

Please sign in to comment.