Skip to content

Commit

Permalink
Format Java code in xplat/js/react-native-github
Browse files Browse the repository at this point in the history
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
  • Loading branch information
makovkastar authored and facebook-github-bot committed Jul 2, 2019
1 parent 61e95e5 commit 6c0f73b
Show file tree
Hide file tree
Showing 681 changed files with 14,035 additions and 16,318 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
/**
* 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.uiapp;

import android.os.Bundle;

import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;

import javax.annotation.Nullable;

public class RNTesterActivity extends ReactActivity {
Expand All @@ -31,10 +27,11 @@ protected void onCreate(Bundle savedInstanceState) {
// Get remote param before calling super which uses it
Bundle bundle = mActivity.getIntent().getExtras();
if (bundle != null && bundle.containsKey(PARAM_ROUTE)) {
String routeUri = new StringBuilder("rntester://example/")
.append(bundle.getString(PARAM_ROUTE))
.append("Example")
.toString();
String routeUri =
new StringBuilder("rntester://example/")
.append(bundle.getString(PARAM_ROUTE))
.append("Example")
.toString();
mInitialProps = new Bundle();
mInitialProps.putString("exampleFromAppetizeParams", routeUri);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,49 +1,44 @@
/**
* 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.uiapp;

import android.app.Application;

import com.facebook.react.BuildConfig;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.react.views.text.ReactFontManager;

import java.util.Arrays;
import java.util.List;

public class RNTesterApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public String getJSMainModuleName() {
return "RNTester/js/RNTesterApp.android";
}

@Override
public String getBundleAssetName() {
return "RNTesterApp.android.bundle";
}

@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}

@Override
public List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage()
);
}
};
private final ReactNativeHost mReactNativeHost =
new ReactNativeHost(this) {
@Override
public String getJSMainModuleName() {
return "RNTester/js/RNTesterApp.android";
}

@Override
public String getBundleAssetName() {
return "RNTesterApp.android.bundle";
}

@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}

@Override
public List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(new MainReactPackage());
}
};

@Override
public void onCreate() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
/**
* 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.testing;

import com.facebook.react.bridge.BaseJavaModule;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.ReactMethod;
import java.util.ArrayList;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;

import com.facebook.react.bridge.BaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.testing.ReactInstanceSpecForTest;
import com.facebook.react.testing.ReactAppInstrumentationTestCase;

/**
* Shared by {@link ReactScrollViewTestCase} and {@link ReactHorizontalScrollViewTestCase}.
* See also ScrollViewTestModule.js
* Shared by {@link ReactScrollViewTestCase} and {@link ReactHorizontalScrollViewTestCase}. See also
* ScrollViewTestModule.js
*/
public abstract class AbstractScrollViewTestCase extends ReactAppInstrumentationTestCase {

Expand All @@ -38,8 +34,7 @@ protected void tearDown() throws Exception {
@Override
protected ReactInstanceSpecForTest createReactInstanceSpecForTest() {
mScrollListenerModule = new ScrollListenerModule();
return super.createReactInstanceSpecForTest()
.addNativeModule(mScrollListenerModule);
return super.createReactInstanceSpecForTest().addNativeModule(mScrollListenerModule);
}

// See ScrollViewListenerModule.js
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
/**
* 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.testing;

import javax.annotation.Nullable;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;

import com.facebook.react.bridge.BaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import javax.annotation.Nullable;

import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;

/**
* NativeModule for tests that allows assertions from JS to propagate to Java.
*/
/** NativeModule for tests that allows assertions from JS to propagate to Java. */
public class AssertModule extends BaseJavaModule {

private boolean mGotSuccess;
Expand Down
Original file line number Diff line number Diff line change
@@ -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.testing;

import com.facebook.react.bridge.Arguments;
Expand All @@ -14,12 +13,11 @@
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.WritableMap;

/**
* Dummy implementation of storage module, used for testing
*/
/** Dummy implementation of storage module, used for testing */
public final class FakeAsyncLocalStorage extends BaseJavaModule {

private static WritableMap errorMessage;

static {
errorMessage = Arguments.createMap();
errorMessage.putString("message", "Fake Async Local Storage");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
/**
* 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.testing;

import javax.annotation.Nullable;

import com.facebook.react.bridge.BaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import javax.annotation.Nullable;

/**
* Dummy implementation of storage module, used for testing
*/
/** Dummy implementation of storage module, used for testing */
public final class FakeWebSocketModule extends BaseJavaModule {

@Override
Expand All @@ -31,21 +27,17 @@ public boolean canOverrideExistingModule() {

@ReactMethod
public void connect(
final String url,
@Nullable final ReadableArray protocols,
@Nullable final ReadableMap headers,
final int id) {
}
final String url,
@Nullable final ReadableArray protocols,
@Nullable final ReadableMap headers,
final int id) {}

@ReactMethod
public void close(int code, String reason, int id) {
}
public void close(int code, String reason, int id) {}

@ReactMethod
public void send(String message, int id) {
}
public void send(String message, int id) {}

@ReactMethod
public void sendBinary(String base64String, int id) {
}
public void sendBinary(String base64String, int id) {}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
/**
* 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.testing;

import java.util.List;

import android.view.View;

import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.uimanager.ViewManager;
import com.facebook.react.ReactPackage;
import java.util.List;

/**
* This class wraps {@class ReactInstanceSpecForTest} in {@class ReactPackage} interface.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
/**
* 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.testing;

import com.facebook.react.bridge.BaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

import com.facebook.react.bridge.BaseJavaModule;
import com.facebook.react.bridge.ReactMethod;

/**
* Native module provides single method {@link #record} which records its single int argument
* in calls array
* Native module provides single method {@link #record} which records its single int argument in
* calls array
*/
public class IntRecordingModule extends BaseJavaModule {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
/**
* 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.testing;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

import com.facebook.react.bridge.BaseJavaModule;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.ReactMethod;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

/**
* This class is used to verify that some JS integration tests have completed successfully.
* The JS integration tests can be started from a ReactIntegrationTestCase and upon
* finishing successfully the {@link JSIntegrationTestChecker#testDone()} method will be called.
* To verify if the test has completed successfully, call {#link JSIntegrationTestChecker#await()}
* to wait for the test to run, and {#link JSIntegrationTestChecker#isTestDone()} to check if it
* completed successfully.
* This class is used to verify that some JS integration tests have completed successfully. The JS
* integration tests can be started from a ReactIntegrationTestCase and upon finishing successfully
* the {@link JSIntegrationTestChecker#testDone()} method will be called. To verify if the test has
* completed successfully, call {#link JSIntegrationTestChecker#await()} to wait for the test to
* run, and {#link JSIntegrationTestChecker#isTestDone()} to check if it completed successfully.
*/
public class JSIntegrationTestChecker extends BaseJavaModule {

Expand All @@ -41,8 +38,7 @@ public void markTestCompleted() {
}

@ReactMethod
public void verifySnapshot(Callback callback) {
}
public void verifySnapshot(Callback callback) {}

public boolean await(long ms) {
try {
Expand Down
Original file line number Diff line number Diff line change
@@ -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.testing;

import java.io.PrintWriter;
Expand Down
Loading

0 comments on commit 6c0f73b

Please sign in to comment.