Skip to content

Commit

Permalink
Fix Android comment and docblock typos
Browse files Browse the repository at this point in the history
Summary:
:wave: Hello! Thanks for react-native, it’s a great project.

I was digging into the Android implementation in _ReactAndroid_ and noticed a couple typos in the documentation. I went through and tried to fix all the typos I could find using [aspell](http://aspell.net).

Not applicable: these changes are only to comments, and CI should be skipped.

[ANDROID][ENHANCEMENT][*] - Correct comment and docblock typos
Closes #17049

Differential Revision: D6472182

Pulled By: shergin

fbshipit-source-id: 7e62cab118609596b483d1cf16c3abf651d6753b
  • Loading branch information
swashcap authored and facebook-github-bot committed Dec 4, 2017
1 parent ba60751 commit d2f0abd
Show file tree
Hide file tree
Showing 36 changed files with 37 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

/**
* Mock Networking module that records last request received by {@link #sendRequest} method and
* returns reponse code and body that should be set with {@link #setResponse}
* returns response code and body that should be set with {@link #setResponse}
*/
@ReactModule(name = "Networking", canOverrideExistingModule = true)
public class NetworkRecordingModuleMock extends ReactContextBaseJavaModule {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void testMultitouchEvents() throws InterruptedException {
assertEquals(-1, endEventIndex);
endEventIndex = i;
} else if (call.equals("move;2")) {
// this will happen more than once, let's just capture the last occurence
// this will happen more than once, let's just capture the last occurrence
moveWithBothPointersEventIndex = i;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
* Integration test to verify passing various types of parameters from JS to Java works
*
* TODO: we should run these tests with isBlockingSynchronousMethod = true as well,
* since they currrently use a completely different codepath
* since they currently use a completely different codepath
*/
@Ignore("Fix prop types and view managers.")
public class CatalystNativeJSToJavaParametersTestCase extends ReactIntegrationTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* | +----------------------------------------------------------------------------------+ |
* +---------------------------------------------------------------------------------------+
*
* Then in each test case we eiter tap the center of a particular view (from A to E) or we start
* Then in each test case we either tap the center of a particular view (from A to E) or we start
* a gesture in one view and end it with another.
* View with names in brackets (e.g. {D}) have touch handlers set whereas all other views are not
* declared to handler touch events.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Test case to verify that JSResponder flow work correctly.
*
* In a single test case scenario we have a view with pan gesture recognizer containing a scrollview
* We werify that by vertical drags affects a scrollview while horizontal drags are suppose to
* We verify that by vertical drags affects a scrollview while horizontal drags are suppose to
* be recognized by pan responder and setJSResponder should be triggered resulting in scrollview
* events being intercepted.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public ReactInstanceManagerBuilder setJSBundleFile(String jsBundleFile) {

/**
* Bundle loader to use when setting up JS environment. This supersedes
* prior invcations of {@link setJSBundleFile} and {@link setBundleAssetName}.
* prior invocations of {@link setJSBundleFile} and {@link setBundleAssetName}.
*
* Example: {@code JSBundleLoader.createFileLoader(application, bundleFile)}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
* that coordinates all the action: {@link NativeAnimatedNodesManager}. Since all the methods from
* {@link NativeAnimatedNodesManager} need to be called from the UI thread, we we create a queue of
* animated graph operations that is then enqueued to be executed in the UI Thread at the end of the
* batch of JS->native calls (similarily to how it's handled in {@link UIManagerModule}). This
* batch of JS->native calls (similarly to how it's handled in {@link UIManagerModule}). This
* isolates us from the problems that may be caused by concurrent updates of animated graph while UI
* thread is "executing" the animation loop.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

/**
* Base class for {@link AnimationPropertyUpdater} subclasses that updates a pair of float property
* values. It helps to handle convertion from animation progress to the actual values as
* values. It helps to handle conversion from animation progress to the actual values as
* well as the quite common case when no starting value is provided.
*/
public abstract class AbstractFloatPairPropertyUpdater implements AnimationPropertyUpdater {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

/**
* Base class for {@link AnimationPropertyUpdater} subclasses that updates a single float property
* value. It helps to handle convertion from animation progress to the actual value as well as the
* value. It helps to handle conversion from animation progress to the actual value as well as the
* quite common case when no starting value is provided.
*/
public abstract class AbstractSingleFloatProperyUpdater implements AnimationPropertyUpdater {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public interface AnimationPropertyUpdater {

/**
* This method will be called at the end of animation. It should be used to set the final values
* for animated properties in order to avoid floating point inacurracy calculated in
* for animated properties in order to avoid floating point inaccuracy calculated in
* {@link #onUpdate} by passing value close to 1.0 or in a case some frames got dropped.
*
* @param view view to update property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* 3/ {@link ReadableArray} mapped from JS Array
* 4/ {@link ReadableMap} mapped from JS Object
* 5/ {@link Callback} mapped from js function and can be used only as a last parameter or in the
* case when it express success & error callback pair as two last arguments respecively.
* case when it express success & error callback pair as two last arguments respectively.
*
* All methods exposed as native to JS with {@link ReactMethod} annotation must return
* {@code void}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
package com.facebook.react.bridge;

/**
* Type representing a piece of data with unkown runtime type. Useful for allowing javascript to
* Type representing a piece of data with unknown runtime type. Useful for allowing javascript to
* pass one of multiple types down to the native layer.
*/
public interface Dynamic {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public String loadScript(CatalystInstanceImpl instance) {

/**
* This loader loads bundle from file system. The bundle will be read in native code to save on
* passing large strings from java to native memorory.
* passing large strings from java to native memory.
*/
public static JSBundleLoader createFileLoader(final String fileName) {
return createFileLoader(fileName, fileName, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.util.List;

/**
* Java {@link ArrayList} backed impementation of {@link ReadableArray} and {@link WritableArray}
* Java {@link ArrayList} backed implementation of {@link ReadableArray} and {@link WritableArray}
* Instances of this class SHOULD NOT be used for communication between java and JS, use instances
* of {@link WritableNativeArray} created via {@link Arguments#createArray} or just
* {@link ReadableArray} interface if you want your "native" module method to take an array from JS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.util.Map;

/**
* Java {@link HashMap} backed impementation of {@link ReadableMap} and {@link WritableMap}
* Java {@link HashMap} backed implementation of {@link ReadableMap} and {@link WritableMap}
* Instances of this class SHOULD NOT be used for communication between java and JS, use instances
* of {@link WritableNativeMap} created via {@link Arguments#createMap} or just {@link ReadableMap}
* interface if you want your "native" module method to take a map from JS as an argument.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private ArrayList<ModuleHolder> getBatchCompleteListenerModules() {
}

/*
* Adds any new modules to the current module regsitry
* Adds any new modules to the current module registry
*/
/* package */ void registerModules(NativeModuleRegistry newRegister) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.json.JSONObject;

/**
* Tracks errors connecting to or received from the debug derver.
* Tracks errors connecting to or received from the debug server.
* The debug server returns errors as json objects. This exception represents that error.
*/
public class DebugServerException extends RuntimeException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
*
* One can use 'debug_http_host' shared preferences key to provide a host name for the debug server.
* If the setting is empty we support and detect two basic configuration that works well for android
* emulators connectiong to debug server running on emulator's host:
* emulators connection to debug server running on emulator's host:
* - Android stock emulator with standard non-configurable local loopback alias: 10.0.2.2,
* - Genymotion emulator with default settings: 10.0.3.2
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ public boolean hasUpToDateJSBundleInCache() {
PackageInfo thisPackage = mApplicationContext.getPackageManager()
.getPackageInfo(packageName, 0);
if (mJSBundleTempFile.lastModified() > thisPackage.lastUpdateTime) {
// Base APK has not been updated since we donwloaded JS, but if app is using exopackage
// Base APK has not been updated since we downloaded JS, but if app is using exopackage
// it may only be a single dex that has been updated. We check for exopackage dir update
// time in that case.
File exopackageDir = new File(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class FlatUIImplementation extends UIImplementation {

/**
* Build the map of view managers, checking that the managers FlatUI requires are correctly
* overriden.
* overridden.
*/
private static Map<String, ViewManager> buildViewManagerMap(List<ViewManager> viewManagers) {
Map<String, ViewManager> viewManagerMap = new HashMap<>();
Expand Down Expand Up @@ -149,7 +149,7 @@ protected ReactShadowNode createRootShadowNode() {
if (mRCTImageViewManager != null) {
// This is not the best place to initialize DraweeRequestHelper, but order of module
// initialization is undefined, and this is pretty much the earliest when we are guarantied
// that Fresco is initalized and DraweeControllerBuilder can be queried. This also happens
// that Fresco is initialized and DraweeControllerBuilder can be queried. This also happens
// relatively rarely to have any performance considerations.
mReactContext.getNativeModule(FrescoModule.class); // initialize Fresco
DraweeRequestHelper.setDraweeControllerBuilder(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
private ReactShadowNode[] mChildren = new ReactShadowNodeImpl[4];

/**
* Retuns size of underlying moveTo/moveFrom arrays
* Returns size of underlying moveTo/moveFrom arrays
*/
public int size() {
return mSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
static Object sCallerContext = RCTImageView.class;

/**
* Assignes a CallerContext to execute network requests with.
* Assigns a CallerContext to execute network requests with.
*/
/* package */ static void setCallerContext(Object callerContext) {
sCallerContext = callerContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void afterUpdateViewHierarchy(EventDispatcher eventDispatcher) {
}

/**
* Enqueue dropping of the view for a node that has a backing view. Used in conjuction with
* Enqueue dropping of the view for a node that has a backing view. Used in conjunction with
* remove the node from the shadow hierarchy.
*
* @param node The node to drop the backing view for.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ public void run() {
}

// In the case where the frame callback isn't enqueued, the UI isn't being displayed or is being
// destroyed. In this case it's no longer important to align to frames, but it is imporant to make
// destroyed. In this case it's no longer important to align to frames, but it is important to make
// sure any late-arriving UI commands are executed.
if (!mIsDispatchUIFrameCallbackEnqueued) {
UiThreadUtil.runOnUiThread(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public final T createView(

/**
* This method should return a subclass of {@link ReactShadowNode} which will be then used for
* measuring position and size of the view. In mose of the cases this should just return an
* measuring position and size of the view. In most of the cases this should just return an
* instance of {@link ReactShadowNode}
*/
public C createShadowNodeInstance() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
* set in which case default type will be send to JS based on the type of value argument from the
* setter method (e.g. for {@code int}, {@code double} default is "number", for
* {@code ReadableArray} it's "Array"). Custom type may be used when additional processing of the
* value needs to be done in JS before sending it over the brige. A good example of that would be
* value needs to be done in JS before sending it over the bridge. A good example of that would be
* backgroundColor property, which is expressed as a {@code String} in JS, but we use
* {@code processColor} JS module to convert it to {@code int} before sending over the bridge.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

/**
* Create an animation object for the current animation type, based on the view and final screen
* coordinates. If the application-supplied configuraiton does not specify an animation definition
* coordinates. If the application-supplied configuration does not specify an animation definition
* for this types, or if the animation definition is invalid, returns null.
*/
abstract @Nullable Animation createAnimationImpl(View view, int x, int y, int width, int height);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* TextEdit}.
*
* <p>This is a "shadowing" view manager, which means that the {@link NativeViewHierarchyManager}
* will NOT manage children of native {@link TextView} instances instanciated by this manager.
* will NOT manage children of native {@link TextView} instances instantiated by this manager.
* Instead we use @{link ReactBaseTextShadowNode} hierarchy to calculate a {@link Spannable} text
* represented the whole text subtree.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

/**
* Represents a click on the toolbar.
* Position is meaningful when the click happenned on a menu
* Position is meaningful when the click happened on a menu
*/
public class ToolbarClickEvent extends Event<ToolbarClickEvent> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public void setUrlPrefixesForDefaultIntent(ReadableArray specialUrls) {

/**
* Subclass of {@link WebView} that implements {@link LifecycleEventListener} interface in order
* to call {@link WebView#destroy} on activty destroy event and also to clear the client
* to call {@link WebView#destroy} on activity destroy event and also to clear the client
*/
protected static class ReactWebView extends WebView implements LifecycleEventListener {
protected @Nullable String injectedJS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import com.facebook.proguard.annotations.DoNotStrip;

/**
* Inteface for recieving logs from native layer. Use by setting YogaNode.setLogger(myLogger);
* Interface for receiving logs from native layer. Use by setting YogaNode.setLogger(myLogger);
* See YogaLogLevel for the different log levels.
*/
@DoNotStrip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ struct FunctionWrapper {
}
};

// registration wrappers for non-static methods, with autoconvertion of arguments.
// registration wrappers for non-static methods, with autoconversion of arguments.
template<typename M, M method, typename C, typename R, typename... Args>
struct MethodWrapper {
using jhybrid = typename C::jhybridobject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ std::string utf16toUTF8(const uint16_t* utf16Bytes, size_t len) noexcept;

class FBEXPORT LocalString {
public:
// Assumes UTF8 encoding and make a required convertion to modified UTF-8 when the string
// Assumes UTF8 encoding and make a required conversion to modified UTF-8 when the string
// contains unicode supplementary characters.
explicit LocalString(const std::string& str);
explicit LocalString(const char* str);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void testDecomposing4x4MatrixToProduceAccurateXaxisAngles() {
@Test
public void testDecomposingComplex4x4MatrixToProduceAccurateAngles() {
verifyRotatedMatrix(10, -80, 0, 10, -80, 0);
// x and y will filp
// x and y will flip
verifyRotatedMatrix(10, -95, 0, -170, -85, -180);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.robolectric.RobolectricTestRunner;

/**
* Test {@link ReactProp} annotation for {@link ReactShadowNode}. More comprahensive test of this
* Test {@link ReactProp} annotation for {@link ReactShadowNode}. More comprehensive test of this
* annotation can be found in {@link ReactPropAnnotationSetterTest} where we test all possible types
* of properties to be updated.
*/
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-instrumentation-tests-via-adb-shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def update():
# prevent CircleCI from killing the process for inactivity
while not done:
time.sleep(5)
print "Running in background. Waiting for 'adb' command reponse..."
print "Running in background. Waiting for 'adb' command response..."
t = threading.Thread(target=update)
t.dameon = True
Expand Down

0 comments on commit d2f0abd

Please sign in to comment.