From ce34dcb695e4d30ba9453794397b0cc6cbbc2b50 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Wed, 24 Oct 2018 15:16:54 -0700 Subject: [PATCH] Format everything Reviewed By: jeremydubreil Differential Revision: D10844347 fbshipit-source-id: 5a374da82 --- dependencies/java/jackson/BUCK | 2 +- dependencies/ocamldot/ocamldot.mll | 2 +- .../java/src/android/app/AlarmManager.java | 1 - .../src/android/database/CursorWrapper.java | 1 - .../models/java/src/java/util/ArrayList.java | 1 - infer/models/java/src/java/util/List.java | 1 - .../org/assertj/core/util/Preconditions.java | 1 - infer/models/objc/src/NSRunLoop.m | 15 ++++---- .../componentkit/TestComponentKitAnalytics.mm | 2 +- .../componentkit/TestIgnoreImports.mm | 2 +- .../codetoanalyze/linters/src/main.mm | 2 +- .../java/infer/IntegerExample.java | 1 - .../java/racerd/RaceWithMainThread.java | 4 +- .../java/starvation/InnerClass.java | 1 - .../codetoanalyze/java/starvation/issues.exp | 4 +- .../CADisplayLinkRetainCycle.m | 7 ++-- .../resource_leaks/ResourceLeakExample.m | 5 ++- .../objc/errors/taint/viewController.m | 7 ++-- .../objc/frontend/boxing/dict_literal.c | 2 +- .../ioslints/unavailable_api_allowed_cases.m | 37 ++++++++----------- .../codetoanalyze/objc/linters/atomic_prop.m | 3 +- .../codetoanalyze/objc/linters/badpointer.m | 6 +-- .../TollBridgeExample.m | 2 +- .../componentkit/MultipleFactoryMethodsTest.h | 4 +- .../componentkit/MutableLocalVariablesTest.mm | 2 +- 25 files changed, 52 insertions(+), 63 deletions(-) diff --git a/dependencies/java/jackson/BUCK b/dependencies/java/jackson/BUCK index 2a27c2035..16b9c80c2 100644 --- a/dependencies/java/jackson/BUCK +++ b/dependencies/java/jackson/BUCK @@ -4,7 +4,7 @@ prebuilt_jar( deps = [ '//dependencies/java/guava:guava', ], - visibility = [ + visibility = [ 'PUBLIC', ] ) diff --git a/dependencies/ocamldot/ocamldot.mll b/dependencies/ocamldot/ocamldot.mll index 524e2829f..5b1f4b8c6 100644 --- a/dependencies/ocamldot/ocamldot.mll +++ b/dependencies/ocamldot/ocamldot.mll @@ -412,7 +412,7 @@ begin roots; print_string " };\n"; (* Find the graph reachable from the roots *) - let tcGraph = tc graph in + let tcGraph = tc graph in let reachable node = (List.exists (fun r -> r=node) roots) || diff --git a/infer/models/java/src/android/app/AlarmManager.java b/infer/models/java/src/android/app/AlarmManager.java index 984bdb975..183d53810 100644 --- a/infer/models/java/src/android/app/AlarmManager.java +++ b/infer/models/java/src/android/app/AlarmManager.java @@ -7,7 +7,6 @@ package android.app; - public abstract class AlarmManager { void cancel(PendingIntent operation) { diff --git a/infer/models/java/src/android/database/CursorWrapper.java b/infer/models/java/src/android/database/CursorWrapper.java index 8eec33a5e..64e5813a0 100644 --- a/infer/models/java/src/android/database/CursorWrapper.java +++ b/infer/models/java/src/android/database/CursorWrapper.java @@ -7,7 +7,6 @@ package android.database; - import java.io.IOException; public class CursorWrapper implements Cursor { diff --git a/infer/models/java/src/java/util/ArrayList.java b/infer/models/java/src/java/util/ArrayList.java index d1fd8d8b8..715e08ce7 100644 --- a/infer/models/java/src/java/util/ArrayList.java +++ b/infer/models/java/src/java/util/ArrayList.java @@ -7,7 +7,6 @@ package java.util; - // abstract so we don't have to implement every method of List public abstract class ArrayList extends AbstractList { diff --git a/infer/models/java/src/java/util/List.java b/infer/models/java/src/java/util/List.java index b333dccd2..bcbba66b1 100644 --- a/infer/models/java/src/java/util/List.java +++ b/infer/models/java/src/java/util/List.java @@ -7,7 +7,6 @@ package java.util; - // abstract so we don't have to implement every method of List public abstract class List extends AbstractList { diff --git a/infer/models/java/src/org/assertj/core/util/Preconditions.java b/infer/models/java/src/org/assertj/core/util/Preconditions.java index dffc58572..63c1f3bc5 100644 --- a/infer/models/java/src/org/assertj/core/util/Preconditions.java +++ b/infer/models/java/src/org/assertj/core/util/Preconditions.java @@ -7,7 +7,6 @@ package org.assertj.core.util; - import static com.facebook.infer.builtins.InferBuiltins.assume; public final class Preconditions { diff --git a/infer/models/objc/src/NSRunLoop.m b/infer/models/objc/src/NSRunLoop.m index e23e4136b..0a2c6b259 100644 --- a/infer/models/objc/src/NSRunLoop.m +++ b/infer/models/objc/src/NSRunLoop.m @@ -19,12 +19,11 @@ return [NSRunLoop alloc]; }; -- (void)acceptInputForMode:(NSString*)mode beforeDate:(NSDate*)limit_date{}; - -- (void)addTimer:(NSTimer*)timer - forMode:(NSString*)mode{ +- (void)acceptInputForMode:(NSString*)mode beforeDate:(NSDate*)limit_date { +}; - }; +- (void)addTimer:(NSTimer*)timer forMode:(NSString*)mode { +}; - (NSString*)currentMode { return @""; @@ -35,7 +34,8 @@ return [NSDate alloc]; }; -- (void)run{}; +- (void)run { +}; - (BOOL)runMode:(NSString*)mode beforeDate:(NSDate*)date { @@ -43,6 +43,7 @@ return res; }; -- (void)runUntilDate:(NSDate*)date{}; +- (void)runUntilDate:(NSDate*)date { +}; @end diff --git a/infer/tests/build_systems/codetoanalyze/componentkit/TestComponentKitAnalytics.mm b/infer/tests/build_systems/codetoanalyze/componentkit/TestComponentKitAnalytics.mm index 2d805888b..0edd8a1f5 100644 --- a/infer/tests/build_systems/codetoanalyze/componentkit/TestComponentKitAnalytics.mm +++ b/infer/tests/build_systems/codetoanalyze/componentkit/TestComponentKitAnalytics.mm @@ -10,7 +10,7 @@ @interface SomeClass : CKCompositeComponent @end @implementation SomeClass -+ (instancetype) new { ++ (instancetype)new { if (1 == 3) { return nil; } else if (2 == 4) { diff --git a/infer/tests/build_systems/codetoanalyze/componentkit/TestIgnoreImports.mm b/infer/tests/build_systems/codetoanalyze/componentkit/TestIgnoreImports.mm index 565e1a6cc..651dd3a52 100644 --- a/infer/tests/build_systems/codetoanalyze/componentkit/TestIgnoreImports.mm +++ b/infer/tests/build_systems/codetoanalyze/componentkit/TestIgnoreImports.mm @@ -16,7 +16,7 @@ struct D {}; @interface SomeClass : CKCompositeComponent @end @implementation SomeClass -+ (instancetype) new { ++ (instancetype)new { int i; // error for (int i = 0; i < 10; i++) { // no error diff --git a/infer/tests/build_systems/codetoanalyze/linters/src/main.mm b/infer/tests/build_systems/codetoanalyze/linters/src/main.mm index 13f5a6cf3..47e75fe03 100644 --- a/infer/tests/build_systems/codetoanalyze/linters/src/main.mm +++ b/infer/tests/build_systems/codetoanalyze/linters/src/main.mm @@ -9,7 +9,7 @@ @interface SomeClass : CKCompositeComponent @end @implementation SomeClass -+ (instancetype) new { ++ (instancetype)new { int i; // error return nil; } diff --git a/infer/tests/codetoanalyze/java/infer/IntegerExample.java b/infer/tests/codetoanalyze/java/infer/IntegerExample.java index 267b3f65c..06a5a0efb 100644 --- a/infer/tests/codetoanalyze/java/infer/IntegerExample.java +++ b/infer/tests/codetoanalyze/java/infer/IntegerExample.java @@ -7,7 +7,6 @@ package codetoanalyze.java.infer; - public class IntegerExample { private static void testIntegerEqualsGood() { diff --git a/infer/tests/codetoanalyze/java/racerd/RaceWithMainThread.java b/infer/tests/codetoanalyze/java/racerd/RaceWithMainThread.java index 74ce1c6c9..bb518ae55 100644 --- a/infer/tests/codetoanalyze/java/racerd/RaceWithMainThread.java +++ b/infer/tests/codetoanalyze/java/racerd/RaceWithMainThread.java @@ -115,8 +115,8 @@ class RaceWithMainThread { void conditional1_Ok(boolean b) { if (b) { - /*People not literally putting this assert inside if's, - but implicitly by method calls */ + /*People not literally putting this assert inside if's, + but implicitly by method calls */ OurThreadUtils.assertMainThread(); ff = 88; } diff --git a/infer/tests/codetoanalyze/java/starvation/InnerClass.java b/infer/tests/codetoanalyze/java/starvation/InnerClass.java index b2de9454f..04a7a0a34 100644 --- a/infer/tests/codetoanalyze/java/starvation/InnerClass.java +++ b/infer/tests/codetoanalyze/java/starvation/InnerClass.java @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ - class InnerClass { synchronized void outerInnerOk(InnerClassA a) { a.foo(); diff --git a/infer/tests/codetoanalyze/java/starvation/issues.exp b/infer/tests/codetoanalyze/java/starvation/issues.exp index 5b2ec3335..5deda2515 100644 --- a/infer/tests/codetoanalyze/java/starvation/issues.exp +++ b/infer/tests/codetoanalyze/java/starvation/issues.exp @@ -20,8 +20,8 @@ codetoanalyze/java/starvation/FutureGet.java, FutureGet.getTimeoutOneDayBad():vo codetoanalyze/java/starvation/FutureGet.java, FutureGet.getTimeoutOneHourBad():void, 59, STARVATION, no_bucket, ERROR, [`void FutureGet.getTimeoutOneHourBad()`,calls `Object Future.get(long,TimeUnit)` from `void FutureGet.getTimeoutOneHourBad()`,[Trace on UI thread] `void FutureGet.getTimeoutOneHourBad()`,`void FutureGet.getTimeoutOneHourBad()` is annotated `UiThread`] codetoanalyze/java/starvation/IndirectBlock.java, IndirectBlock.takeExpensiveLockOnUiThreadBad():void, 23, STARVATION, no_bucket, ERROR, [[Trace 1] `void IndirectBlock.takeExpensiveLockOnUiThreadBad()`,locks `this.IndirectBlock.expensiveLock` in class `IndirectBlock*`,[Trace 2] `void IndirectBlock.doTransactUnderLock()`,locks `this.IndirectBlock.expensiveLock` in class `IndirectBlock*`,calls `boolean Binder.transact(int,Parcel,Parcel,int)` from `void IndirectBlock.doTransactUnderLock()`,[Trace 1 on UI thread] `void IndirectBlock.takeExpensiveLockOnUiThreadBad()`,`void IndirectBlock.takeExpensiveLockOnUiThreadBad()` is annotated `UiThread`] codetoanalyze/java/starvation/IndirectBlock.java, IndirectBlock.takeRemoteExpensiveLockOnUiThreadBad(IndirectInterproc):void, 35, STARVATION, no_bucket, ERROR, [[Trace 1] `void IndirectBlock.takeRemoteExpensiveLockOnUiThreadBad(IndirectInterproc)`,Method call: `void IndirectInterproc.takeLock()`,locks `this` in class `IndirectInterproc*`,[Trace 2] `void IndirectInterproc.doTransactUnderLock(Binder)`,locks `this` in class `IndirectInterproc*`,calls `boolean Binder.transact(int,Parcel,Parcel,int)` from `void IndirectInterproc.doTransactUnderLock(Binder)`,[Trace 1 on UI thread] `void IndirectBlock.takeRemoteExpensiveLockOnUiThreadBad(IndirectInterproc)`,`void IndirectBlock.takeRemoteExpensiveLockOnUiThreadBad(IndirectInterproc)` is annotated `UiThread`] -codetoanalyze/java/starvation/InnerClass.java, InnerClass$InnerClassA.(InnerClass,java.lang.Object), 48, DEADLOCK, no_bucket, ERROR, [[Trace 1] `InnerClass$InnerClassA.(InnerClass,Object)`,locks `this` in class `InnerClass$InnerClassA*`,Method call: `void InnerClass.bar()`,locks `this` in class `InnerClass*`,[Trace 2] `void InnerClass.outerInnerBad(InnerClass$InnerClassA)`,locks `this` in class `InnerClass*`,Method call: `void InnerClass$InnerClassA.baz()`,locks `this` in class `InnerClass$InnerClassA*`] -codetoanalyze/java/starvation/InnerClass.java, InnerClass$InnerClassA.innerOuterBad():void, 34, DEADLOCK, no_bucket, ERROR, [[Trace 1] `void InnerClass$InnerClassA.innerOuterBad()`,locks `this` in class `InnerClass$InnerClassA*`,Method call: `void InnerClass.bar()`,locks `this` in class `InnerClass*`,[Trace 2] `void InnerClass.outerInnerBad(InnerClass$InnerClassA)`,locks `this` in class `InnerClass*`,Method call: `void InnerClass$InnerClassA.baz()`,locks `this` in class `InnerClass$InnerClassA*`] +codetoanalyze/java/starvation/InnerClass.java, InnerClass$InnerClassA.(InnerClass,java.lang.Object), 47, DEADLOCK, no_bucket, ERROR, [[Trace 1] `InnerClass$InnerClassA.(InnerClass,Object)`,locks `this` in class `InnerClass$InnerClassA*`,Method call: `void InnerClass.bar()`,locks `this` in class `InnerClass*`,[Trace 2] `void InnerClass.outerInnerBad(InnerClass$InnerClassA)`,locks `this` in class `InnerClass*`,Method call: `void InnerClass$InnerClassA.baz()`,locks `this` in class `InnerClass$InnerClassA*`] +codetoanalyze/java/starvation/InnerClass.java, InnerClass$InnerClassA.innerOuterBad():void, 33, DEADLOCK, no_bucket, ERROR, [[Trace 1] `void InnerClass$InnerClassA.innerOuterBad()`,locks `this` in class `InnerClass$InnerClassA*`,Method call: `void InnerClass.bar()`,locks `this` in class `InnerClass*`,[Trace 2] `void InnerClass.outerInnerBad(InnerClass$InnerClassA)`,locks `this` in class `InnerClass*`,Method call: `void InnerClass$InnerClassA.baz()`,locks `this` in class `InnerClass$InnerClassA*`] codetoanalyze/java/starvation/Interclass.java, Interclass.interclass1Bad(InterclassA):void, 10, DEADLOCK, no_bucket, ERROR, [[Trace 1] `void Interclass.interclass1Bad(InterclassA)`,locks `this` in class `Interclass*`,Method call: `void InterclassA.interclass1Bad()`,locks `this` in class `InterclassA*`,[Trace 2] `void InterclassA.interclass2Bad(Interclass)`,locks `this` in class `InterclassA*`,Method call: `void Interclass.interclass2Bad()`,locks `this` in class `Interclass*`] codetoanalyze/java/starvation/Interproc.java, Interproc.interproc1Bad(InterprocA):void, 9, DEADLOCK, no_bucket, ERROR, [[Trace 1] `void Interproc.interproc1Bad(InterprocA)`,locks `this` in class `Interproc*`,Method call: `void Interproc.interproc2Bad(InterprocA)`,locks `b` in class `InterprocA*`,[Trace 2] `void InterprocA.interproc1Bad(Interproc)`,locks `this` in class `InterprocA*`,Method call: `void InterprocA.interproc2Bad(Interproc)`,locks `d` in class `Interproc*`] codetoanalyze/java/starvation/Intraproc.java, Intraproc.intraBad(IntraprocA):void, 10, DEADLOCK, no_bucket, ERROR, [[Trace 1] `void Intraproc.intraBad(IntraprocA)`,locks `this` in class `Intraproc*`,locks `o` in class `IntraprocA*`,[Trace 2] `void IntraprocA.intraBad(Intraproc)`,locks `this` in class `IntraprocA*`,locks `o` in class `Intraproc*`] diff --git a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/CADisplayLinkRetainCycle.m b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/CADisplayLinkRetainCycle.m index a4c146e75..748adbf5b 100644 --- a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/CADisplayLinkRetainCycle.m +++ b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/CADisplayLinkRetainCycle.m @@ -18,8 +18,8 @@ @implementation CADisplay - (instancetype)init { - _displayLink = - [CADisplayLink displayLinkWithTarget:self selector:@selector(bla)]; + _displayLink = [CADisplayLink displayLinkWithTarget:self + selector:@selector(bla)]; return self; } @@ -31,7 +31,8 @@ selector:@selector(handleDisplayLink:)]; } -- (void)bla{}; +- (void)bla { +}; - (void)invalidate { // unregister displayLink target diff --git a/infer/tests/codetoanalyze/objc/errors/resource_leaks/ResourceLeakExample.m b/infer/tests/codetoanalyze/objc/errors/resource_leaks/ResourceLeakExample.m index 91802a37e..74c6cbfd9 100644 --- a/infer/tests/codetoanalyze/objc/errors/resource_leaks/ResourceLeakExample.m +++ b/infer/tests/codetoanalyze/objc/errors/resource_leaks/ResourceLeakExample.m @@ -31,8 +31,9 @@ "file.txt", O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); if (fileDescriptor == -1) { if (error) - *error = - [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:nil]; + *error = [NSError errorWithDomain:NSPOSIXErrorDomain + code:errno + userInfo:nil]; return nil; } else { if (self) diff --git a/infer/tests/codetoanalyze/objc/errors/taint/viewController.m b/infer/tests/codetoanalyze/objc/errors/taint/viewController.m index ca165aca7..e5d0e8c5e 100644 --- a/infer/tests/codetoanalyze/objc/errors/taint/viewController.m +++ b/infer/tests/codetoanalyze/objc/errors/taint/viewController.m @@ -26,10 +26,9 @@ BOOL ExampleSanitizer(NSURL* u, int f) { return self; } -- (void)loadURL:(NSURL*)URL - trackingCodes:(NSArray*)trackingCodes{ - // Require untainted URL - }; +- (void)loadURL:(NSURL*)URL trackingCodes:(NSArray*)trackingCodes { + // Require untainted URL +}; @end @interface VCB : NSObject diff --git a/infer/tests/codetoanalyze/objc/frontend/boxing/dict_literal.c b/infer/tests/codetoanalyze/objc/frontend/boxing/dict_literal.c index b0d5a679e..fcc771b28 100644 --- a/infer/tests/codetoanalyze/objc/frontend/boxing/dict_literal.c +++ b/infer/tests/codetoanalyze/objc/frontend/boxing/dict_literal.c @@ -20,5 +20,5 @@ NSDictionary* get_array1() { NSDictionary* get_array2() { - return @{ @"firstName" : @"Matt", @"lastName" : @"Galloway", @"age" : @28 }; + return @{@"firstName" : @"Matt", @"lastName" : @"Galloway", @"age" : @28}; } diff --git a/infer/tests/codetoanalyze/objc/ioslints/unavailable_api_allowed_cases.m b/infer/tests/codetoanalyze/objc/ioslints/unavailable_api_allowed_cases.m index 93d59661d..45aca3c8d 100644 --- a/infer/tests/codetoanalyze/objc/ioslints/unavailable_api_allowed_cases.m +++ b/infer/tests/codetoanalyze/objc/ioslints/unavailable_api_allowed_cases.m @@ -124,9 +124,8 @@ NSDictionary* destinationPixelBufferAttributes; if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_9_0) { - destinationPixelBufferAttributes = @{ - (NSString*)kCVPixelBufferOpenGLESTextureCacheCompatibilityKey : @YES - }; + destinationPixelBufferAttributes = + @{(NSString*)kCVPixelBufferOpenGLESTextureCacheCompatibilityKey : @YES}; } } @@ -134,16 +133,15 @@ - (void)m2 { NSDictionary* destinationPixelBufferAttributes; destinationPixelBufferAttributes = - @{(NSString*)kCVPixelBufferOpenGLESTextureCacheCompatibilityKey : @YES }; + @{(NSString*)kCVPixelBufferOpenGLESTextureCacheCompatibilityKey : @YES}; } // bug - (void)m3:(BOOL)ok { NSDictionary* destinationPixelBufferAttributes; if (ok) { - destinationPixelBufferAttributes = @{ - (NSString*)kCVPixelBufferOpenGLESTextureCacheCompatibilityKey : @YES - }; + destinationPixelBufferAttributes = + @{(NSString*)kCVPixelBufferOpenGLESTextureCacheCompatibilityKey : @YES}; } } @@ -153,9 +151,8 @@ if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_9_0 && ok) { - destinationPixelBufferAttributes = @{ - (NSString*)kCVPixelBufferOpenGLESTextureCacheCompatibilityKey : @YES - }; + destinationPixelBufferAttributes = + @{(NSString*)kCVPixelBufferOpenGLESTextureCacheCompatibilityKey : @YES}; } } @@ -166,9 +163,8 @@ kCFCoreFoundationVersionNumber_iOS_9_0 && kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) { - destinationPixelBufferAttributes = @{ - (NSString*)kCVPixelBufferOpenGLESTextureCacheCompatibilityKey : @YES - }; + destinationPixelBufferAttributes = + @{(NSString*)kCVPixelBufferOpenGLESTextureCacheCompatibilityKey : @YES}; } } @@ -176,9 +172,8 @@ - (void)m6 { NSDictionary* destinationPixelBufferAttributes; if (AT_LEAST_IOS9) { - destinationPixelBufferAttributes = @{ - (NSString*)kCVPixelBufferOpenGLESTextureCacheCompatibilityKey : @YES - }; + destinationPixelBufferAttributes = + @{(NSString*)kCVPixelBufferOpenGLESTextureCacheCompatibilityKey : @YES}; } } @@ -186,9 +181,8 @@ - (void)m7 { NSDictionary* destinationPixelBufferAttributes; if (CK_AT_LEAST_IOS9) { - destinationPixelBufferAttributes = @{ - (NSString*)kCVPixelBufferOpenGLESTextureCacheCompatibilityKey : @YES - }; + destinationPixelBufferAttributes = + @{(NSString*)kCVPixelBufferOpenGLESTextureCacheCompatibilityKey : @YES}; } } @@ -196,9 +190,8 @@ - (void)m8 { NSDictionary* destinationPixelBufferAttributes; if (AT_LEAST_IOS10) { - destinationPixelBufferAttributes = @{ - (NSString*)kCVPixelBufferOpenGLESTextureCacheCompatibilityKey : @YES - }; + destinationPixelBufferAttributes = + @{(NSString*)kCVPixelBufferOpenGLESTextureCacheCompatibilityKey : @YES}; } } diff --git a/infer/tests/codetoanalyze/objc/linters/atomic_prop.m b/infer/tests/codetoanalyze/objc/linters/atomic_prop.m index dbdefcea2..fdc94effa 100644 --- a/infer/tests/codetoanalyze/objc/linters/atomic_prop.m +++ b/infer/tests/codetoanalyze/objc/linters/atomic_prop.m @@ -15,7 +15,8 @@ @implementation B -- (void)foo{}; +- (void)foo { +}; @end diff --git a/infer/tests/codetoanalyze/objc/linters/badpointer.m b/infer/tests/codetoanalyze/objc/linters/badpointer.m index a30d362c9..3efa777f1 100644 --- a/infer/tests/codetoanalyze/objc/linters/badpointer.m +++ b/infer/tests/codetoanalyze/objc/linters/badpointer.m @@ -94,7 +94,7 @@ int good4(NSNumber* number, Simple* simple) { } int bad5(NSNumber* number, Simple* simple) { - if ([simple fooWithCondition:(number ? 1 : 2)andNumber:number] != nil) { + if ([simple fooWithCondition:(number ? 1 : 2) andNumber:number] != nil) { return 0; } return 1; @@ -108,8 +108,8 @@ int bad6(NSNumber* number, Simple* simple) { } int good5(NSNumber* number, Simple* simple) { - if ([simple fooWithCondition:(number == nil ? 1 : 2) andNumber:number] != - nil) { + if ([simple fooWithCondition:(number == nil ? 1 : 2) + andNumber:number] != nil) { return 0; } return 1; diff --git a/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/TollBridgeExample.m b/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/TollBridgeExample.m index 6997b548f..fd5ca18bf 100644 --- a/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/TollBridgeExample.m +++ b/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/TollBridgeExample.m @@ -40,7 +40,7 @@ CTFontRef cfautorelease_test() { } void bridgeDictionaryNoLeak() { - NSDictionary* bufferAttributes = @{(NSString*)@"key" : @{} }; + NSDictionary* bufferAttributes = @{(NSString*)@"key" : @{}}; CFDictionaryRef dict = (__bridge CFDictionaryRef)bufferAttributes; } diff --git a/infer/tests/codetoanalyze/objcpp/linters/componentkit/MultipleFactoryMethodsTest.h b/infer/tests/codetoanalyze/objcpp/linters/componentkit/MultipleFactoryMethodsTest.h index 6482254fb..34c1ae906 100644 --- a/infer/tests/codetoanalyze/objcpp/linters/componentkit/MultipleFactoryMethodsTest.h +++ b/infer/tests/codetoanalyze/objcpp/linters/componentkit/MultipleFactoryMethodsTest.h @@ -40,14 +40,14 @@ // OK - unavailable initializers shouldn't count @interface UnavailableInitializer1 : CKCompositeComponent -+ (instancetype) new // shouldn't count since it's unavailable ++ (instancetype)new // shouldn't count since it's unavailable __attribute__((unavailable("Must use designated initializer"))); + (instancetype)newWithObject:(NSObject*)obj; @end // Not OK - there are 2 static initialzers, even w/out the unavailable one @interface UnavailableInitializer2 : CKCompositeComponent -+ (instancetype) new // shouldn't count since it's unavailable ++ (instancetype)new // shouldn't count since it's unavailable __attribute__((unavailable("Must use designated initializer"))); + (instancetype)newWithObject1:(NSObject*)obj; + (instancetype)newWithObject2:(NSObject*)obj; diff --git a/infer/tests/codetoanalyze/objcpp/linters/componentkit/MutableLocalVariablesTest.mm b/infer/tests/codetoanalyze/objcpp/linters/componentkit/MutableLocalVariablesTest.mm index 02854eda2..523b60cb3 100644 --- a/infer/tests/codetoanalyze/objcpp/linters/componentkit/MutableLocalVariablesTest.mm +++ b/infer/tests/codetoanalyze/objcpp/linters/componentkit/MutableLocalVariablesTest.mm @@ -83,7 +83,7 @@ class BarClass { @interface BarComponent : CKCompositeComponent @end @implementation BarComponent -+ (instancetype) new { ++ (instancetype)new { // C++ classes BarClass s1; // error const BarClass& s2 = s1; // no error