Skip to content

Cleaned up some warnings from the static analyzer #122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 28, 2015

Conversation

gonzalonunez
Copy link
Contributor

Fixes #121

@@ -638,7 +638,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@param objects The list of objects to fetch.
@param error Pointer to an `NSError` that will be set if necessary.
*/
+ (void)fetchAllIfNeeded:(PF_NULLABLE NSArray *)objects error:(NSError **)error;
+ (instancetype)fetchAllIfNeeded:(PF_NULLABLE NSArray *)objects error:(NSError **)error;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one should have an NSArray return type, since the block has an NSArray as a result.

@@ -1110,7 +1110,7 @@ - (void)mergeFromRESTDictionary:(NSDictionary *)object withDecoder:(PFDecoder *)
if (localOperationSet.updatedAt != nil &&
[localOperationSet.updatedAt compare:remoteOperationSet.updatedAt] != NSOrderedAscending) {
[localOperationSet mergeOperationSet:remoteOperationSet];
} else {
} else if (remoteOperationSet) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is actually very tricky, since remoteOperationSet should always be here, according to the logic above.
Maybe replace it with PFConsistencyAssert with a useful error message?
I just checked locally - it actually supresses the analyzer warning if you have an assert here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I wasn't too sure about that either. I'll go ahead and do that instead!

@nlutsenko nlutsenko added this to the 1.8.3 milestone Aug 27, 2015
@nlutsenko
Copy link
Contributor

@gonzalonunez, almost there...
Please fix inconsistency in return types between header and implementation files (that's what fails travis)

@gonzalonunez
Copy link
Contributor Author

Should've fixed it all. Waiting to make sure Travis doesn't fail.

@gonzalonunez
Copy link
Contributor Author

Seems to be missing something. Checking over it now.

@nlutsenko
Copy link
Contributor

Looks like it's related to refresh methods signature.

@nlutsenko
Copy link
Contributor

Ow, right... Those methods are declared also in PFObjectPrivate.h - that's what is missing.

@gonzalonunez
Copy link
Contributor Author

Ah, great catch. I'll go ahead and change those now. Thanks for the tip, would've taken me all night! Lol

@@ -1111,6 +1111,7 @@ - (void)mergeFromRESTDictionary:(NSDictionary *)object withDecoder:(PFDecoder *)
[localOperationSet.updatedAt compare:remoteOperationSet.updatedAt] != NSOrderedAscending) {
[localOperationSet mergeOperationSet:remoteOperationSet];
} else {
PFConsistencyAssert(remoteOperationSet, @"'remoteOperationSet' should not be nil.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<3

@nlutsenko
Copy link
Contributor

@gonzalonunez, almost there, a single change around fetch method in PFUser and we are good to go.

@gonzalonunez
Copy link
Contributor Author

Fixed the issue in PFUser.m and squashed the commits 🙌

@nlutsenko
Copy link
Contributor

Looks perfect! Merging now!

nlutsenko added a commit that referenced this pull request Aug 28, 2015
Cleaned up some warnings from the static analyzer
@nlutsenko nlutsenko merged commit cb682bc into parse-community:master Aug 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants