Bug 1240500 - Pre: whitespace cleanup and unnecessary comment cleanup r=me draft
authorAndrzej Hunt <ahunt@mozilla.com>
Thu, 25 Feb 2016 14:47:40 -0800
changeset 334724 315cb89a66c74674b47da9e5e02fed7e53ce440a
parent 334723 675f335b6b44b0a85aa8a8d5066cbeaaf3d1bc64
child 334725 0bf316bf963ad4b38dda6946a5934d2b94e172b2
child 334727 66dd11d9079cebb5b798eef86361d43b1f955e98
push id11621
push userahunt@mozilla.com
push dateThu, 25 Feb 2016 23:14:22 +0000
reviewersme
bugs1240500
milestone47.0a1
Bug 1240500 - Pre: whitespace cleanup and unnecessary comment cleanup r=me MozReview-Commit-ID: FDOsOUSitk4
mobile/android/base/java/org/mozilla/gecko/home/SearchEngineRow.java
--- a/mobile/android/base/java/org/mozilla/gecko/home/SearchEngineRow.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/SearchEngineRow.java
@@ -171,17 +171,16 @@ class SearchEngineRow extends AnimatedHe
     private void refreshOccurrencesWith(String pattern, String string) {
         mOccurrences.clear();
         final int patternLength = pattern.length();
         int indexOfMatch = 0;
         int lastIndexOfMatch = 0;
         while(indexOfMatch != -1) {
             indexOfMatch = string.indexOf(pattern, lastIndexOfMatch);
             lastIndexOfMatch = indexOfMatch + patternLength;
-            // Crash here?
             if(indexOfMatch != -1) {
                 mOccurrences.add(indexOfMatch);
             }
         }
     }
 
     /**
      * Sets the content for the suggestion view.
@@ -206,17 +205,17 @@ class SearchEngineRow extends AnimatedHe
         final String searchTerm = getSuggestionTextFromView(mUserEnteredView);
         final int searchTermLength = searchTerm.length();
         refreshOccurrencesWith(searchTerm, suggestion);
         if (mOccurrences.size() > 0) {
             final SpannableStringBuilder sb = new SpannableStringBuilder(suggestion);
             int nextStartSpanIndex = 0;
             // Done to make sure that the stretch of text after the last occurrence, till the end of the suggestion, is made bold
             mOccurrences.add(suggestion.length());
-            for(int occurrence : mOccurrences) {
+            for (int occurrence : mOccurrences) {
                 // Even though they're the same style, SpannableStringBuilder will interpret there as being only one Span present if we re-use a StyleSpan
                 StyleSpan boldSpan = new StyleSpan(Typeface.BOLD);
                 sb.setSpan(boldSpan, nextStartSpanIndex, occurrence, Spannable.SPAN_INCLUSIVE_INCLUSIVE);
                 nextStartSpanIndex = occurrence + searchTermLength;
             }
             mOccurrences.clear();
             suggestionText.setText(sb);
         } else {