Format everything

Reviewed By: jeremydubreil

Differential Revision: D10844347

fbshipit-source-id: 5a374da82
master
Mehdi Bouaziz 6 years ago committed by Facebook Github Bot
parent ecedb27d77
commit ce34dcb695

@ -7,7 +7,6 @@
package android.app;
public abstract class AlarmManager {
void cancel(PendingIntent operation) {

@ -7,7 +7,6 @@
package android.database;
import java.io.IOException;
public class CursorWrapper implements Cursor {

@ -7,7 +7,6 @@
package java.util;
// abstract so we don't have to implement every method of List
public abstract class ArrayList<T> extends AbstractList<T> {

@ -7,7 +7,6 @@
package java.util;
// abstract so we don't have to implement every method of List
public abstract class List<T> extends AbstractList<T> {

@ -7,7 +7,6 @@
package org.assertj.core.util;
import static com.facebook.infer.builtins.InferBuiltins.assume;
public final class Preconditions {

@ -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

@ -10,7 +10,7 @@
@interface SomeClass : CKCompositeComponent
@end
@implementation SomeClass
+ (instancetype) new {
+ (instancetype)new {
if (1 == 3) {
return nil;
} else if (2 == 4) {

@ -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

@ -9,7 +9,7 @@
@interface SomeClass : CKCompositeComponent
@end
@implementation SomeClass
+ (instancetype) new {
+ (instancetype)new {
int i; // error
return nil;
}

@ -7,7 +7,6 @@
package codetoanalyze.java.infer;
public class IntegerExample {
private static void testIntegerEqualsGood() {

@ -5,7 +5,6 @@
* LICENSE file in the root directory of this source tree.
*/
class InnerClass {
synchronized void outerInnerOk(InnerClassA a) {
a.foo();

@ -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.<init>(InnerClass,java.lang.Object), 48, DEADLOCK, no_bucket, ERROR, [[Trace 1] `InnerClass$InnerClassA.<init>(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.<init>(InnerClass,java.lang.Object), 47, DEADLOCK, no_bucket, ERROR, [[Trace 1] `InnerClass$InnerClassA.<init>(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*`]

@ -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

@ -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)

@ -26,10 +26,9 @@ BOOL ExampleSanitizer(NSURL* u, int f) {
return self;
}
- (void)loadURL:(NSURL*)URL
trackingCodes:(NSArray*)trackingCodes{
- (void)loadURL:(NSURL*)URL trackingCodes:(NSArray*)trackingCodes {
// Require untainted URL
};
};
@end
@interface VCB : NSObject

@ -20,5 +20,5 @@ NSDictionary* get_array1() {
NSDictionary* get_array2() {
return @{ @"firstName" : @"Matt", @"lastName" : @"Galloway", @"age" : @28 };
return @{@"firstName" : @"Matt", @"lastName" : @"Galloway", @"age" : @28};
}

@ -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};
}
}

@ -15,7 +15,8 @@
@implementation B
- (void)foo{};
- (void)foo {
};
@end

@ -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;

@ -40,7 +40,7 @@ CTFontRef cfautorelease_test() {
}
void bridgeDictionaryNoLeak() {
NSDictionary* bufferAttributes = @{(NSString*)@"key" : @{} };
NSDictionary* bufferAttributes = @{(NSString*)@"key" : @{}};
CFDictionaryRef dict = (__bridge CFDictionaryRef)bufferAttributes;
}

@ -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;

@ -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

Loading…
Cancel
Save