Skip to content

Commit

Permalink
Android: Remove SuppressFBWarnings
Browse files Browse the repository at this point in the history
Findbugs has been removed. Keeping comments as they are good for context
and still contain relevant information on threading etc. Also makes
removing easier.

Will remove actual file in follow-up CL to reduce revert-churn. TBR for
cross-repo refactoring.

BUG=777511
TBR=dtrainor@chromium.org,jochen@chromium.org,torne@chromium.org,peter@chromium.org,yusufo@chromium.org,mdjones@chromium.org

Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Iec9c044375b9fd68ed605515381026e00a3c5431
Reviewed-on: https://chromium-review.googlesource.com/772399
Commit-Queue: Peter Wen <wnwen@chromium.org>
Reviewed-by: John Budorick <jbudorick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517116}
  • Loading branch information
Peter Wen authored and Commit Bot committed Nov 16, 2017
1 parent c6fd275 commit cb12512
Show file tree
Hide file tree
Showing 171 changed files with 3 additions and 412 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
import android.webkit.WebSettings.ZoomDensity;

import org.chromium.android_webview.AwSettings;
import org.chromium.base.annotations.SuppressFBWarnings;

/**
* Type adaptation layer between {@link android.webkit.WebSettings} and
* {@link org.chromium.android_webview.AwSettings}.
*/
@SuppressWarnings({"deprecation", "NoSynchronizedMethodCheck"})
@SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD")
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public class ContentSettingsAdapter extends android.webkit.WebSettings {
private AwSettings mAwSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@

import org.chromium.android_webview.AwCookieManager;
import org.chromium.base.Log;
import org.chromium.base.annotations.SuppressFBWarnings;

/**
* Chromium implementation of CookieManager -- forwards calls to the
* chromium internal implementation.
*/
@SuppressWarnings({"deprecation", "NoSynchronizedMethodCheck"})
@SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD")
public class CookieManagerAdapter extends CookieManager {
private static final String TAG = "CookieManager";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
package com.android.webview.chromium;

import org.chromium.android_webview.AwServiceWorkerSettings;
import org.chromium.base.annotations.SuppressFBWarnings;

/**
* Type adaptation layer between {@link android.webkit.ServiceWorkerWebSettings}
* and {@link org.chromium.android_webview.AwServiceWorkerSettings}.
*/
@SuppressWarnings("NoSynchronizedMethodCheck")
@SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD")
public class ServiceWorkerSettingsAdapter extends android.webkit.ServiceWorkerWebSettings {
private AwServiceWorkerSettings mAwServiceWorkerSettings;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import android.webkit.WebBackForwardList;
import android.webkit.WebHistoryItem;

import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.content_public.browser.NavigationHistory;

import java.util.ArrayList;
Expand All @@ -18,7 +17,6 @@
* wrapper around NavigationHistory.
*/
@SuppressWarnings("NoSynchronizedMethodCheck")
@SuppressFBWarnings({"CHROMIUM_SYNCHRONIZED_METHOD", "SE_BAD_FIELD"})
public class WebBackForwardListChromium extends WebBackForwardList {
private final List<WebHistoryItemChromium> mHistroryItemList;
private final int mCurrentIndex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import android.graphics.Bitmap;
import android.webkit.WebHistoryItem;

import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.content_public.browser.NavigationEntry;

/**
Expand Down Expand Up @@ -81,8 +80,6 @@ private WebHistoryItemChromium(String url, String originalUrl, String title, Bit
* See {@link android.webkit.WebHistoryItem#clone}.
*/
@SuppressWarnings("NoSynchronizedMethodCheck")
@SuppressFBWarnings({"CHROMIUM_SYNCHRONIZED_METHOD", "CN_IDIOM_NO_SUPER_CALL",
"CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE"})
@Override
public synchronized WebHistoryItemChromium
clone() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
import org.chromium.android_webview.ResourcesContextWrapperFactory;
import org.chromium.android_webview.renderer_priority.RendererPriority;
import org.chromium.base.ThreadUtils;
import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.components.autofill.AutofillProvider;
import org.chromium.content.browser.SmartClipProvider;
import org.chromium.content_public.browser.NavigationHistory;
Expand Down Expand Up @@ -1175,7 +1174,6 @@ public void run() {
mAwContents.findAllAsync(searchString);
}

@SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE")
@Override
public boolean showFindDialog(final String text, final boolean showIme) {
mFactory.startYourEngines(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
import org.chromium.base.VisibleForTesting;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.blink_public.web.WebReferrerPolicy;
import org.chromium.components.autofill.AutofillProvider;
import org.chromium.components.navigation_interception.InterceptNavigationDelegate;
Expand Down Expand Up @@ -1041,7 +1040,6 @@ public WindowAndroid getWindowAndroid() {

// getWindowAndroid is only called on UI thread, so there are no threading issues with lazy
// initialization.
@SuppressFBWarnings("LI_LAZY_INIT_STATIC")
private static WindowAndroidWrapper getWindowAndroid(Context context) {
if (sContextWindowMap == null) sContextWindowMap = new WeakHashMap<>();
WindowAndroidWrapper wrapper = sContextWindowMap.get(context);
Expand Down Expand Up @@ -2891,7 +2889,6 @@ public void invokeVisualStateCallback(
}

// Called as a result of nativeUpdateLastHitTestData.
@SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
@CalledByNative
private void updateHitTestData(
int type, String extra, String href, String anchorText, String imgSrc) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.chromium.android_webview.permission.AwPermissionRequest;
import org.chromium.base.Callback;
import org.chromium.base.Log;
import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.content_public.common.ContentUrlConstants;

import java.security.Principal;
Expand Down Expand Up @@ -96,7 +95,6 @@ final void onBackgroundColorChanged(int color) {
/**
* Parameters for the {@link AwContentsClient#shouldInterceptRequest} method.
*/
@SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
public static class AwWebResourceRequest {
// Url of the request.
public String url;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.chromium.base.CommandLine;
import org.chromium.base.Log;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.base.annotations.SuppressFBWarnings;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
Expand Down Expand Up @@ -79,7 +78,6 @@ private static boolean getCommandLineOptIn() {
* @return true if app has opted in, false if opted out, and null if no preference specified.
*/
@Nullable
@SuppressFBWarnings("NP_BOOLEAN_RETURN_NULL")
private static Boolean getAppOptInPreference(Context appContext) {
try {
ApplicationInfo info = appContext.getPackageManager().getApplicationInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import android.os.StrictMode;

import org.chromium.base.CommandLine;
import org.chromium.base.annotations.SuppressFBWarnings;

/**
* Utility class for WebView's CommandLine - this is compiled into a separate target that can be
Expand All @@ -31,7 +30,6 @@ public static boolean isBuildDebuggable() {
* Initialize the CommandLine for WebView - this should be initialized on the same thread where
* we subsequently access CommandLine.
*/
@SuppressFBWarnings("DMI_HARDCODED_ABSOLUTE_FILENAME")
public static void initCommandLine() {
if (isBuildDebuggable()) {
// Suppress the StrictMode violation as this codepath is only hit on debuggable builds.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.chromium.android_webview.test.util.CommonResources;
import org.chromium.android_webview.test.util.JavascriptEventObserver;
import org.chromium.base.ThreadUtils;
import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.base.test.util.CallbackHelper;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.RetryOnFailure;
Expand All @@ -44,7 +43,6 @@
* Integration tests for synchronous scrolling.
*/
@RunWith(AwJUnit4ClassRunner.class)
@SuppressFBWarnings("DLS_DEAD_LOCAL_STORE")
public class AndroidScrollIntegrationTest {
@Rule
public AwActivityTestRule mActivityTestRule = new AwActivityTestRule() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.chromium.android_webview.AwContents;
import org.chromium.base.Callback;
import org.chromium.base.ThreadUtils;
import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.UrlUtils;

Expand Down Expand Up @@ -124,7 +123,6 @@ public void testAutoGoodPath() throws Throwable {
@Test
@SmallTest
@Feature({"AndroidWebView"})
@SuppressFBWarnings("DMI_HARDCODED_ABSOLUTE_FILENAME")
public void testExplicitBadPath() throws Throwable {
final String path = new File("/foo/bar/baz.mht").getAbsolutePath();
deleteFile(path);
Expand All @@ -138,7 +136,6 @@ public void testExplicitBadPath() throws Throwable {
@Test
@SmallTest
@Feature({"AndroidWebView"})
@SuppressFBWarnings("DMI_HARDCODED_ABSOLUTE_FILENAME")
public void testAutoBadPath() throws Throwable {
final String path = new File("/foo/bar/").getAbsolutePath();
deleteFile(path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.chromium.android_webview.AwContentsClient;
import org.chromium.android_webview.test.util.CommonResources;
import org.chromium.android_webview.test.util.JSUtils;
import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.base.test.util.CallbackHelper;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.base.test.util.Feature;
Expand Down Expand Up @@ -798,7 +797,6 @@ public void testDoubleNavigateDoesNotSuppressInitialNavigate() throws Throwable
}

@Test
@SuppressFBWarnings("DLS_DEAD_LOCAL_STORE")
@SmallTest
@Feature({"AndroidWebView"})
public void testCallDestroyInCallback() throws Throwable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.chromium.android_webview.AwGLFunctor;
import org.chromium.android_webview.test.AwActivityTestRule.TestDependencyFactory;
import org.chromium.base.ThreadUtils;
import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.base.test.util.Feature;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
Expand Down Expand Up @@ -63,7 +62,6 @@ public void tearDown() throws Exception {
mOverridenFactory = null;
}

@SuppressFBWarnings("URF_UNREAD_FIELD")
private static class StrongRefTestContext extends ContextWrapper {
private AwContents mAwContents;
public void setAwContentsStrongRef(AwContents awContents) {
Expand All @@ -90,7 +88,6 @@ public AwTestContainerView createAwTestContainerView(
}
}

@SuppressFBWarnings("URF_UNREAD_FIELD")
private static class StrongRefTestAwContentsClient extends TestAwContentsClient {
private AwContents mAwContentsStrongRef;
public void setAwContentsStrongRef(AwContents awContents) {
Expand Down Expand Up @@ -123,7 +120,6 @@ public void testCreateAndGcOneTime() throws Throwable {

@Test
@DisableHardwareAccelerationForTest
@SuppressFBWarnings("UC_USELESS_OBJECT")
@SmallTest
@Feature({"AndroidWebView"})
public void testHoldKeyboardResultReceiver() throws Throwable {
Expand Down Expand Up @@ -290,7 +286,6 @@ class Test {
mValue = value;
mAwContents = awContents;
}
@SuppressFBWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
@JavascriptInterface
public int getValue() {
return mValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.junit.runner.RunWith;

import org.chromium.android_webview.AwContentsStatics;
import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.base.test.util.CallbackHelper;
import org.chromium.base.test.util.Feature;

Expand All @@ -21,7 +20,6 @@
*/
@RunWith(AwJUnit4ClassRunner.class)
public class AwContentsStaticsTest {
@SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
@Rule
public AwActivityTestRule mActivityTestRule = new AwActivityTestRule();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.chromium.android_webview.test.TestAwContentsClient.OnDownloadStartHelper;
import org.chromium.android_webview.test.util.CommonResources;
import org.chromium.base.ThreadUtils;
import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.base.test.util.CallbackHelper;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.Feature;
Expand Down Expand Up @@ -454,7 +453,6 @@ public void testEscapingOfErrorPage() throws Throwable {
}

@Test
@SuppressFBWarnings("DLS_DEAD_LOCAL_STORE")
@Feature({"AndroidWebView"})
@SmallTest
public void testCanInjectHeaders() throws Throwable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.junit.runner.RunWith;

import org.chromium.android_webview.AwDebug;
import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.parameter.SkipCommandLineParameterization;

Expand All @@ -30,7 +29,6 @@
@RunWith(AwJUnit4ClassRunner.class)
@SkipCommandLineParameterization
public class AwDebugTest {
@SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
@Rule
public AwActivityTestRule mActivityTestRule = new AwActivityTestRule();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
import org.junit.runner.RunWith;

import org.chromium.android_webview.AwFormDatabase;
import org.chromium.base.annotations.SuppressFBWarnings;

/** AwFormDatabaseTest. */
@RunWith(AwJUnit4ClassRunner.class)
public class AwFormDatabaseTest {
@SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
@Rule
public AwActivityTestRule mActivityTestRule = new AwActivityTestRule();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.junit.runner.RunWith;

import org.chromium.android_webview.AwContents;
import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.base.test.util.Feature;

/**
Expand Down Expand Up @@ -48,7 +47,6 @@ public void testDestroyFromJavaObject() throws Throwable {
mActivityTestRule.createAwTestContainerViewOnMainSync(client2);
final AwContents awContents = mTestContainerView.getAwContents();

@SuppressFBWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
class Test {
@JavascriptInterface
public void destroy() {
Expand Down Expand Up @@ -100,7 +98,6 @@ class Test {
Test(int value) {
mValue = value;
}
@SuppressFBWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
@JavascriptInterface
public int getValue() {
return mValue;
Expand Down Expand Up @@ -137,7 +134,6 @@ class Test {
Test(int value) {
mValue = value;
}
@SuppressFBWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
@JavascriptInterface
public int getValue() {
return mValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.chromium.android_webview.AwContents;
import org.chromium.android_webview.AwContentsClient;
import org.chromium.android_webview.AwSettings;
import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.base.test.util.CallbackHelper;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.RetryOnFailure;
Expand Down Expand Up @@ -142,7 +141,6 @@ public void testZeroValuesQuirk() throws Throwable {
}

@Test
@SuppressFBWarnings("DLS_DEAD_LOCAL_STORE")
@MediumTest
@Feature({"AndroidWebView"})
public void testScreenSizeInPhysicalPixelsQuirk() throws Throwable {
Expand Down
Loading

0 comments on commit cb12512

Please sign in to comment.