Format Java code in xplat/js/react-native-github

Summary:
This diff formats the Java class files inside xplat/js/react-native-github. Since google-java-format was enabled in D16071401 we want to codemode the existing code so that users don't have to deal with formatter lint noise at diff-time.

```arc f --paths-cmd 'hg files -I "**/*.java"'```

drop-conflicts

Reviewed By: cpojer

Differential Revision: D16071725

fbshipit-source-id: fc6e3852e45742c109f0c5ac4065d64201c74204
This commit is contained in:
Oleksandr Melnykov authored and Facebook Github Bot committed 2019-07-02 04:16:46 -07:00
1 parent 61e95e5cbf
commit 6c0f73b322
681 files changed
+14082 -16365

No files matched your search

@@ -1,10 +1,9 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.facebook.react.uimanager;
import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;
@@ -28,8 +27,8 @@ import javax.annotation.Nullable;
/**
* Generates a lazy discovery enabled version of {@link UIManagerModule} constants. It only
* contains a list of view manager names, so that JS side is aware of the managers there are.
* Actual ViewManager instantiation happens when
* {@code UIManager.getViewManagerConfig('SpecificViewManager')} call happens. The View Manager is then
* Actual ViewManager instantiation happens when {@code
* UIManager.getViewManagerConfig('SpecificViewManager')} call happens. The View Manager is then
* registered on the JS side with the help of {@code UIManagerModule.getConstantsForViewManager}.
*/
/* package */ static Map<String, Object> createConstants(
@@ -49,21 +48,19 @@ import javax.annotation.Nullable;
}
/**
* Generates map of constants that is then exposed by {@link UIManagerModule}.
* Provided list of {@param viewManagers} is then used to populate content of
* those predefined fields using
* {@link ViewManager#getExportedCustomBubblingEventTypeConstants} and
* {@link ViewManager#getExportedCustomDirectEventTypeConstants} respectively. Each view manager
* is in addition allowed to expose viewmanager-specific constants that are placed under the key
* that corresponds to the view manager's name (see {@link ViewManager#getName}). Constants are
* merged into the map of {@link UIManagerModule} base constants that is stored in
* {@link UIManagerModuleConstants}.
* TODO(6845124): Create a test for this
* Generates map of constants that is then exposed by {@link UIManagerModule}. Provided list of
* {@param viewManagers} is then used to populate content of those predefined fields using {@link
* ViewManager#getExportedCustomBubblingEventTypeConstants} and {@link
* ViewManager#getExportedCustomDirectEventTypeConstants} respectively. Each view manager is in
* addition allowed to expose viewmanager-specific constants that are placed under the key that
* corresponds to the view manager's name (see {@link ViewManager#getName}). Constants are merged
* into the map of {@link UIManagerModule} base constants that is stored in {@link
* UIManagerModuleConstants}. TODO(6845124): Create a test for this
*/
/* package */ static Map<String, Object> createConstants(
List<ViewManager> viewManagers,
@Nullable Map<String, Object> allBubblingEventTypes,
@Nullable Map<String, Object> allDirectEventTypes) {
List<ViewManager> viewManagers,
@Nullable Map<String, Object> allBubblingEventTypes,
@Nullable Map<String, Object> allDirectEventTypes) {
Map<String, Object> constants = UIManagerModuleConstants.getConstants();
// Generic/default event types:
@@ -92,12 +89,9 @@ import javax.annotation.Nullable;
.flush();
try {
Map viewManagerConstants = createConstantsForViewManager(
viewManager,
null,
null,
allBubblingEventTypes,
allDirectEventTypes);
Map viewManagerConstants =
createConstantsForViewManager(
viewManager, null, null, allBubblingEventTypes, allDirectEventTypes);
if (!viewManagerConstants.isEmpty()) {
constants.put(viewManagerName, viewManagerConstants);
}
@@ -153,9 +147,7 @@ import javax.annotation.Nullable;
return viewManagerConstants;
}
/**
* Merges {@param source} map into {@param dest} map recursively
*/
/** Merges {@param source} map into {@param dest} map recursively */
private static void recursiveMerge(@Nullable Map dest, @Nullable Map source) {
if (dest == null || source == null || source.isEmpty()) {
return;