Quellcode durchsuchen

Replace +array / +string / +set … calls with +new

Tanner Bennett vor 6 Jahren
Ursprung
Commit
3cb1366966
33 geänderte Dateien mit 68 neuen und 68 gelöschten Zeilen
  1. 1 1
      Classes/Editing/ArgumentInputViews/FLEXArgumentInputFontsPickerView.m
  2. 1 1
      Classes/Editing/ArgumentInputViews/FLEXArgumentInputStructView.m
  3. 2 2
      Classes/Editing/FLEXMethodCallingViewController.m
  4. 3 3
      Classes/ExplorerInterface/FLEXExplorerViewController.m
  5. 2 2
      Classes/GlobalStateExplorers/FLEXLiveObjectsTableViewController.m
  6. 2 2
      Classes/GlobalStateExplorers/FLEXObjectListViewController.m
  7. 3 3
      Classes/GlobalStateExplorers/FileBrowser/FLEXFileBrowserSearchOperation.m
  8. 1 1
      Classes/GlobalStateExplorers/FileBrowser/FLEXFileBrowserTableViewController.m
  9. 1 1
      Classes/GlobalStateExplorers/Keychain/FLEXKeychainQuery.m
  10. 6 6
      Classes/GlobalStateExplorers/RuntimeBrowser/DataSources/FLEXRuntimeClient.m
  11. 1 1
      Classes/GlobalStateExplorers/RuntimeBrowser/FLEXKeyboardToolbar.m
  12. 1 1
      Classes/GlobalStateExplorers/RuntimeBrowser/FLEXRuntimeBrowserToolbar.m
  13. 1 1
      Classes/GlobalStateExplorers/RuntimeBrowser/FLEXRuntimeKeyPathTokenizer.m
  14. 1 1
      Classes/GlobalStateExplorers/RuntimeBrowser/FLEXSearchToken.m
  15. 3 3
      Classes/GlobalStateExplorers/SystemLog/FLEXASLLogController.m
  16. 1 1
      Classes/GlobalStateExplorers/SystemLog/FLEXOSLogController.m
  17. 1 1
      Classes/Network/FLEXNetworkMITMViewController.m
  18. 2 2
      Classes/Network/FLEXNetworkRecorder.m
  19. 1 1
      Classes/Network/FLEXNetworkSettingsTableViewController.m
  20. 1 1
      Classes/Network/FLEXNetworkTransaction.m
  21. 2 2
      Classes/Network/FLEXNetworkTransactionDetailTableViewController.m
  22. 1 1
      Classes/Network/FLEXNetworkTransactionTableViewCell.m
  23. 1 1
      Classes/Utility/Categories/NSArray+Functional.m
  24. 1 1
      Classes/Utility/Categories/NSDictionary+ObjcRuntime.m
  25. 8 8
      Classes/Utility/Categories/NSObject+Reflection.m
  26. 1 1
      Classes/Utility/Categories/NSString+ObjcRuntime.m
  27. 2 2
      Classes/Utility/Keyboard/FLEXKeyboardShortcutManager.m
  28. 2 2
      Classes/Utility/Runtime/FLEXRuntimeUtility.m
  29. 4 4
      Classes/Utility/Runtime/Objc/FLEXClassBuilder.m
  30. 4 4
      Classes/Utility/Runtime/Objc/FLEXMirror.m
  31. 1 1
      Classes/Utility/Runtime/Objc/FLEXProperty.m
  32. 5 5
      Classes/Utility/Runtime/Objc/FLEXProtocol.m
  33. 1 1
      FLEXTests/FLEXTestsMethodsList.m

+ 1 - 1
Classes/Editing/ArgumentInputViews/FLEXArgumentInputFontsPickerView.m

@@ -51,7 +51,7 @@
 }
 
 - (void)createAvailableFonts {
-    NSMutableArray<NSString *> *unsortedFontsArray = [NSMutableArray array];
+    NSMutableArray<NSString *> *unsortedFontsArray = [NSMutableArray new];
     for (NSString *eachFontFamily in [UIFont familyNames]) {
         for (NSString *eachFontName in [UIFont fontNamesForFamilyName:eachFontFamily]) {
             [unsortedFontsArray addObject:eachFontName];

+ 1 - 1
Classes/Editing/ArgumentInputViews/FLEXArgumentInputStructView.m

@@ -22,7 +22,7 @@
 - (instancetype)initWithArgumentTypeEncoding:(const char *)typeEncoding {
     self = [super initWithArgumentTypeEncoding:typeEncoding];
     if (self) {
-        NSMutableArray<FLEXArgumentInputView *> *inputViews = [NSMutableArray array];
+        NSMutableArray<FLEXArgumentInputView *> *inputViews = [NSMutableArray new];
         NSArray<NSString *> *customTitles = [[self class] customFieldTitlesForTypeEncoding:typeEncoding];
         [FLEXRuntimeUtility enumerateTypesInStructEncoding:typeEncoding usingBlock:^(NSString *structName,
                                                                                      const char *fieldTypeEncoding,

+ 2 - 2
Classes/Editing/FLEXMethodCallingViewController.m

@@ -54,7 +54,7 @@
 - (NSArray<FLEXArgumentInputView *> *)argumentInputViews {
     Method method = self.method.objc_method;
     NSArray *methodComponents = [FLEXRuntimeUtility prettyArgumentComponentsForMethod:method];
-    NSMutableArray<FLEXArgumentInputView *> *argumentInputViews = [NSMutableArray array];
+    NSMutableArray<FLEXArgumentInputView *> *argumentInputViews = [NSMutableArray new];
     unsigned int argumentIndex = kFLEXNumberOfImplicitArgs;
 
     for (NSString *methodComponent in methodComponents) {
@@ -75,7 +75,7 @@
     [super actionButtonPressed:sender];
 
     // Gather arguments
-    NSMutableArray *arguments = [NSMutableArray array];
+    NSMutableArray *arguments = [NSMutableArray new];
     for (FLEXArgumentInputView *inputView in self.fieldEditorView.argumentInputViews) {
         // Use NSNull as a nil placeholder; it will be interpreted as nil
         [arguments addObject:inputView.inputValue ?: NSNull.null];

+ 3 - 3
Classes/ExplorerInterface/FLEXExplorerViewController.m

@@ -77,7 +77,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
     self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
     if (self) {
-        self.observedViews = [NSMutableSet set];
+        self.observedViews = [NSMutableSet new];
     }
     return self;
 }
@@ -660,7 +660,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 }
 
 - (NSArray<UIView *> *)viewsAtPoint:(CGPoint)tapPointInWindow skipHiddenViews:(BOOL)skipHidden {
-    NSMutableArray<UIView *> *views = [NSMutableArray array];
+    NSMutableArray<UIView *> *views = [NSMutableArray new];
     for (UIWindow *window in [FLEXUtility allWindows]) {
         // Don't include the explorer's own window or subviews.
         if (window != self.view.window && [window pointInside:tapPointInWindow withEvent:nil]) {
@@ -695,7 +695,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 - (NSArray<UIView *> *)recursiveSubviewsAtPoint:(CGPoint)pointInView
                                          inView:(UIView *)view
                                 skipHiddenViews:(BOOL)skipHidden {
-    NSMutableArray<UIView *> *subviewsAtPoint = [NSMutableArray array];
+    NSMutableArray<UIView *> *subviewsAtPoint = [NSMutableArray new];
     for (UIView *subview in view.subviews) {
         BOOL isHidden = subview.hidden || subview.alpha < 0.01;
         if (skipHidden && isHidden) {

+ 2 - 2
Classes/GlobalStateExplorers/FLEXLiveObjectsTableViewController.m

@@ -70,8 +70,8 @@ static const NSInteger kFLEXLiveObjectsSortBySizeIndex = 2;
     }];
     
     // Convert our CF primitive dictionary into a nicer mapping of class name strings to counts that we will use as the table's model.
-    NSMutableDictionary<NSString *, NSNumber *> *mutableCountsForClassNames = [NSMutableDictionary dictionary];
-    NSMutableDictionary<NSString *, NSNumber *> *mutableSizesForClassNames = [NSMutableDictionary dictionary];
+    NSMutableDictionary<NSString *, NSNumber *> *mutableCountsForClassNames = [NSMutableDictionary new];
+    NSMutableDictionary<NSString *, NSNumber *> *mutableSizesForClassNames = [NSMutableDictionary new];
     for (unsigned int i = 0; i < classCount; i++) {
         Class class = classes[i];
         NSUInteger instanceCount = (NSUInteger)CFDictionaryGetValue(mutableCountsForClasses, (__bridge const void *)(class));

+ 2 - 2
Classes/GlobalStateExplorers/FLEXObjectListViewController.m

@@ -113,7 +113,7 @@
 
 + (instancetype)instancesOfClassWithName:(NSString *)className {
     const char *classNameCString = className.UTF8String;
-    NSMutableArray *instances = [NSMutableArray array];
+    NSMutableArray *instances = [NSMutableArray new];
     [FLEXHeapEnumerator enumerateLiveObjectsUsingBlock:^(__unsafe_unretained id object, __unsafe_unretained Class actualClass) {
         if (strcmp(classNameCString, class_getName(actualClass)) == 0) {
             // Note: objects of certain classes crash when retain is called.
@@ -153,7 +153,7 @@
         }
     });
     
-    NSMutableArray<FLEXObjectRef *> *instances = [NSMutableArray array];
+    NSMutableArray<FLEXObjectRef *> *instances = [NSMutableArray new];
     [FLEXHeapEnumerator enumerateLiveObjectsUsingBlock:^(__unsafe_unretained id tryObject, __unsafe_unretained Class actualClass) {
         // Get all the ivars on the object. Start with the class and and travel up the inheritance chain.
         // Once we find a match, record it and move on to the next object. There's no reason to find multiple matches within the same object.

+ 3 - 3
Classes/GlobalStateExplorers/FileBrowser/FLEXFileBrowserSearchOperation.m

@@ -60,10 +60,10 @@
 
 - (void)main {
     NSFileManager *fileManager = NSFileManager.defaultManager;
-    NSMutableArray<NSString *> *searchPaths = [NSMutableArray array];
-    NSMutableDictionary<NSString *, NSNumber *> *sizeMapping = [NSMutableDictionary dictionary];
+    NSMutableArray<NSString *> *searchPaths = [NSMutableArray new];
+    NSMutableDictionary<NSString *, NSNumber *> *sizeMapping = [NSMutableDictionary new];
     uint64_t totalSize = 0;
-    NSMutableArray<NSString *> *stack = [NSMutableArray array];
+    NSMutableArray<NSString *> *stack = [NSMutableArray new];
     [stack flex_push:self.path];
     
     //recursive found all match searchString paths, and precomputing there size

+ 1 - 1
Classes/GlobalStateExplorers/FileBrowser/FLEXFileBrowserTableViewController.m

@@ -447,7 +447,7 @@
 }
 
 - (void)reloadCurrentPath {
-    NSMutableArray<NSString *> *childPaths = [NSMutableArray array];
+    NSMutableArray<NSString *> *childPaths = [NSMutableArray new];
     NSArray<NSString *> *subpaths = [NSFileManager.defaultManager contentsOfDirectoryAtPath:self.path error:NULL];
     for (NSString *subpath in subpaths) {
         [childPaths addObject:[self.path stringByAppendingPathComponent:subpath]];

+ 1 - 1
Classes/GlobalStateExplorers/Keychain/FLEXKeychainQuery.m

@@ -193,7 +193,7 @@
 #pragma mark - Private
 
 - (NSMutableDictionary *)query {
-    NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
+    NSMutableDictionary *dictionary = [NSMutableDictionary new];
     dictionary[(__bridge id)kSecClass] = (__bridge id)kSecClassGenericPassword;
     
     if (self.service) {

+ 6 - 6
Classes/GlobalStateExplorers/RuntimeBrowser/DataSources/FLEXRuntimeClient.m

@@ -182,7 +182,7 @@ static inline NSString * TBWildcardMap(NSString *token, NSString *candidate, TBW
         return classNameStrings.mutableCopy;
     }
 
-    return [NSMutableArray array];
+    return [NSMutableArray new];
 }
 
 #pragma mark - Public
@@ -204,7 +204,7 @@ static inline NSString * TBWildcardMap(NSString *token, NSString *candidate, TBW
         }];
     }
 
-    return [NSMutableArray array];
+    return [NSMutableArray new];
 }
 
 - (NSMutableArray<NSString*> *)bundlePathsForToken:(FLEXSearchToken *)token {
@@ -224,7 +224,7 @@ static inline NSString * TBWildcardMap(NSString *token, NSString *candidate, TBW
         }];
     }
 
-    return [NSMutableArray array];
+    return [NSMutableArray new];
 }
 
 - (NSMutableArray<NSString*> *)classesForToken:(FLEXSearchToken *)token inBundles:(NSMutableArray<NSString*> *)bundles {
@@ -234,7 +234,7 @@ static inline NSString * TBWildcardMap(NSString *token, NSString *candidate, TBW
             return [NSMutableArray arrayWithObject:token.string];
         }
 
-        return [NSMutableArray array];
+        return [NSMutableArray new];
     }
 
     if (bundles.count) {
@@ -247,7 +247,7 @@ static inline NSString * TBWildcardMap(NSString *token, NSString *candidate, TBW
         }];
     }
 
-    return [NSMutableArray array];
+    return [NSMutableArray new];
 }
 
 - (NSMutableArray<NSString*> *)_classesForToken:(FLEXSearchToken *)token inBundles:(NSMutableArray<NSString*> *)bundles {
@@ -377,7 +377,7 @@ static inline NSString * TBWildcardMap(NSString *token, NSString *candidate, TBW
         }
     }
     
-    return [NSMutableArray array];
+    return [NSMutableArray new];
 }
 
 @end

+ 1 - 1
Classes/GlobalStateExplorers/RuntimeBrowser/FLEXKeyboardToolbar.m

@@ -96,7 +96,7 @@
 }
 
 - (UIView *)inputAccessoryView {
-    _topBorder       = [CALayer layer];
+    _topBorder       = [CALayer new];
     _topBorder.frame = CGRectMake(0.0, 0.0, self.bounds.size.width, 0.5);
     [self makeScrollView];
     

+ 1 - 1
Classes/GlobalStateExplorers/RuntimeBrowser/FLEXRuntimeBrowserToolbar.m

@@ -28,7 +28,7 @@
 + (NSArray<FLEXKBToolbarButton*> *)buttonsForKeyPath:(FLEXRuntimeKeyPath *)keyPath
                                      suggestions:(NSArray<NSString *> *)suggestions
                                          handler:(FLEXKBToolbarAction)handler {
-    NSMutableArray *buttons = [NSMutableArray array];
+    NSMutableArray *buttons = [NSMutableArray new];
     FLEXSearchToken *lastKey = nil;
     BOOL lastKeyIsMethod = NO;
 

+ 1 - 1
Classes/GlobalStateExplorers/RuntimeBrowser/FLEXRuntimeKeyPathTokenizer.m

@@ -90,7 +90,7 @@ static NSCharacterSet *methodAllowed     = nil;
     }
 
     TBWildcardOptions options = TBWildcardOptionsNone;
-    NSMutableString *token = [NSMutableString string];
+    NSMutableString *token = [NSMutableString new];
 
     // Token cannot start with '.'
     if ([scanner scanString:@"." intoString:nil]) {

+ 1 - 1
Classes/GlobalStateExplorers/RuntimeBrowser/FLEXSearchToken.m

@@ -57,7 +57,7 @@
             flex_description = @"*";
             break;
         default: {
-            NSMutableString *desc = [NSMutableString string];
+            NSMutableString *desc = [NSMutableString new];
             if (_options & TBWildcardOptionsPrefix) {
                 [desc appendString:@"*"];
             }

+ 3 - 3
Classes/GlobalStateExplorers/SystemLog/FLEXASLLogController.m

@@ -46,7 +46,7 @@
     self = [super init];
     if (self) {
         _updateHandler = newMessagesHandler;
-        _logMessageIdentifiers = [NSMutableIndexSet indexSet];
+        _logMessageIdentifiers = [NSMutableIndexSet new];
         self.logUpdateTimer = [NSTimer scheduledTimerWithTimeInterval:updateInterval
                                                                target:self
                                                              selector:@selector(updateLogMessages)
@@ -98,7 +98,7 @@
     aslresponse response = [self ASLMessageListForCurrentProcess];
     aslmsg aslMessage = NULL;
 
-    NSMutableArray<FLEXSystemLogMessage *> *newMessages = [NSMutableArray array];
+    NSMutableArray<FLEXSystemLogMessage *> *newMessages = [NSMutableArray new];
 
     while ((aslMessage = asl_next(response))) {
         NSUInteger messageID = (NSUInteger)atoll(asl_get(aslMessage, ASL_KEY_MSG_ID));
@@ -135,7 +135,7 @@
     aslresponse response = [self ASLMessageListForCurrentProcess];
     aslmsg aslMessage = NULL;
 
-    NSMutableArray<FLEXSystemLogMessage *> *logMessages = [NSMutableArray array];
+    NSMutableArray<FLEXSystemLogMessage *> *logMessages = [NSMutableArray new];
     while ((aslMessage = asl_next(response))) {
         [logMessages addObject:[FLEXSystemLogMessage logMessageFromASLMessage:aslMessage]];
     }

+ 1 - 1
Classes/GlobalStateExplorers/SystemLog/FLEXOSLogController.m

@@ -85,7 +85,7 @@ static uint8_t (*OSLogGetType)(void *);
     if (_persistent == persistent) return;
     
     _persistent = persistent;
-    self.messages = persistent ? [NSMutableArray array] : nil;
+    self.messages = persistent ? [NSMutableArray new] : nil;
 }
 
 - (BOOL)startMonitoring {

+ 1 - 1
Classes/Network/FLEXNetworkMITMViewController.m

@@ -266,7 +266,7 @@
                 [self tryUpdateTransactions];
             }];
 
-            NSMutableArray<NSIndexPath *> *indexPathsToReload = [NSMutableArray array];
+            NSMutableArray<NSIndexPath *> *indexPathsToReload = [NSMutableArray new];
             for (NSInteger row = 0; row < addedRowCount; row++) {
                 [indexPathsToReload addObject:[NSIndexPath indexPathForRow:row inSection:0]];
             }

+ 2 - 2
Classes/Network/FLEXNetworkRecorder.m

@@ -41,8 +41,8 @@ NSString *const kFLEXNetworkRecorderResponseCacheLimitDefaultsKey = @"com.flex.r
         self.responseCache.totalCostLimit = responseCacheLimit ?: 25 * 1024 * 1024;
         [self.responseCache setTotalCostLimit:responseCacheLimit];
         
-        self.orderedTransactions = [NSMutableArray array];
-        self.networkTransactionsForRequestIdentifiers = [NSMutableDictionary dictionary];
+        self.orderedTransactions = [NSMutableArray new];
+        self.networkTransactionsForRequestIdentifiers = [NSMutableDictionary new];
 
         // Serial queue used because we use mutable objects that are not thread safe
         self.queue = dispatch_queue_create("com.flex.FLEXNetworkRecorder", DISPATCH_QUEUE_SERIAL);

+ 1 - 1
Classes/Network/FLEXNetworkSettingsTableViewController.m

@@ -32,7 +32,7 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
 
-    NSMutableArray<UITableViewCell *> *mutableCells = [NSMutableArray array];
+    NSMutableArray<UITableViewCell *> *mutableCells = [NSMutableArray new];
 
     UITableViewCell *networkDebuggingCell = [self switchCellWithTitle:@"Network Debugging" toggleAction:@selector(networkDebuggingToggled:) isOn:FLEXNetworkObserver.isEnabled];
     [mutableCells addObject:networkDebuggingCell];

+ 1 - 1
Classes/Network/FLEXNetworkTransaction.m

@@ -35,7 +35,7 @@
             NSInputStream *bodyStream = [self.request.HTTPBodyStream copy];
             const NSUInteger bufferSize = 1024;
             uint8_t buffer[bufferSize];
-            NSMutableData *data = [NSMutableData data];
+            NSMutableData *data = [NSMutableData new];
             [bodyStream open];
             NSInteger readBytes = 0;
             do {

+ 2 - 2
Classes/Network/FLEXNetworkTransactionDetailTableViewController.m

@@ -83,7 +83,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
 }
 
 - (void)rebuildTableSections {
-    NSMutableArray<FLEXNetworkDetailSection *> *sections = [NSMutableArray array];
+    NSMutableArray<FLEXNetworkDetailSection *> *sections = [NSMutableArray new];
 
     FLEXNetworkDetailSection *generalSection = [[self class] generalSectionForTransaction:self.transaction];
     if (generalSection.rows.count > 0) {
@@ -246,7 +246,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
 #pragma mark - Table Data Generation
 
 + (FLEXNetworkDetailSection *)generalSectionForTransaction:(FLEXNetworkTransaction *)transaction {
-    NSMutableArray<FLEXNetworkDetailRow *> *rows = [NSMutableArray array];
+    NSMutableArray<FLEXNetworkDetailRow *> *rows = [NSMutableArray new];
 
     FLEXNetworkDetailRow *requestURLRow = [FLEXNetworkDetailRow new];
     requestURLRow.title = @"Request URL";

+ 1 - 1
Classes/Network/FLEXNetworkTransactionTableViewCell.m

@@ -119,7 +119,7 @@ NSString *const kFLEXNetworkTransactionCellIdentifier = @"kFLEXNetworkTransactio
 }
 
 - (NSString *)transactionDetailsLabelText {
-    NSMutableArray<NSString *> *detailComponents = [NSMutableArray array];
+    NSMutableArray<NSString *> *detailComponents = [NSMutableArray new];
 
     NSString *timestamp = [[self class] timestampStringFromRequestDate:self.transaction.startTime];
     if (timestamp.length > 0) {

+ 1 - 1
Classes/Utility/Categories/NSArray+Functional.m

@@ -29,7 +29,7 @@
 }
 
 - (__kindof NSArray *)flex_flatmapped:(NSArray *(^)(id, NSUInteger))block {
-    NSMutableArray *array = [NSMutableArray array];
+    NSMutableArray *array = [NSMutableArray new];
     [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
         NSArray *toAdd = block(obj, idx);
         if (toAdd) {

+ 1 - 1
Classes/Utility/Categories/NSDictionary+ObjcRuntime.m

@@ -17,7 +17,7 @@
 - (NSString *)propertyAttributesString {
     if (!self[kFLEXPropertyAttributeKeyTypeEncoding]) return nil;
     
-    NSMutableString *attributes = [NSMutableString string];
+    NSMutableString *attributes = [NSMutableString new];
     [attributes appendFormat:@"T%@,", self[kFLEXPropertyAttributeKeyTypeEncoding]];
     
     for (NSString *attribute in self.allKeys) {

+ 8 - 8
Classes/Utility/Categories/NSObject+Reflection.m

@@ -22,7 +22,7 @@
 NSString * FLEXTypeEncodingString(const char *returnType, NSUInteger count, ...) {
     if (returnType == NULL) return nil;
     
-    NSMutableString *encoding = [NSMutableString string];
+    NSMutableString *encoding = [NSMutableString new];
     [encoding appendFormat:@"%s%s%s", returnType, @encode(id), @encode(SEL)];
     
     va_list args;
@@ -50,7 +50,7 @@ NSArray<Class> *FLEXGetAllSubclasses(Class cls, BOOL includeSelf) {
         size   = objc_getClassList(buffer, count);
     } while (size != count);
     
-    NSMutableArray *classes = [NSMutableArray array];
+    NSMutableArray *classes = [NSMutableArray new];
     if (includeSelf) {
         [classes addObject:cls];
     }
@@ -75,7 +75,7 @@ NSArray<Class> *FLEXGetClassHierarchy(Class cls, BOOL includeSelf) {
         return nil;
     }
     
-    NSMutableArray *classes = [NSMutableArray array];
+    NSMutableArray *classes = [NSMutableArray new];
     if (includeSelf) {
         [classes addObject:cls];
     }
@@ -201,7 +201,7 @@ NSArray<FLEXProtocol *> *FLEXGetConformedProtocols(Class cls) {
     unsigned int mcount;
     Method *objcmethods = class_copyMethodList([self class], &mcount);
 
-    NSMutableArray *methods = [NSMutableArray array];
+    NSMutableArray *methods = [NSMutableArray new];
     for (int i = 0; i < mcount; i++) {
         FLEXMethod *m = [FLEXMethod method:objcmethods[i] isInstanceMethod:YES];
         if (m) {
@@ -217,7 +217,7 @@ NSArray<FLEXProtocol *> *FLEXGetConformedProtocols(Class cls) {
     unsigned int mcount;
     Method *objcmethods = class_copyMethodList(self.flex_metaclass, &mcount);
 
-    NSMutableArray *methods = [NSMutableArray array];
+    NSMutableArray *methods = [NSMutableArray new];
     for (int i = 0; i < mcount; i++) {
         FLEXMethod *m = [FLEXMethod method:objcmethods[i] isInstanceMethod:NO];
         if (m) {
@@ -295,7 +295,7 @@ NSArray<FLEXProtocol *> *FLEXGetConformedProtocols(Class cls) {
     unsigned int ivcount;
     Ivar *objcivars = class_copyIvarList([self class], &ivcount);
     
-    NSMutableArray *ivars = [NSMutableArray array];
+    NSMutableArray *ivars = [NSMutableArray new];
     for (int i = 0; i < ivcount; i++) {
         [ivars addObject:[FLEXIvar ivar:objcivars[i]]];
     }
@@ -382,7 +382,7 @@ NSArray<FLEXProtocol *> *FLEXGetConformedProtocols(Class cls) {
     unsigned int pcount;
     objc_property_t *objcproperties = class_copyPropertyList(self, &pcount);
     
-    NSMutableArray *properties = [NSMutableArray array];
+    NSMutableArray *properties = [NSMutableArray new];
     for (int i = 0; i < pcount; i++) {
         [properties addObject:[FLEXProperty property:objcproperties[i] onClass:self]];
     }
@@ -396,7 +396,7 @@ NSArray<FLEXProtocol *> *FLEXGetConformedProtocols(Class cls) {
     unsigned int pcount;
     objc_property_t *objcproperties = class_copyPropertyList(metaclass, &pcount);
 
-    NSMutableArray *properties = [NSMutableArray array];
+    NSMutableArray *properties = [NSMutableArray new];
     for (int i = 0; i < pcount; i++) {
         [properties addObject:[FLEXProperty property:objcproperties[i] onClass:metaclass]];
     }

+ 1 - 1
Classes/Utility/Categories/NSString+ObjcRuntime.m

@@ -23,7 +23,7 @@
 - (NSDictionary *)propertyAttributes {
     if (!self.length) return nil;
     
-    NSMutableDictionary *attributes = [NSMutableDictionary dictionary];
+    NSMutableDictionary *attributes = [NSMutableDictionary new];
     
     NSArray *components = [self componentsSeparatedByString:@","];
     for (NSString *attribute in components) {

+ 2 - 2
Classes/Utility/Keyboard/FLEXKeyboardShortcutManager.m

@@ -202,7 +202,7 @@
     self = [super init];
     
     if (self) {
-        _actionsForKeyInputs = [NSMutableDictionary dictionary];
+        _actionsForKeyInputs = [NSMutableDictionary new];
         _enabled = YES;
     }
     
@@ -304,7 +304,7 @@ static const long kFLEXCommandKeyCode = 0xe3;
 }
 
 - (NSString *)keyboardShortcutsDescription {
-    NSMutableString *description = [NSMutableString string];
+    NSMutableString *description = [NSMutableString new];
     NSArray<FLEXKeyInput *> *keyInputs = [self.actionsForKeyInputs.allKeys
         sortedArrayUsingComparator:^NSComparisonResult(FLEXKeyInput *input1, FLEXKeyInput *input2) {
             return [input1.key caseInsensitiveCompare:input2.key];

+ 2 - 2
Classes/Utility/Runtime/FLEXRuntimeUtility.m

@@ -238,7 +238,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
 #pragma mark - Method Helpers (Public)
 
 + (NSArray<NSString *> *)prettyArgumentComponentsForMethod:(Method)method {
-    NSMutableArray<NSString *> *components = [NSMutableArray array];
+    NSMutableArray<NSString *> *components = [NSMutableArray new];
 
     NSString *selectorName = NSStringFromSelector(method_getName(method));
     NSMutableArray<NSString *> *selectorComponents = [selectorName componentsSeparatedByString:@":"].mutableCopy;
@@ -678,7 +678,7 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
         NSArray<NSString *> *const fieldNames = [fieldNamesString
             componentsSeparatedByString:[NSString stringWithFormat:@"%c", FLEXTypeEncodingQuote]
         ];
-        NSMutableString *finalFieldNamesString = [NSMutableString string];
+        NSMutableString *finalFieldNamesString = [NSMutableString new];
         for (NSString *const fieldName in fieldNames) {
             if (fieldName.length > 0) {
                 if (finalFieldNamesString.length > 0) {

+ 4 - 4
Classes/Utility/Runtime/Objc/FLEXClassBuilder.m

@@ -74,7 +74,7 @@
 - (NSArray *)addMethods:(NSArray *)methods {
     NSParameterAssert(methods.count);
     
-    NSMutableArray *failed = [NSMutableArray array];
+    NSMutableArray *failed = [NSMutableArray new];
     for (FLEXMethodBase *m in methods) {
         if (!class_addMethod(self.workingClass, m.selector, m.implementation, m.typeEncoding.UTF8String)) {
             [failed addObject:m];
@@ -87,7 +87,7 @@
 - (NSArray *)addProperties:(NSArray *)properties {
     NSParameterAssert(properties.count);
     
-    NSMutableArray *failed = [NSMutableArray array];
+    NSMutableArray *failed = [NSMutableArray new];
     for (FLEXProperty *p in properties) {
         unsigned int pcount;
         objc_property_attribute_t *attributes = [p copyAttributesList:&pcount];
@@ -103,7 +103,7 @@
 - (NSArray *)addProtocols:(NSArray *)protocols {
     NSParameterAssert(protocols.count);
     
-    NSMutableArray *failed = [NSMutableArray array];
+    NSMutableArray *failed = [NSMutableArray new];
     for (FLEXProtocol *p in protocols) {
         if (!class_addProtocol(self.workingClass, p.objc_protocol)) {
             [failed addObject:p];
@@ -116,7 +116,7 @@
 - (NSArray *)addIvars:(NSArray *)ivars {
     NSParameterAssert(ivars.count);
     
-    NSMutableArray *failed = [NSMutableArray array];
+    NSMutableArray *failed = [NSMutableArray new];
     for (FLEXIvarBuilder *ivar in ivars) {
         if (!class_addIvar(self.workingClass, ivar.name.UTF8String, ivar.size, ivar.alignment, ivar.encoding.UTF8String)) {
             [failed addObject:ivar];

+ 4 - 4
Classes/Utility/Runtime/Objc/FLEXMirror.m

@@ -71,22 +71,22 @@
     _className = NSStringFromClass(cls);
     _isClass   = class_isMetaClass(cls); // or object_isClass(self.value)
     
-    NSMutableArray *properties = [NSMutableArray array];
+    NSMutableArray *properties = [NSMutableArray new];
     for (int i = 0; i < pcount; i++)
         [properties addObject:[FLEXProperty property:objcproperties[i]]];
     _properties = properties;
     
-    NSMutableArray *methods = [NSMutableArray array];
+    NSMutableArray *methods = [NSMutableArray new];
     for (int i = 0; i < mcount; i++)
         [methods addObject:[FLEXMethod method:objcmethods[i]]];
     _methods = methods;
     
-    NSMutableArray *ivars = [NSMutableArray array];
+    NSMutableArray *ivars = [NSMutableArray new];
     for (int i = 0; i < ivcount; i++)
         [ivars addObject:[FLEXIvar ivar:objcivars[i]]];
     _ivars = ivars;
     
-    NSMutableArray *protocols = [NSMutableArray array];
+    NSMutableArray *protocols = [NSMutableArray new];
     for (int i = 0; i < pccount; i++)
         [protocols addObject:[FLEXProtocol protocol:procs[i]]];
     _protocols = protocols;

+ 1 - 1
Classes/Utility/Runtime/Objc/FLEXProperty.m

@@ -176,7 +176,7 @@
 }
 
 - (NSString *)fullDescription {
-    NSMutableArray<NSString *> *attributesStrings = [NSMutableArray array];
+    NSMutableArray<NSString *> *attributesStrings = [NSMutableArray new];
     FLEXPropertyAttributes *attributes = self.attributes;
 
     // Atomicity

+ 5 - 5
Classes/Utility/Runtime/Objc/FLEXProtocol.m

@@ -28,7 +28,7 @@
     unsigned int prcount;
     Protocol *__unsafe_unretained*protocols = objc_copyProtocolList(&prcount);
     
-    NSMutableArray *all = [NSMutableArray array];
+    NSMutableArray *all = [NSMutableArray new];
     for(NSUInteger i = 0; i < prcount; i++)
         [all addObject:[self protocol:protocols[i]]];
     
@@ -73,22 +73,22 @@
     struct objc_method_description *objcrmethods = protocol_copyMethodDescriptionList(self.objc_protocol, YES, YES, &mdrcount);
     struct objc_method_description *objcomethods = protocol_copyMethodDescriptionList(self.objc_protocol, NO, YES, &mdocount);
     
-    NSMutableArray *properties = [NSMutableArray array];
+    NSMutableArray *properties = [NSMutableArray new];
     for (int i = 0; i < prcount; i++)
         [properties addObject:[FLEXProperty property:objcproperties[i]]];
     _properties = properties;
     
-    NSMutableArray *protocols = [NSMutableArray array];
+    NSMutableArray *protocols = [NSMutableArray new];
     for (int i = 0; i < pccount; i++)
         [protocols addObject:[FLEXProtocol protocol:objcprotocols[i]]];
     _protocols = protocols;
     
-    NSMutableArray *requiredMethods = [NSMutableArray array];
+    NSMutableArray *requiredMethods = [NSMutableArray new];
     for (int i = 0; i < mdrcount; i++)
         [requiredMethods addObject:[FLEXMethodDescription description:objcrmethods[i]]];
     _requiredMethods = requiredMethods;
     
-    NSMutableArray *optionalMethods = [NSMutableArray array];
+    NSMutableArray *optionalMethods = [NSMutableArray new];
     for (int i = 0; i < mdocount; i++)
         [optionalMethods addObject:[FLEXMethodDescription description:objcomethods[i]]];
     _optionalMethods = optionalMethods;

+ 1 - 1
FLEXTests/FLEXTestsMethodsList.m

@@ -81,7 +81,7 @@
 #pragma mark - Method to test with
 
 - (NSArray *)prettyArgumentComponentsForMethod:(Method)method {
-    NSMutableArray *components = [NSMutableArray array];
+    NSMutableArray *components = [NSMutableArray new];
     
     NSString *selectorName = NSStringFromSelector(method_getName(method));
     NSArray *selectorComponents = [selectorName componentsSeparatedByString:@":"];