Bug 1258789 - Add WhitespaceAround for ASSIGN token. r=grisha
authorMichael Comella <michael.l.comella@gmail.com>
Tue, 12 Apr 2016 18:07:33 -0700
changeset 316834 4aec5484727310c0ddba1d05142095391f570140
parent 316833 30b59b826bf51c828d5af28e24ec3254e4515999
child 316835 2581aa4a58e94998a75878242cbbd6cd4dfd2d0f
push id9480
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 17:12:58 +0000
treeherdermozilla-aurora@0d6a91c76a9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgrisha
bugs1258789
milestone48.0a1
Bug 1258789 - Add WhitespaceAround for ASSIGN token. r=grisha MozReview-Commit-ID: 6IOIatuHuYW
mobile/android/app/checkstyle.xml
mobile/android/base/java/org/mozilla/gecko/ActionBarTextSelection.java
mobile/android/base/java/org/mozilla/gecko/AndroidGamepadManager.java
mobile/android/base/java/org/mozilla/gecko/GeckoSmsManager.java
mobile/android/base/java/org/mozilla/gecko/home/HomeFragment.java
mobile/android/base/java/org/mozilla/gecko/util/FileUtils.java
mobile/android/base/java/org/mozilla/gecko/util/GamepadUtils.java
mobile/android/base/java/org/mozilla/gecko/widget/DateTimePicker.java
--- a/mobile/android/app/checkstyle.xml
+++ b/mobile/android/app/checkstyle.xml
@@ -48,11 +48,14 @@
         <module name="NoLineWrap">
             <property name="tokens" value="IMPORT,PACKAGE_DEF"/>
         </module>
         <module name="OuterTypeFilename"/> <!-- `class Lol` only in Lol.java -->
         <module name="WhitespaceAfter">
             <!-- TODO: (bug 1263059) Remove specific tokens to enable CAST check. -->
             <property name="tokens" value="COMMA, SEMI"/>
         </module>
+        <module name="WhitespaceAround">
+            <property name="tokens" value="ASSIGN"/>
+        </module>
     </module>
 
 </module>
--- a/mobile/android/base/java/org/mozilla/gecko/ActionBarTextSelection.java
+++ b/mobile/android/base/java/org/mozilla/gecko/ActionBarTextSelection.java
@@ -147,17 +147,17 @@ class ActionBarTextSelection extends Lay
 
         ThreadUtils.postToUiThread(new Runnable() {
             @Override
             public void run() {
                 try {
                     if (event.equals("TextSelection:ShowHandles")) {
                         selectionID = message.getString("selectionID");
                         final JSONArray handles = message.getJSONArray("handles");
-                        for (int i=0; i < handles.length(); i++) {
+                        for (int i = 0; i < handles.length(); i++) {
                             String handle = handles.getString(i);
                             getHandle(handle).setVisibility(View.VISIBLE);
                         }
 
                         mViewLeft = 0.0f;
                         mViewTop = 0.0f;
                         mViewZoom = 0.0f;
 
@@ -188,17 +188,17 @@ class ActionBarTextSelection extends Lay
                         mActionModeTimer.schedule(mActionModeTimerTask, SHUTDOWN_DELAY_MS);
 
                         anchorHandle.setVisibility(View.GONE);
                         caretHandle.setVisibility(View.GONE);
                         focusHandle.setVisibility(View.GONE);
 
                     } else if (event.equals("TextSelection:PositionHandles")) {
                         final JSONArray positions = message.getJSONArray("positions");
-                        for (int i=0; i < positions.length(); i++) {
+                        for (int i = 0; i < positions.length(); i++) {
                             JSONObject position = positions.getJSONObject(i);
                             final int left = position.getInt("left");
                             final int top = position.getInt("top");
                             final boolean rtl = position.getBoolean("rtl");
 
                             TextSelectionHandle handle = getHandle(position.getString("handle"));
                             handle.setVisibility(position.getBoolean("hidden") ? View.GONE : View.VISIBLE);
                             handle.positionFromGecko(left, top, rtl);
--- a/mobile/android/base/java/org/mozilla/gecko/AndroidGamepadManager.java
+++ b/mobile/android/base/java/org/mozilla/gecko/AndroidGamepadManager.java
@@ -296,17 +296,17 @@ public class AndroidGamepadManager {
         return true;
     }
 
     private static void scanForGamepads() {
         int[] deviceIds = InputDevice.getDeviceIds();
         if (deviceIds == null) {
             return;
         }
-        for (int i=0; i < deviceIds.length; i++) {
+        for (int i = 0; i < deviceIds.length; i++) {
             InputDevice device = InputDevice.getDevice(deviceIds[i]);
             if (device == null) {
                 continue;
             }
             if ((device.getSources() & InputDevice.SOURCE_GAMEPAD) != InputDevice.SOURCE_GAMEPAD) {
                 continue;
             }
             addGamepad(device);
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoSmsManager.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoSmsManager.java
@@ -74,17 +74,17 @@ class Envelope
     mId = aId;
     mMessageId = -1;
     mError = GeckoSmsManager.kNoError;
 
     int size = SubParts.values().length;
     mRemainingParts = new int[size];
     mFailing = new boolean[size];
 
-    for (int i=0; i<size; ++i) {
+    for (int i = 0; i < size; ++i) {
       mRemainingParts[i] = aParts;
       mFailing[i] = false;
     }
   }
 
   public void decreaseRemainingParts(SubParts aType) {
     --mRemainingParts[aType.ordinal()];
 
@@ -150,17 +150,17 @@ class Postman
 
   public int createEnvelope(int aParts) {
     /*
      * We are going to create the envelope in the first empty slot in the array
      * list. If there is no empty slot, we create a new one.
      */
     int size = mEnvelopes.size();
 
-    for (int i=0; i<size; ++i) {
+    for (int i = 0; i < size; ++i) {
       if (mEnvelopes.get(i) == null) {
         mEnvelopes.set(i, new Envelope(i, aParts));
         return i;
       }
     }
 
     mEnvelopes.add(new Envelope(size, aParts));
     return size;
@@ -593,17 +593,17 @@ public class GeckoSmsManager
         sentIntent.putExtras(bundle);
         deliveredIntent.putExtras(bundle);
 
         ArrayList<PendingIntent> sentPendingIntents =
           new ArrayList<PendingIntent>(parts.size());
         ArrayList<PendingIntent> deliveredPendingIntents =
           new ArrayList<PendingIntent>(parts.size());
 
-        for (int i=0; i<parts.size(); ++i) {
+        for (int i = 0; i < parts.size(); ++i) {
           sentPendingIntents.add(
             PendingIntent.getBroadcast(GeckoAppShell.getContext(),
                                        pendingIntentGuid.incrementAndGet(), sentIntent,
                                        PendingIntent.FLAG_CANCEL_CURRENT)
           );
 
           deliveredPendingIntents.add(
             PendingIntent.getBroadcast(GeckoAppShell.getContext(),
--- a/mobile/android/base/java/org/mozilla/gecko/home/HomeFragment.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/HomeFragment.java
@@ -50,17 +50,17 @@ import android.view.View;
 /**
  * HomeFragment is an empty fragment that can be added to the HomePager.
  * Subclasses can add their own views.
  * <p>
  * The containing activity <b>must</b> implement {@link OnUrlOpenListener}.
  */
 public abstract class HomeFragment extends Fragment {
     // Log Tag.
-    private static final String LOGTAG="GeckoHomeFragment";
+    private static final String LOGTAG = "GeckoHomeFragment";
 
     // Share MIME type.
     protected static final String SHARE_MIME_TYPE = "text/plain";
 
     // Default value for "can load" hint
     static final boolean DEFAULT_CAN_LOAD_HINT = false;
 
     // Whether the fragment can load its content or not
--- a/mobile/android/base/java/org/mozilla/gecko/util/FileUtils.java
+++ b/mobile/android/base/java/org/mozilla/gecko/util/FileUtils.java
@@ -9,17 +9,17 @@ import android.util.Log;
 import java.io.File;
 import java.io.IOException;
 import java.io.FilenameFilter;
 import java.util.Scanner;
 
 import org.mozilla.gecko.annotation.RobocopTarget;
 
 public class FileUtils {
-    private static final String LOGTAG= "GeckoFileUtils";
+    private static final String LOGTAG = "GeckoFileUtils";
     /*
     * A basic Filter for checking a filename and age.
     **/
     static public class NameAndAgeFilter implements FilenameFilter {
         final private String mName;
         final private double mMaxAge;
 
         public NameAndAgeFilter(String name, double age) {
--- a/mobile/android/base/java/org/mozilla/gecko/util/GamepadUtils.java
+++ b/mobile/android/base/java/org/mozilla/gecko/util/GamepadUtils.java
@@ -122,17 +122,17 @@ public final class GamepadUtils {
         // The cross and circle buttons on Sony Xperia phones are swapped
         // in different regions
         // http://developer.sonymobile.com/2011/02/13/xperia-play-game-keys/
         final char DEFAULT_O_BUTTON_LABEL = 0x25CB;
 
         boolean swapped = false;
         int[] deviceIds = InputDevice.getDeviceIds();
 
-        for (int i= 0; deviceIds != null && i < deviceIds.length; i++) {
+        for (int i = 0; deviceIds != null && i < deviceIds.length; i++) {
             KeyCharacterMap keyCharacterMap = KeyCharacterMap.load(deviceIds[i]);
             if (keyCharacterMap != null && DEFAULT_O_BUTTON_LABEL ==
                 keyCharacterMap.getDisplayLabel(KeyEvent.KEYCODE_DPAD_CENTER)) {
                 swapped = true;
                 break;
             }
         }
         return swapped;
--- a/mobile/android/base/java/org/mozilla/gecko/widget/DateTimePicker.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/DateTimePicker.java
@@ -628,30 +628,30 @@ public class DateTimePicker extends Fram
         } else {
             mAMPMSpinner.setVisibility(GONE);
         }
     }
 
     private void setHourShown(boolean shown) {
         if (shown) {
             mHourSpinner.setVisibility(VISIBLE);
-            mHourEnabled= true;
+            mHourEnabled = true;
         } else {
             mHourSpinner.setVisibility(GONE);
             mAMPMSpinner.setVisibility(GONE);
             mTimeSpinners.setVisibility(GONE);
             mHourEnabled = false;
         }
     }
 
     private void setMinuteShown(boolean shown) {
         if (shown) {
             mMinuteSpinner.setVisibility(VISIBLE);
             mTimeSpinners.findViewById(R.id.mincolon).setVisibility(VISIBLE);
-            mMinuteEnabled= true;
+            mMinuteEnabled = true;
         } else {
             mMinuteSpinner.setVisibility(GONE);
             mTimeSpinners.findViewById(R.id.mincolon).setVisibility(GONE);
             mMinuteEnabled = false;
         }
     }
 
     private void setCurrentLocale(Locale locale) {