Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use consistent initialization to keep analyzer happy.

  • Loading branch information...
commit 320abe408b6b97d68ec802abee8219ced111552b 1 parent ab1e0af
@radiantcapsule radiantcapsule authored
Showing with 18 additions and 21 deletions.
  1. +4 −8 OAMutableURLRequest.m
  2. +14 −13 OAToken.m
View
12 OAMutableURLRequest.m
@@ -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;
}
View
27 OAToken.m
@@ -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;
}

0 comments on commit 320abe4

Please sign in to comment.
Something went wrong with that request. Please try again.