Commit e06dd3e6 authored by Nate Fischer's avatar Nate Fischer Committed by Commit Bot

AW: reorder modifiers in //android_webview

No change to logic.

This reorders Java modifiers to conform to the JLS style guide, which is
enforced by a new presubmit check (https://crrev.com/c/1803140).

This also adds curly braces to for loops, as this is also a presubmit
requirement.

Bug: 1003711
Test: git cl presubmit --upload
Change-Id: Ice355c6453b4e88c28dacc07d91ade61a1e2d09c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1823813
Auto-Submit: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: default avatarTao Bai <michaelbai@chromium.org>
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699904}
parent 13376e73
...@@ -17,7 +17,7 @@ import org.chromium.base.annotations.NativeMethods; ...@@ -17,7 +17,7 @@ import org.chromium.base.annotations.NativeMethods;
*/ */
@JNINamespace("android_webview") @JNINamespace("android_webview")
@MainDex @MainDex
final public class AwFeatureList { public final class AwFeatureList {
// Do not instantiate this class. // Do not instantiate this class.
private AwFeatureList() {} private AwFeatureList() {}
......
...@@ -53,7 +53,7 @@ public class AndroidViewIntegrationTest { ...@@ -53,7 +53,7 @@ public class AndroidViewIntegrationTest {
private static final int CONTENT_SIZE_CHANGE_STABILITY_TIMEOUT_MS = 1000; private static final int CONTENT_SIZE_CHANGE_STABILITY_TIMEOUT_MS = 1000;
private static class OnContentSizeChangedHelper extends CallbackHelper { private static class OnContentSizeChangedHelper extends CallbackHelper {
final private Object mLock = new Object(); private final Object mLock = new Object();
@GuardedBy("mLock") @GuardedBy("mLock")
private int mWidth; private int mWidth;
@GuardedBy("mLock") @GuardedBy("mLock")
......
...@@ -59,7 +59,9 @@ public class AwContentCaptureTest { ...@@ -59,7 +59,9 @@ public class AwContentCaptureTest {
mWhiteList.toArray(whitelist); mWhiteList.toArray(whitelist);
isRegEx = new boolean[mWhiteList.size()]; isRegEx = new boolean[mWhiteList.size()];
int i = 0; int i = 0;
for (boolean r : mIsRegEx) isRegEx[i++] = r; for (boolean r : mIsRegEx) {
isRegEx[i++] = r;
}
} }
setWhitelist(whitelist, isRegEx); setWhitelist(whitelist, isRegEx);
} }
...@@ -69,12 +71,12 @@ public class AwContentCaptureTest { ...@@ -69,12 +71,12 @@ public class AwContentCaptureTest {
} }
private static class TestAwContentCaptureConsumer extends ContentCaptureConsumer { private static class TestAwContentCaptureConsumer extends ContentCaptureConsumer {
private final static long DEFAULT_TIMEOUT_IN_SECONDS = 30; private static final long DEFAULT_TIMEOUT_IN_SECONDS = 30;
public final static int CONTENT_CAPTURED = 1; public static final int CONTENT_CAPTURED = 1;
public final static int CONTENT_UPDATED = 2; public static final int CONTENT_UPDATED = 2;
public final static int CONTENT_REMOVED = 3; public static final int CONTENT_REMOVED = 3;
public final static int SESSION_REMOVED = 4; public static final int SESSION_REMOVED = 4;
public TestAwContentCaptureConsumer(WebContents webContents) { public TestAwContentCaptureConsumer(WebContents webContents) {
super(webContents); super(webContents);
...@@ -114,7 +116,9 @@ public class AwContentCaptureTest { ...@@ -114,7 +116,9 @@ public class AwContentCaptureTest {
mCurrentFrameSession = session; mCurrentFrameSession = session;
mRemovedIds = removedIds; mRemovedIds = removedIds;
// Remove the id from removedIds because id can be reused. // Remove the id from removedIds because id can be reused.
for (long id : removedIds) mCapturedContentIds.remove(id); for (long id : removedIds) {
mCapturedContentIds.remove(id);
}
mCallbacks.add(CONTENT_REMOVED); mCallbacks.add(CONTENT_REMOVED);
mCallbackHelper.notifyCalled(); mCallbackHelper.notifyCalled();
} }
...@@ -174,7 +178,9 @@ public class AwContentCaptureTest { ...@@ -174,7 +178,9 @@ public class AwContentCaptureTest {
public int[] getCallbacks() { public int[] getCallbacks() {
int[] result = new int[mCallbacks.size()]; int[] result = new int[mCallbacks.size()];
int index = 0; int index = 0;
for (Integer c : mCallbacks) result[index++] = c; for (Integer c : mCallbacks) {
result[index++] = c;
}
return result; return result;
} }
...@@ -192,8 +198,8 @@ public class AwContentCaptureTest { ...@@ -192,8 +198,8 @@ public class AwContentCaptureTest {
private CallbackHelper mCallbackHelper = new CallbackHelper(); private CallbackHelper mCallbackHelper = new CallbackHelper();
} }
private final static String MAIN_FRAME_FILE = "/main_frame.html"; private static final String MAIN_FRAME_FILE = "/main_frame.html";
private final static String SECOND_PAGE = "/second_page.html"; private static final String SECOND_PAGE = "/second_page.html";
@Rule @Rule
public AwActivityTestRule mRule = new AwActivityTestRule(); public AwActivityTestRule mRule = new AwActivityTestRule();
...@@ -295,8 +301,9 @@ public class AwContentCaptureTest { ...@@ -295,8 +301,9 @@ public class AwContentCaptureTest {
throws Exception { throws Exception {
if (expected == null && (result == null || result.isEmpty())) return; if (expected == null && (result == null || result.isEmpty())) return;
Assert.assertEquals(expected.size(), result.size()); Assert.assertEquals(expected.size(), result.size());
for (int i = 0; i < expected.size(); i++) for (int i = 0; i < expected.size(); i++) {
verifyFrame(expected.get(i).getId(), expected.get(i).getValue(), result.get(i)); verifyFrame(expected.get(i).getId(), expected.get(i).getValue(), result.get(i));
}
} }
private static void verifyContent(Set<String> expectedContent, Set<Long> unexpectedIds, private static void verifyContent(Set<String> expectedContent, Set<Long> unexpectedIds,
...@@ -340,7 +347,9 @@ public class AwContentCaptureTest { ...@@ -340,7 +347,9 @@ public class AwContentCaptureTest {
private static void verifyRemovedIds(Set<Long> expectedIds, long[] result) throws Exception { private static void verifyRemovedIds(Set<Long> expectedIds, long[] result) throws Exception {
Assert.assertEquals(expectedIds.size(), result.length); Assert.assertEquals(expectedIds.size(), result.length);
Set<Long> resultSet = new HashSet<Long>(result.length); Set<Long> resultSet = new HashSet<Long>(result.length);
for (long id : result) resultSet.add(id); for (long id : result) {
resultSet.add(id);
}
Assert.assertTrue(expectedIds.containsAll(resultSet)); Assert.assertTrue(expectedIds.containsAll(resultSet));
} }
...@@ -386,7 +395,9 @@ public class AwContentCaptureTest { ...@@ -386,7 +395,9 @@ public class AwContentCaptureTest {
private FrameSession createFrameSession(ContentCaptureData... frames) { private FrameSession createFrameSession(ContentCaptureData... frames) {
FrameSession result = new FrameSession(frames.length); FrameSession result = new FrameSession(frames.length);
for (ContentCaptureData f : frames) result.addAll(createFrameSession(f)); for (ContentCaptureData f : frames) {
result.addAll(createFrameSession(f));
}
return result; return result;
} }
...@@ -397,13 +408,17 @@ public class AwContentCaptureTest { ...@@ -397,13 +408,17 @@ public class AwContentCaptureTest {
private static Set<String> toStringSet(String... strings) { private static Set<String> toStringSet(String... strings) {
Set<String> result = new HashSet<String>(); Set<String> result = new HashSet<String>();
for (String s : strings) result.add(s); for (String s : strings) {
result.add(s);
}
return result; return result;
} }
private static Set<Long> toLongSet(Long... longs) { private static Set<Long> toLongSet(Long... longs) {
Set<Long> result = new HashSet<Long>(); Set<Long> result = new HashSet<Long>();
for (Long s : longs) result.add(s); for (Long s : longs) {
result.add(s);
}
return result; return result;
} }
......
...@@ -1084,7 +1084,7 @@ public class AwContentsClientShouldOverrideUrlLoadingTest { ...@@ -1084,7 +1084,7 @@ public class AwContentsClientShouldOverrideUrlLoadingTest {
verifyShouldOverrideUrlLoadingInPopup(popupPath, popupPath + "/"); verifyShouldOverrideUrlLoadingInPopup(popupPath, popupPath + "/");
} }
private final static String BAD_SCHEME = "badscheme://"; private static final String BAD_SCHEME = "badscheme://";
// AwContentsClient handling an invalid network scheme // AwContentsClient handling an invalid network scheme
private static class BadSchemeClient extends TestAwContentsClient { private static class BadSchemeClient extends TestAwContentsClient {
......
...@@ -71,7 +71,7 @@ public class CookieManagerTest { ...@@ -71,7 +71,7 @@ public class CookieManagerTest {
private TestAwContentsClient mContentsClient; private TestAwContentsClient mContentsClient;
private AwContents mAwContents; private AwContents mAwContents;
private final static String SECURE_COOKIE_HISTOGRAM_NAME = "Android.WebView.SecureCookieAction"; private static final String SECURE_COOKIE_HISTOGRAM_NAME = "Android.WebView.SecureCookieAction";
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
......
...@@ -33,10 +33,10 @@ import java.util.List; ...@@ -33,10 +33,10 @@ import java.util.List;
@RunWith(AwJUnit4ClassRunner.class) @RunWith(AwJUnit4ClassRunner.class)
@OnlyRunIn(SINGLE_PROCESS) @OnlyRunIn(SINGLE_PROCESS)
public class UploadedCrashesInfoLoaderTest { public class UploadedCrashesInfoLoaderTest {
private final static String TEST_UPLOAD_TIME_STR = "1234567890"; private static final String TEST_UPLOAD_TIME_STR = "1234567890";
private final static long TEST_UPLOAD_TIME = Long.parseLong(TEST_UPLOAD_TIME_STR); private static final long TEST_UPLOAD_TIME = Long.parseLong(TEST_UPLOAD_TIME_STR);
private final static String TEST_UPLOAD_ID = "0123456789abcdef"; private static final String TEST_UPLOAD_ID = "0123456789abcdef";
private final static String TEST_LOCAL_ID = "fedcba9876543210"; private static final String TEST_LOCAL_ID = "fedcba9876543210";
private File mLogFile; private File mLogFile;
......
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