Commit 2709b62f authored by Henrique Nakashima's avatar Henrique Nakashima Committed by Commit Bot

Fix some presubmit warnings in preparation for a large refactor.

Specifically, order of modifiers and explicit braces.

Refactor:
https://chromium-review.googlesource.com/c/chromium/src/+/1901635

Bug: 889467

Change-Id: Idac01679dd7aa69360e65ea473b4b420ea46386b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1904446Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713612}
parent 5cb55d9c
......@@ -250,8 +250,9 @@ public class FindAddress {
private static boolean checkHouseNumber(String houseNumber) {
// Make sure that there are at most 5 digits.
int digitCount = 0;
for (int i = 0; i < houseNumber.length(); ++i)
for (int i = 0; i < houseNumber.length(); ++i) {
if (Character.isDigit(houseNumber.charAt(i))) ++digitCount;
}
if (digitCount > 5) return false;
// Make sure that any ordinals are valid.
......@@ -324,8 +325,9 @@ public class FindAddress {
if (stateMatch == null) return false;
// Work out the index of the state, based on which group matched.
int stateIndex = stateMatch.groupCount();
while (stateIndex > 0)
while (stateIndex > 0) {
if (stateMatch.group(stateIndex--) != null) break;
}
return sZipCodeRe.matcher(zipCode).matches()
&& sStateZipCodeRanges[stateIndex].matches(zipCode);
}
......
......@@ -192,7 +192,7 @@ public abstract class AnnotationProcessingUtils {
* Abstraction to hide differences between Class, Method and Description with regards to their
* annotations and what should be analyzed next.
*/
private static abstract class AnnotatedNode {
private abstract static class AnnotatedNode {
@Nullable
abstract AnnotatedNode getParent();
......
......@@ -74,8 +74,8 @@ import java.util.HashSet;
*/
class ManualFillingMediator extends EmptyTabObserver
implements KeyboardAccessoryCoordinator.VisibilityDelegate, View.OnLayoutChangeListener {
static private final int MINIMAL_AVAILABLE_VERTICAL_SPACE = 128; // in DP.
static private final int MINIMAL_AVAILABLE_HORIZONTAL_SPACE = 180; // in DP.
private static final int MINIMAL_AVAILABLE_VERTICAL_SPACE = 128; // in DP.
private static final int MINIMAL_AVAILABLE_HORIZONTAL_SPACE = 180; // in DP.
private PropertyModel mModel = ManualFillingProperties.createFillingModel();
private WindowAndroid mWindowAndroid;
......
......@@ -25,7 +25,7 @@ import java.util.ArrayList;
* and its sheet for the {@link WebContents} it is attached to.
*/
class ManualFillingState {
private final static int[] TAB_ORDER = {
private static final int[] TAB_ORDER = {
AccessoryTabType.PASSWORDS,
AccessoryTabType.CREDIT_CARDS,
AccessoryTabType.ADDRESSES,
......
......@@ -33,7 +33,7 @@ public abstract class AccessorySheetTabCoordinator implements KeyboardAccessoryD
* Provides the icon used for a sheet. Simplifies mocking in controller tests.
*/
@VisibleForTesting
static public class IconProvider {
public static class IconProvider {
private static Drawable sTestIcon;
/**
......
......@@ -62,9 +62,10 @@ public class ContextualSearchRankerLoggerImpl implements ContextualSearchInterac
public ContextualSearchRankerLoggerImpl(
ContextualSearchInteractionPersister interactionPersister) {
mInteractionPersister = interactionPersister;
if (isEnabled())
if (isEnabled()) {
mNativePointer = ContextualSearchRankerLoggerImplJni.get().init(
ContextualSearchRankerLoggerImpl.this);
}
}
/**
......@@ -74,7 +75,7 @@ public class ContextualSearchRankerLoggerImpl implements ContextualSearchInterac
* not.
*/
@VisibleForTesting
protected final static String outcomeName(@Feature int feature) {
protected static final String outcomeName(@Feature int feature) {
switch (feature) {
case Feature.OUTCOME_WAS_PANEL_OPENED:
return "OutcomeWasPanelOpened";
......@@ -97,7 +98,7 @@ public class ContextualSearchRankerLoggerImpl implements ContextualSearchInterac
* expected to be logged.
*/
@VisibleForTesting
protected final static String featureName(@Feature int feature) {
protected static final String featureName(@Feature int feature) {
// NOTE: this list needs to be kept in sync with the white list in
// predictor_config_definitions.cc and with ukm.xml!
switch (feature) {
......
......@@ -11,7 +11,7 @@ import org.chromium.base.annotations.NativeMethods;
* A class containing some utility static methods for rename.
*/
public class RenameUtils {
static private boolean sIsDisabledNativeForTesting;
private static boolean sIsDisabledNativeForTesting;
/**
* Determine the extension of a downloaded item.
......
......@@ -68,7 +68,7 @@ public class SectionList extends InnerNode<NewTabPageViewHolder, PartialBindCall
* Returns whether prefetched suggestions metrics should be reported for a given category.
* @param category given category to check.
*/
static public boolean shouldReportPrefetchedSuggestionsMetrics(@CategoryInt int category) {
public static boolean shouldReportPrefetchedSuggestionsMetrics(@CategoryInt int category) {
return category == KnownCategories.ARTICLES && !NetworkChangeNotifier.isOnline();
}
......
......@@ -332,10 +332,11 @@ public class DecoderServiceHost
@DecodeVideoTask.DecodingResult int decodingResult) {
switch (decodingResult) {
case DecodeVideoTask.DecodingResult.SUCCESS:
if (bitmaps == null || bitmaps.size() == 0)
if (bitmaps == null || bitmaps.size() == 0) {
mFailedVideoDecodesUnknown++;
else
} else {
mSuccessfulVideoDecodes++;
}
break;
case DecodeVideoTask.DecodingResult.FILE_ERROR:
mFailedVideoDecodesFile++;
......
......@@ -258,8 +258,9 @@ public class SnackbarManager implements OnClickListener, InfoBarContainer.InfoBa
if (AccessibilityUtil.isAccessibilityEnabled()) {
durationMs *= 2;
if (durationMs < sAccessibilitySnackbarDurationMs)
if (durationMs < sAccessibilitySnackbarDurationMs) {
durationMs = sAccessibilitySnackbarDurationMs;
}
}
return durationMs;
......
......@@ -109,8 +109,9 @@ public class TracingNotificationManager {
// selecting the stop button, so choose a different message.
AccessibilityManager am =
(AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);
if (am.isEnabled() && am.isTouchExplorationEnabled())
if (am.isEnabled() && am.isTouchExplorationEnabled()) {
message = MSG_ACTIVE_NOTIFICATION_ACCESSIBILITY_MESSAGE;
}
sTracingActiveNotificationBuilder =
createNotificationBuilder()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment