Android: Disable findbugs

Now that we have errorprone enabled by default, we get faster static
analysis with fewer false positives. Findbugs is no longer necessary.

This CL also unblocks upgrading errorprone to 2.1.2. The rest of the
findbugs annotations and gn args will be removed later.

BUG=777511

Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I9c32f3773f44a7c58813c0ef6a35a81dc9818178
Reviewed-on: https://chromium-review.googlesource.com/734220
Reviewed-by: agrieve <agrieve@chromium.org>
Reviewed-by: John Budorick <jbudorick@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Reviewed-by: Egor Pasko <pasko@chromium.org>
Reviewed-by: Andrei Kapishnikov <kapishnikov@chromium.org>
Commit-Queue: Peter Wen <wnwen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#514187}
diff --git a/build/android/findbugs_diff.py b/build/android/findbugs_diff.py
deleted file mode 100755
index 9ca4520..0000000
--- a/build/android/findbugs_diff.py
+++ /dev/null
@@ -1,129 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Runs findbugs, and returns an error code if there are new warnings.
-
-Other options
-  --only-analyze used to only analyze the class you are interested.
-  --relase-build analyze the classes in out/Release directory.
-  --findbugs-args used to passin other findbugs's options.
-
-Run
-  $CHROMIUM_SRC/third_party/findbugs/bin/findbugs -textui for details.
-
-"""
-
-import argparse
-import os
-import sys
-
-import devil_chromium
-from devil.utils import run_tests_helper
-
-from pylib.constants import host_paths
-from pylib.utils import findbugs
-
-_DEFAULT_BASE_DIR = os.path.join(
-    host_paths.DIR_SOURCE_ROOT, 'build', 'android', 'findbugs_filter')
-
-sys.path.append(
-    os.path.join(host_paths.DIR_SOURCE_ROOT, 'build', 'android', 'gyp'))
-from util import build_utils # pylint: disable=import-error
-
-
-def main():
-  parser = argparse.ArgumentParser()
-
-  parser.add_argument(
-      '-v', '--verbose', action='count', help='Enable verbose logging.')
-  parser.add_argument(
-      '--system-jar', default=None, dest='system_jars', action='append',
-      help='System JAR for analysis.')
-  parser.add_argument(
-      '-a', '--auxclasspath', default=None, dest='auxclasspath',
-      help='Set aux classpath for analysis.')
-  parser.add_argument(
-      '--auxclasspath-gyp', dest='auxclasspath_gyp',
-      help='A gyp list containing the aux classpath for analysis')
-  parser.add_argument(
-      '-o', '--only-analyze', default=None,
-      dest='only_analyze', help='Only analyze the given classes and packages.')
-  parser.add_argument(
-      '-e', '--exclude', default=None, dest='exclude',
-      help='Exclude bugs matching given filter.')
-  parser.add_argument(
-      '-l', '--release-build', action='store_true', dest='release_build',
-      help='Analyze release build instead of debug.')
-  parser.add_argument(
-      '-f', '--findbug-args', default=None, dest='findbug_args',
-      help='Additional findbug arguments.')
-  parser.add_argument(
-      '-b', '--base-dir', default=_DEFAULT_BASE_DIR,
-      dest='base_dir', help='Base directory for configuration file.')
-  parser.add_argument(
-      '--output-file', dest='output_file',
-      help='Path to save the output to.')
-  parser.add_argument(
-      '--stamp', help='Path to touch on success.')
-  parser.add_argument(
-      '--depfile', help='Path to the depfile. This must be specified as the '
-                        "action's first output.")
-
-  parser.add_argument(
-      'jar_paths', metavar='JAR_PATH', nargs='+',
-      help='JAR file to analyze')
-
-  args = parser.parse_args(build_utils.ExpandFileArgs(sys.argv[1:]))
-
-  run_tests_helper.SetLogLevel(args.verbose)
-
-  devil_chromium.Initialize()
-
-  if args.auxclasspath:
-    args.auxclasspath = args.auxclasspath.split(':')
-  elif args.auxclasspath_gyp:
-    args.auxclasspath = build_utils.ParseGnList(args.auxclasspath_gyp)
-
-  if args.base_dir:
-    if not args.exclude:
-      args.exclude = os.path.join(args.base_dir, 'findbugs_exclude.xml')
-
-  findbugs_command, findbugs_errors, findbugs_warnings = findbugs.Run(
-      args.exclude, args.only_analyze, args.system_jars, args.auxclasspath,
-      args.output_file, args.findbug_args, args.jar_paths)
-
-  if findbugs_warnings or findbugs_errors:
-    print
-    print '*' * 80
-    print 'FindBugs run via:'
-    print findbugs_command
-    if findbugs_errors:
-      print
-      print 'FindBugs encountered the following errors:'
-      for error in sorted(findbugs_errors):
-        print str(error)
-      print '*' * 80
-      print
-    if findbugs_warnings:
-      print
-      print 'FindBugs reported the following issues:'
-      for warning in sorted(findbugs_warnings):
-        print str(warning)
-      print '*' * 80
-      print
-  else:
-    if args.depfile:
-      deps = args.auxclasspath + args.jar_paths
-      build_utils.WriteDepfile(args.depfile, args.output_file, deps)
-    if args.stamp:
-      build_utils.Touch(args.stamp)
-
-  return len(findbugs_errors) + len(findbugs_warnings)
-
-
-if __name__ == '__main__':
-  sys.exit(main())
-
diff --git a/build/android/findbugs_filter/findbugs_exclude.xml b/build/android/findbugs_filter/findbugs_exclude.xml
deleted file mode 100644
index d5c4476..0000000
--- a/build/android/findbugs_filter/findbugs_exclude.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright (c) 2012 The Chromium Authors. All rights reserved.
-  Use of this source code is governed by a BSD-style license that can be
-  found in the LICENSE file.
--->
-
-<!--
-Documentation: http://findbugs.sourceforge.net/manual/filter.html
-In particular, ~ at the start of a string means it's a regex.
--->
-<FindBugsFilter>
-  <!-- Skip the generated resource classes (including nested classes). -->
-  <Match>
-    <Class name="~.*\.R(\$\w+)?" />
-  </Match>
-  <!-- Skip the generated Manifest class (including nested classes). -->
-  <Match>
-    <Class name="~.*\.Manifest(\$\w+)?" />
-  </Match>
-  <Bug pattern="DM_STRING_CTOR" />
-  <!-- Ignore "reliance on default String encoding" warnings, as we're not multi-platform -->
-  <Bug pattern="DM_DEFAULT_ENCODING" />
-  <!--
-  Legacy code, discouraged on Android:
-  https://developer.android.com/reference/java/security/AccessController.html
-  -->
-  <Bug pattern="DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED" />
-  <!--
-  Ignore unchecked casts.
-  See https://groups.google.com/a/chromium.org/forum/#!topic/java/xfXmNLI4SqM for details.
-  -->
-  <Bug pattern="BC_UNCONFIRMED_CAST" />
-
-  <!-- Ignore unused public rules and implementations thereof in instrumentation tests -->
-  <Match>
-    <Class name="~.*\.*Test" />
-    <Field type="android.support.test.rule.UiThreadTestRule" />
-    <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
-  </Match>
-  <Match>
-    <Class name="~.*\.*Test" />
-    <Field type="org.junit.rules.RuleChain" />
-    <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
-  </Match>
-  <Match>
-    <Class name="~.*\.*Test" />
-    <Field type="org.junit.rules.TestRule" />
-    <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
-  </Match>
-
-</FindBugsFilter>
diff --git a/build/android/incremental_install/BUILD.gn b/build/android/incremental_install/BUILD.gn
index 3bab39b2..c0bb27e 100644
--- a/build/android/incremental_install/BUILD.gn
+++ b/build/android/incremental_install/BUILD.gn
@@ -16,5 +16,4 @@
     "java/org/chromium/incrementalinstall/SecondInstrumentation.java",
   ]
   emma_never_instrument = true
-  run_findbugs_override = false
 }
diff --git a/build/android/pylib/utils/findbugs.py b/build/android/pylib/utils/findbugs.py
deleted file mode 100644
index 05d30fa..0000000
--- a/build/android/pylib/utils/findbugs.py
+++ /dev/null
@@ -1,202 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-import os
-import xml.dom.minidom
-
-from devil.utils import cmd_helper
-from pylib.constants import host_paths
-
-
-_FINDBUGS_HOME = os.path.join(host_paths.DIR_SOURCE_ROOT, 'third_party',
-                              'findbugs')
-_FINDBUGS_JAR = os.path.join(_FINDBUGS_HOME, 'lib', 'findbugs.jar')
-_FINDBUGS_MAX_HEAP = 768
-_FINDBUGS_PLUGIN_PATH = os.path.join(
-    host_paths.DIR_SOURCE_ROOT, 'tools', 'android', 'findbugs_plugin', 'lib',
-    'chromiumPlugin.jar')
-
-
-def _ParseXmlResults(results_doc):
-  errors = set()
-  warnings = set()
-  for en in (n for n in results_doc.documentElement.childNodes
-             if n.nodeType == xml.dom.Node.ELEMENT_NODE):
-    if en.tagName == 'Errors':
-      errors.update(_ParseErrors(en))
-    if en.tagName == 'BugInstance':
-      warnings.add(_ParseBugInstance(en))
-  return errors, warnings
-
-
-def _GetMessage(node):
-  for c in (n for n in node.childNodes
-            if n.nodeType == xml.dom.Node.ELEMENT_NODE):
-    if c.tagName == 'Message':
-      if (len(c.childNodes) == 1
-          and c.childNodes[0].nodeType == xml.dom.Node.TEXT_NODE):
-        return c.childNodes[0].data
-  return None
-
-
-def _GetTextContent(node):
-  if (len(node.childNodes) == 1
-      and node.childNodes[0].nodeType == xml.dom.Node.TEXT_NODE):
-    return node.childNodes[0].data
-  return ''
-
-
-def _ParseErrors(node):
-  errors = set()
-  for error_node in (n for n in node.childNodes
-                     if n.nodeType == xml.dom.Node.ELEMENT_NODE):
-    error_text = '(unable to determine error text)'
-    if error_node.tagName == 'Error':
-      error_message_nodes = (
-          n for n in error_node.childNodes
-          if (n.nodeType == xml.dom.Node.ELEMENT_NODE
-              and n.tagName == 'ErrorMessage'))
-      text_pieces = [_GetTextContent(n) for n in error_message_nodes]
-      if text_pieces:
-        error_text = ', '.join(t for t in text_pieces if t)
-      errors.add(FindBugsError(error_node.tagName, error_text))
-  return errors
-
-
-def _ParseBugInstance(node):
-  bug = FindBugsWarning(node.getAttribute('type'))
-  msg_parts = []
-  for c in (n for n in node.childNodes
-            if n.nodeType == xml.dom.Node.ELEMENT_NODE):
-    if c.tagName == 'Class':
-      msg_parts.append(_GetMessage(c))
-    elif c.tagName == 'Method':
-      msg_parts.append(_GetMessage(c))
-    elif c.tagName == 'Field':
-      msg_parts.append(_GetMessage(c))
-    elif c.tagName == 'SourceLine':
-      bug.file_name = c.getAttribute('sourcefile')
-      if c.hasAttribute('start'):
-        bug.start_line = int(c.getAttribute('start'))
-      if c.hasAttribute('end'):
-        bug.end_line = int(c.getAttribute('end'))
-      msg_parts.append(_GetMessage(c))
-    elif c.tagName == 'ShortMessage':
-      msg_parts.append(_GetTextContent(c))
-  bug.message = tuple(m for m in msg_parts if m)
-  return bug
-
-
-class FindBugsError(object):
-  def __init__(self, error_type='', error_val=''):
-    self.error_type = error_type
-    self.error_val = error_val
-
-  def __cmp__(self, other):
-    return (cmp(self.error_type, other.error_type)
-            or cmp(self.error_val, other.error_val))
-
-  def __eq__(self, other):
-    return self.__dict__ == other.__dict__
-
-  def __hash__(self):
-    return hash((self.error_type, self.error_val))
-
-  def __ne__(self, other):
-    return not self == other
-
-  def __str__(self):
-    return '%s: %s' % (self.error_type, self.error_val)
-
-
-class FindBugsWarning(object):
-
-  def __init__(self, bug_type='', end_line=0, file_name='', message=None,
-               start_line=0):
-    self.bug_type = bug_type
-    self.end_line = end_line
-    self.file_name = file_name
-    if message is None:
-      self.message = tuple()
-    else:
-      self.message = message
-    self.start_line = start_line
-
-  def __cmp__(self, other):
-    return (cmp(self.file_name, other.file_name)
-            or cmp(self.start_line, other.start_line)
-            or cmp(self.end_line, other.end_line)
-            or cmp(self.bug_type, other.bug_type)
-            or cmp(self.message, other.message))
-
-  def __eq__(self, other):
-    return self.__dict__ == other.__dict__
-
-  def __hash__(self):
-    return hash((self.bug_type, self.end_line, self.file_name, self.message,
-                 self.start_line))
-
-  def __ne__(self, other):
-    return not self == other
-
-  def __str__(self):
-    return '%s: %s' % (self.bug_type, '\n  '.join(self.message))
-
-
-def Run(exclude, classes_to_analyze, system_classes, auxiliary_classes,
-        output_file, findbug_args, jars):
-  """Run FindBugs.
-
-  Args:
-    exclude: the exclude xml file, refer to FindBugs's -exclude command option.
-    classes_to_analyze: the list of classes need to analyze, refer to FindBugs'
-                        -onlyAnalyze command line option.
-    system_classes: system classes to help analysis.
-    auxiliary_classes: other classes to help analysis. Refer to FindBugs'
-                       -auxclasspath command line option.
-    output_file: An optional path to dump XML results to.
-    findbug_args: A list of additional command line options to pass to Findbugs.
-  """
-  # TODO(jbudorick): Get this from the build system.
-  all_aux_classes = []
-  all_aux_classes.extend(system_classes or [])
-  all_aux_classes.extend(
-      os.path.abspath(classes)
-      for classes in auxiliary_classes or [])
-
-  cmd = ['java',
-         '-classpath', '%s:' % _FINDBUGS_JAR,
-         '-Xmx%dm' % _FINDBUGS_MAX_HEAP,
-         '-Dfindbugs.home="%s"' % _FINDBUGS_HOME,
-         '-jar', _FINDBUGS_JAR,
-         '-textui', '-sortByClass',
-         '-pluginList', _FINDBUGS_PLUGIN_PATH, '-xml:withMessages']
-  if system_classes:
-    cmd.extend(['-auxclasspath', ':'.join(all_aux_classes)])
-  if classes_to_analyze:
-    cmd.extend(['-onlyAnalyze', classes_to_analyze])
-  if exclude:
-    cmd.extend(['-exclude', os.path.abspath(exclude)])
-  if output_file:
-    cmd.extend(['-output', output_file])
-  if findbug_args:
-    cmd.extend(findbug_args)
-  cmd.extend(os.path.abspath(j) for j in jars or [])
-
-  if output_file:
-    _, _, stderr = cmd_helper.GetCmdStatusOutputAndError(cmd)
-
-    results_doc = xml.dom.minidom.parse(output_file)
-  else:
-    _, raw_out, stderr = cmd_helper.GetCmdStatusOutputAndError(cmd)
-    results_doc = xml.dom.minidom.parseString(raw_out)
-
-  for line in stderr.splitlines():
-    logging.debug('  %s', line)
-
-  current_errors_set, current_warnings_set = _ParseXmlResults(results_doc)
-
-  return (' '.join(cmd), current_errors_set, current_warnings_set)
-
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index 01e1c08a..5902ee5 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -901,51 +901,6 @@
     }
   }
 
-  template("findbugs") {
-    action(target_name) {
-      forward_variables_from(invoker,
-                             [
-                               "deps",
-                               "testonly",
-                             ])
-      script = "//build/android/findbugs_diff.py"
-      depfile = "$target_gen_dir/$target_name.d"
-      _result_path = "$target_gen_dir/$target_name/result.xml"
-      _exclusions_file = "//build/android/findbugs_filter/findbugs_exclude.xml"
-
-      _rebased_build_config = rebase_path(invoker.build_config, root_build_dir)
-
-      inputs = [
-        "//build/android/pylib/utils/findbugs.py",
-        _exclusions_file,
-        invoker.jar_path,
-        invoker.build_config,
-      ]
-
-      outputs = [
-        _result_path,
-      ]
-
-      args = [
-        "--depfile",
-        rebase_path(depfile, root_build_dir),
-        "--exclude",
-        rebase_path(_exclusions_file, root_build_dir),
-        "--system-jar",
-        rebase_path(android_sdk_jar, root_build_dir),
-        "--auxclasspath-gyp",
-        "@FileArg($_rebased_build_config:javac:classpath)",
-        "--output-file",
-        rebase_path(_result_path, root_build_dir),
-        rebase_path(invoker.jar_path, root_build_dir),
-      ]
-
-      if (findbugs_verbose) {
-        args += [ "-vv" ]
-      }
-    }
-  }
-
   # Generates a script in the build bin directory to run a java binary.
   #
   # Variables
@@ -2642,15 +2597,8 @@
           [ "//build/android/buildhooks:build_hooks_android_java" ]
     }
 
-    if (defined(invoker.run_findbugs_override)) {
-      _run_findbugs = invoker.run_findbugs_override
-    } else {
-      _run_findbugs = run_findbugs  # Default to build arg if not overridden.
-    }
-    assert(_run_findbugs || true)  # Mark as used.
-
-    # Don't enable coverage, lint, findbugs unless the target has some
-    # non-generated files.
+    # Don't enable coverage or lint unless the target has some non-generated
+    # files.
     if (defined(invoker.chromium_code)) {
       _chromium_code = invoker.chromium_code
     } else {
@@ -2848,14 +2796,6 @@
           }
         }
 
-        if (_run_findbugs) {
-          findbugs("${_template_name}__findbugs") {
-            build_config = _build_config
-            jar_path = _jar_path
-            deps = _accumulated_deps
-          }
-        }
-
         # Use an intermediate group() rather as the data_deps target in order to
         # avoid lint artifacts showing up as runtime_deps (while still having lint
         # run in parallel to other targets).
@@ -2863,9 +2803,6 @@
           public_deps = [
             ":${_template_name}__lint",
           ]
-          if (_run_findbugs) {
-            public_deps += [ ":${_template_name}__findbugs" ]
-          }
         }
       }
 
diff --git a/components/cronet/android/BUILD.gn b/components/cronet/android/BUILD.gn
index e32411a..8b4ac723 100644
--- a/components/cronet/android/BUILD.gn
+++ b/components/cronet/android/BUILD.gn
@@ -274,8 +274,6 @@
   ]
 
   srcjar_deps = cronet_api_srcjar_deps
-
-  run_findbugs_override = true
 }
 
 cronet_impl_common_java_srcjar_deps = [
@@ -404,8 +402,6 @@
     "//base:base_java",
     "//third_party/android_tools:android_support_v7_appcompat_java",
   ]
-
-  run_findbugs_override = true
 }
 
 android_apk("cronet_sample_apk") {
@@ -421,7 +417,6 @@
     "//third_party/jsr-305:jsr_305_javalib",
   ]
 
-  run_findbugs_override = true
   proguard_enabled = true
   proguard_configs = [
     "$target_gen_dir/cronet_impl_native_proguard.cfg",
@@ -463,7 +458,6 @@
   ]
   additional_apks = [ "//net/android:net_test_support_apk" ]
 
-  run_findbugs_override = true
   proguard_enabled = true
 }
 
@@ -558,8 +552,6 @@
     "//third_party/junit",
     "//third_party/netty4:netty_all_java",
   ]
-
-  run_findbugs_override = true
 }
 
 cronet_smoketests_platform_only_common_srcs = [
@@ -650,8 +642,6 @@
     "cronet_impl_common_proguard.cfg",
     "cronet_impl_platform_proguard.cfg",
   ]
-
-  run_findbugs_override = true
 }
 
 android_library("cronet_javatests") {
@@ -709,8 +699,6 @@
     "//third_party/android_support_test_runner:runner_java",
     "//third_party/junit",
   ]
-
-  run_findbugs_override = true
 }
 
 instrumentation_test_apk("cronet_test_instrumentation_apk") {
@@ -739,8 +727,6 @@
   proguard_enabled = true
 
   proguard_configs = [ "test/proguard.cfg" ]
-
-  run_findbugs_override = true
 }
 
 android_resources("cronet_smoketests_platform_only_apk_resources") {
@@ -779,7 +765,6 @@
     ":cronet_impl_platform_java",
     ":cronet_smoketests_platform_only_apk_resources",
   ]
-  run_findbugs_override = true
 }
 
 instrumentation_test_apk(
@@ -796,7 +781,6 @@
   proguard_enabled = true
 
   proguard_configs = [ "test/proguard.cfg" ]
-  run_findbugs_override = true
 }
 
 android_library("cronet_smoketests_missing_native_library_java") {
@@ -831,8 +815,6 @@
     "cronet_impl_common_proguard.cfg",
     "cronet_impl_platform_proguard.cfg",
   ]
-
-  run_findbugs_override = true
 }
 
 instrumentation_test_apk(
@@ -848,8 +830,6 @@
   proguard_enabled = true
 
   proguard_configs = [ "test/proguard.cfg" ]
-
-  run_findbugs_override = true
 }
 
 android_library("cronet_perf_test_apk_java") {
@@ -865,8 +845,6 @@
     ":cronet_test_apk_java",
     "//base:base_java",
   ]
-
-  run_findbugs_override = true
 }
 
 android_apk("cronet_perf_test_apk") {
@@ -885,7 +863,6 @@
     "//base:base_java",
   ]
 
-  run_findbugs_override = true
   proguard_enabled = true
   proguard_configs = [
     "$target_gen_dir/cronet_impl_native_proguard.cfg",
diff --git a/docs/README.md b/docs/README.md
index 0d0f7014..8c82c7c4 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -237,8 +237,6 @@
     Setting up profiling for `content_shell` on Android
 *   [Working Remotely with Android](working_remotely_with_android.md) - Building
     on a remote machine for an Android device connected to your local machine
-*   [Using FindBugs for Android](use_find_bugs_for_android.md) - Using the open
-    source static analysis tool findbugs on the Java code.
 *   [Android Test Instructions](android_test_instructions.md) - Running a build
     on an Android device or emulator.
 *   [Android Debugging](android_debugging_instructions.md) - Tools and tips for
diff --git a/docs/use_find_bugs_for_android.md b/docs/use_find_bugs_for_android.md
deleted file mode 100644
index d812118..0000000
--- a/docs/use_find_bugs_for_android.md
+++ /dev/null
@@ -1,45 +0,0 @@
-# Use FindBugs for Android
-
-[FindBugs](http://findbugs.sourceforge.net) is an open source static analysis
-tool from the University of Maryland that looks for potential bugs in Java class
-files. We have some scripts to run it over the Java code at build time.
-
-## How To Run
-
-    gn gen --args='target_os="android" run_findbugs=true'
-
-Note that running findbugs will add time to your build. The amount of additional
-time required depends on the number of targets on which findbugs runs, though it
-will usually be between 1-10 minutes.
-
-Some of the warnings are false positives. In general, they should be suppressed
-using
-[@SuppressFBWarnings](https://code.google.com/p/chromium/codesearch#chromium/src/base/android/java/src/org/chromium/base/annotations/SuppressFBWarnings.java).
-In the rare event that a warning should be suppressed across the entire
-code base, it should be added to the
-[exclusion file](https://code.google.com/p/chromium/codesearch#chromium/src/build/android/findbugs_filter/findbugs_exclude.xml)
-instead. If you modify this file:
-
-*   Include a comment that says what you're suppressing and why.
-*   The existing suppressions should give you an idea of the syntax. See also
-    the FindBugs documentation. Note that the documentation doesn't seem totally
-    accurate (there's probably some version skew between the online docs and the
-    version of FindBugs we're using) so you may have to experiment a little.
-
-# Chromium's [FindBugs](http://findbugs.sourceforge.net) plugin
-
-We have
-[FindBugs plugin](https://code.google.com/p/chromium/codesearch#chromium/src/tools/android/findbugs_plugin/)
-to enforce chromium specific Java rules. It currently detects:
-
-*   Synchronized method
-*   Synchronized this
-
-# [FindBugs](http://findbugs.sourceforge.net) on the Bots
-
-[FindBugs](http://findbugs.sourceforge.net) is configured to run on:
-
-*   [android_clang_dbg_recipe](https://build.chromium.org/p/tryserver.chromium.linux/builders/android_clang_dbg_recipe)
-    on the commit queue
-*   [Android ASAN (dbg)](https://build.chromium.org/p/chromium.android/builders/Android%20ASAN%20%28dbg%29)
-    on the main waterfall
diff --git a/mojo/public/tools/bindings/mojom.gni b/mojo/public/tools/bindings/mojom.gni
index 9b5ed6a..8c80bcf3 100644
--- a/mojo/public/tools/bindings/mojom.gni
+++ b/mojo/public/tools/bindings/mojom.gni
@@ -979,7 +979,6 @@
         }
 
         srcjar_deps = [ ":$java_srcjar_target_name" ]
-        run_findbugs_override = false
       }
     }
   }
diff --git a/third_party/custom_tabs_client/BUILD.gn b/third_party/custom_tabs_client/BUILD.gn
index c902392..ea188cc 100644
--- a/third_party/custom_tabs_client/BUILD.gn
+++ b/third_party/custom_tabs_client/BUILD.gn
@@ -62,7 +62,6 @@
   ]
   srcjar_deps = [ ":chrome_custom_tabs_service_aidl" ]
   chromium_code = true
-  run_findbugs_override = false
 }
 
 android_aidl("chrome_custom_tabs_service_aidl") {
diff --git a/third_party/gif_player/BUILD.gn b/third_party/gif_player/BUILD.gn
index dcbc8b0..7da53c3 100644
--- a/third_party/gif_player/BUILD.gn
+++ b/third_party/gif_player/BUILD.gn
@@ -9,5 +9,4 @@
     "src/jp/tomorrowkey/android/gifplayer/BaseGifDrawable.java",
     "src/jp/tomorrowkey/android/gifplayer/BaseGifImage.java",
   ]
-  run_findbugs_override = false
 }
diff --git a/third_party/netty-tcnative/BUILD.gn b/third_party/netty-tcnative/BUILD.gn
index 521a81a..d4fd3a9 100644
--- a/third_party/netty-tcnative/BUILD.gn
+++ b/third_party/netty-tcnative/BUILD.gn
@@ -43,7 +43,6 @@
     "src/java/io/netty/internal/tcnative/SSL.java",
     "src/java/io/netty/internal/tcnative/SSLContext.java",
   ]
-  run_findbugs_override = false
   deps = [
     "//base:base_java",
   ]
diff --git a/tools/android/eclipse/.classpath b/tools/android/eclipse/.classpath
index 92967f3..68b2bfa 100644
--- a/tools/android/eclipse/.classpath
+++ b/tools/android/eclipse/.classpath
@@ -132,8 +132,6 @@
     <classpathentry kind="src" path="third_party/leakcanary/src/leakcanary-android/src/main/java"/>
     <classpathentry kind="src" path="third_party/leakcanary/src/leakcanary-watcher/src/main/java"/>
     <classpathentry kind="src" path="third_party/mockito/src/src/main/java"/>
-    <classpathentry kind="src" path="tools/android/findbugs_plugin/src"/>
-    <classpathentry kind="src" path="tools/android/findbugs_plugin/test/java/src"/>
     <classpathentry kind="src" path="tools/android/memconsumer/java/src"/>
     <classpathentry kind="src" path="ui/android/java/src"/>
     <classpathentry kind="src" path="ui/android/javatests/src"/>
diff --git a/tools/android/findbugs_plugin/README b/tools/android/findbugs_plugin/README
deleted file mode 100644
index 3ba3f53..0000000
--- a/tools/android/findbugs_plugin/README
+++ /dev/null
@@ -1,15 +0,0 @@
-This is the FindBugs plugin for chrome on android.
-
-Currently it detects:
-- synchronized method
-- synchronized 'this'
-
-We don't want the synchronized method and synchronized 'this' to be
-used, the exception is the synchronized method defined in Android
-API.
-
-The plugin jar file was prebuilt and checked in, to rebuild the
-plugin, you need ant, and run below command, the new jar file will
-be in lib directory.
-
-ant install
diff --git a/tools/android/findbugs_plugin/build.xml b/tools/android/findbugs_plugin/build.xml
deleted file mode 100644
index 09ee13c..0000000
--- a/tools/android/findbugs_plugin/build.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright (c) 2012 The Chromium Authors. All rights reserved.
-  Use of this source code is governed by a BSD-style license that can be
-  found in the LICENSE file.
--->
-
-<project name="findbugs_plugin" basedir=".">
-
-  <description>
-    Build findbugs_plugin for Chromium Android
-  </description>
-  <property name="src.dir" location="src" />
-  <property name="lib.dir" location="../../../third_party/findbugs/lib" />
-  <property name="bin.dir" location="lib" />
-  <property name="intermediate.dir" location="intermediate" />
-  <property name="jar.name" value="chromiumPlugin.jar" />
-
-  <path id="classpath.id">
-    <fileset dir="${lib.dir}">
-      <include name="**/*.jar" />
-    </fileset>
-  </path>
-
-  <target name="makedir">
-    <mkdir dir="${intermediate.dir}" />
-    <mkdir dir="${bin.dir}" />
-  </target>
-
-  <target name="findbugs_plugin_classes" depends="makedir">
-    <javac srcdir="${src.dir}" destdir="${intermediate.dir}"
-        classpathref="classpath.id" includeantruntime="false" />
-  </target>
-
-  <target name="copy_xml_files" depends="makedir">
-    <copy file="messages.xml" todir="${intermediate.dir}" />
-    <copy file="findbugs.xml" todir="${intermediate.dir}" />
-  </target>
-
-  <target name="findbugs_plugin_jar" depends="findbugs_plugin_classes, copy_xml_files">
-    <jar destfile="${bin.dir}/${jar.name}" basedir="${intermediate.dir}">
-    </jar>
-  </target>
-
-  <target name="install" depends="findbugs_plugin_jar">
-    <delete dir="${intermediate.dir}" />
-  </target>
-</project>
diff --git a/tools/android/findbugs_plugin/findbugs.xml b/tools/android/findbugs_plugin/findbugs.xml
deleted file mode 100644
index 002e841..0000000
--- a/tools/android/findbugs_plugin/findbugs.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright (c) 2012 The Chromium Authors. All rights reserved.
-  Use of this source code is governed by a BSD-style license that can be
-  found in the LICENSE file.
--->
-
-<FindbugsPlugin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:noNamespaceSchemaLocation="findbugsplugin.xsd"
-        pluginid="SynchronizedThisDetector"
-        provider="chromium"
-        website="https://chromium.googlesource.com/chromium/src/+/master/docs/use_find_bugs_for_android.md">
-        <Detector class="org.chromium.tools.findbugs.plugin.SynchronizedThisDetector" reports="CHROMIUM_SYNCHRONIZED_THIS" />
-        <BugPattern type="CHROMIUM_SYNCHRONIZED_THIS" abbrev="CHROMIUM" category="CORRECTNESS"/>
-
-        <Detector class="org.chromium.tools.findbugs.plugin.SynchronizedMethodDetector" reports="CHROMIUM_SYNCHRONIZED_METHOD" />
-        <BugPattern type="CHROMIUM_SYNCHRONIZED_METHOD" abbrev="CHROMIUM" category="CORRECTNESS"/>
-</FindbugsPlugin>
diff --git a/tools/android/findbugs_plugin/lib/chromiumPlugin.jar b/tools/android/findbugs_plugin/lib/chromiumPlugin.jar
deleted file mode 100644
index 451566d2e..0000000
--- a/tools/android/findbugs_plugin/lib/chromiumPlugin.jar
+++ /dev/null
Binary files differ
diff --git a/tools/android/findbugs_plugin/messages.xml b/tools/android/findbugs_plugin/messages.xml
deleted file mode 100644
index aea983b..0000000
--- a/tools/android/findbugs_plugin/messages.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-  Copyright (c) 2012 The Chromium Authors. All rights reserved.
-  Use of this source code is governed by a BSD-style license that can be
-  found in the LICENSE file.
--->
-
-<MessageCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:noNamespaceSchemaLocation="messagecollection.xsd">
-
-        <Plugin>
-                <ShortDescription>Chromium FindBugs Plugin </ShortDescription>
-                <Details>Adds style checks enforced in the chromium project.</Details>
-        </Plugin>
-
-        <Detector class="org.chromium.tools.findbugs.plugin.SynchronizedThisDetector">
-                <Details>
-                          <![CDATA[
-                        Shouldn't use synchronized(this).
-                              ]]>
-                </Details>
-
-        </Detector>
-
-        <BugPattern type="CHROMIUM_SYNCHRONIZED_THIS">
-                <ShortDescription>Shouldn't use synchronized(this)</ShortDescription>
-                <LongDescription>Shouldn't use synchronized(this), please narrow down the synchronization scope.</LongDescription>
-                <Details>
-<![CDATA[
-<p>Shouldn't use synchronized(this), please narrow down the synchronization scope.</p>
-]]>
-                </Details>
-        </BugPattern>
-
-        <Detector class="org.chromium.tools.findbugs.plugin.SynchronizedMethodDetector">
-                <Details>
-                          <![CDATA[
-                        Shouldn't use synchronized method.
-                              ]]>
-                </Details>
-
-        </Detector>
-
-        <BugPattern type="CHROMIUM_SYNCHRONIZED_METHOD">
-                <ShortDescription>Shouldn't use synchronized method</ShortDescription>
-                <LongDescription>Shouldn't use synchronized method, please narrow down the synchronization scope.</LongDescription>
-                <Details>
-<![CDATA[
-<p>Shouldn't use synchronized method, please narrow down the synchronization scope.</p>
-]]>
-                </Details>
-        </BugPattern>
-
-        <BugCode abbrev="CHROMIUM">CHROMIUM</BugCode>
-</MessageCollection>
diff --git a/tools/android/findbugs_plugin/src/org/chromium/tools/findbugs/plugin/SynchronizedMethodDetector.java b/tools/android/findbugs_plugin/src/org/chromium/tools/findbugs/plugin/SynchronizedMethodDetector.java
deleted file mode 100644
index d1d7614..0000000
--- a/tools/android/findbugs_plugin/src/org/chromium/tools/findbugs/plugin/SynchronizedMethodDetector.java
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.tools.findbugs.plugin;
-
-import org.apache.bcel.classfile.Code;
-
-import edu.umd.cs.findbugs.BugInstance;
-import edu.umd.cs.findbugs.BugReporter;
-import edu.umd.cs.findbugs.bcel.OpcodeStackDetector;
-
-/**
- * This class detects the synchronized method.
- */
-public class SynchronizedMethodDetector extends OpcodeStackDetector {
-    private BugReporter mBugReporter;
-
-    public SynchronizedMethodDetector(BugReporter bugReporter) {
-        this.mBugReporter = bugReporter;
-    }
-
-    @Override
-    public void visit(Code code) {
-        if (getMethod().isSynchronized()) {
-            mBugReporter.reportBug(new BugInstance(this, "CHROMIUM_SYNCHRONIZED_METHOD",
-                                                   NORMAL_PRIORITY)
-                    .addClassAndMethod(this)
-                    .addSourceLine(this));
-        }
-        super.visit(code);
-    }
-
-    @Override
-    public void sawOpcode(int arg0) {
-    }
-}
diff --git a/tools/android/findbugs_plugin/src/org/chromium/tools/findbugs/plugin/SynchronizedThisDetector.java b/tools/android/findbugs_plugin/src/org/chromium/tools/findbugs/plugin/SynchronizedThisDetector.java
deleted file mode 100644
index 9a4e5e1..0000000
--- a/tools/android/findbugs_plugin/src/org/chromium/tools/findbugs/plugin/SynchronizedThisDetector.java
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.tools.findbugs.plugin;
-
-import org.apache.bcel.classfile.Code;
-
-import edu.umd.cs.findbugs.BugInstance;
-import edu.umd.cs.findbugs.BugReporter;
-import edu.umd.cs.findbugs.bcel.OpcodeStackDetector;
-
-/**
- * This class detects the synchronized(this).
- *
- * The pattern of byte code of synchronized(this) is
- * aload_0         # Load the 'this' pointer on top of stack
- * dup             # Duplicate the 'this' pointer
- * astore_x        # Store this for late use, it might be astore.
- * monitorenter
- */
-public class SynchronizedThisDetector extends OpcodeStackDetector {
-    private static final int PATTERN[] = {ALOAD_0, DUP, 0xff, 0xff, MONITORENTER};
-
-    private int mStep = 0;
-    private BugReporter mBugReporter;
-
-    public SynchronizedThisDetector(BugReporter bugReporter) {
-        mBugReporter = bugReporter;
-    }
-
-    @Override
-    public void visit(Code code) {
-        mStep = 0;
-        super.visit(code);
-    }
-
-    @Override
-    public void sawOpcode(int seen) {
-        if (PATTERN[mStep] == seen) {
-            mStep++;
-            if (mStep == PATTERN.length) {
-                mBugReporter.reportBug(new BugInstance(this, "CHROMIUM_SYNCHRONIZED_THIS",
-                                                       NORMAL_PRIORITY)
-                        .addClassAndMethod(this)
-                        .addSourceLine(this));
-                mStep = 0;
-                return;
-            }
-        } else if (mStep == 2) {
-            // This could be astore_x
-            switch (seen) {
-                case ASTORE_0:
-                case ASTORE_1:
-                case ASTORE_2:
-                case ASTORE_3:
-                    mStep += 2;
-                    break;
-                case ASTORE:
-                    mStep++;
-                    break;
-                default:
-                    mStep = 0;
-                    break;
-            }
-        } else if (mStep == 3) {
-            // Could be any byte following the ASTORE.
-            mStep++;
-        } else {
-            mStep = 0;
-        }
-    }
-}
diff --git a/tools/android/findbugs_plugin/test/java/src/org/chromium/tools/findbugs/plugin/SimpleSynchronizedMethod.java b/tools/android/findbugs_plugin/test/java/src/org/chromium/tools/findbugs/plugin/SimpleSynchronizedMethod.java
deleted file mode 100644
index ded7848..0000000
--- a/tools/android/findbugs_plugin/test/java/src/org/chromium/tools/findbugs/plugin/SimpleSynchronizedMethod.java
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.tools.findbugs.plugin;
-
-/**
- * This class has synchronized method and is used to test
- * SynchronizedMethodDetector.
- */
-class SimpleSynchronizedMethod {
-    private int mCounter = 0;
-
-    synchronized void synchronizedMethod() {
-        mCounter++;
-    }
-}
diff --git a/tools/android/findbugs_plugin/test/java/src/org/chromium/tools/findbugs/plugin/SimpleSynchronizedStaticMethod.java b/tools/android/findbugs_plugin/test/java/src/org/chromium/tools/findbugs/plugin/SimpleSynchronizedStaticMethod.java
deleted file mode 100644
index d652dbe..0000000
--- a/tools/android/findbugs_plugin/test/java/src/org/chromium/tools/findbugs/plugin/SimpleSynchronizedStaticMethod.java
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.tools.findbugs.plugin;
-
-/**
- * This class is used to test SynchronizedMethodDetector
- */
-class SimpleSynchronizedStaticMethod {
-    private static int sCounter = 0;
-
-    static synchronized void synchronizedStaticMethod() {
-        sCounter++;
-    }
-}
diff --git a/tools/android/findbugs_plugin/test/java/src/org/chromium/tools/findbugs/plugin/SimpleSynchronizedThis.java b/tools/android/findbugs_plugin/test/java/src/org/chromium/tools/findbugs/plugin/SimpleSynchronizedThis.java
deleted file mode 100644
index 9125155..0000000
--- a/tools/android/findbugs_plugin/test/java/src/org/chromium/tools/findbugs/plugin/SimpleSynchronizedThis.java
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.tools.findbugs.plugin;
-
-/**
- * This class has synchronized(this) statement and is used to test
- * SynchronizedThisDetector.
- */
-class SimpleSynchronizedThis {
-    private int mCounter = 0;
-
-    void synchronizedThis() {
-        synchronized (this) {
-            mCounter++;
-        }
-    }
-}
diff --git a/tools/android/findbugs_plugin/test/run_findbugs_plugin_tests.py b/tools/android/findbugs_plugin/test/run_findbugs_plugin_tests.py
deleted file mode 100755
index 603659e6..0000000
--- a/tools/android/findbugs_plugin/test/run_findbugs_plugin_tests.py
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This is used to test the findbugs plugin, it calls
-# build/android/pylib/utils/findbugs.py to analyze the classes in
-# org.chromium.tools.findbugs.plugin package, and expects to get the same
-# issue with those in expected_result.txt.
-#
-# Useful command line:
-# --rebaseline to generate the expected_result.txt, please make sure don't
-# remove the expected result of exsting tests.
-
-
-import argparse
-import os
-import sys
-
-sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__),
-                                             '..', '..', '..', '..',
-                                             'build', 'android')))
-
-from pylib import constants
-from pylib.utils import findbugs
-
-
-_EXPECTED_WARNINGS = set([
-    findbugs.FindBugsWarning(
-        bug_type='CHROMIUM_SYNCHRONIZED_THIS',
-        start_line=15,
-        end_line=15,
-        file_name='SimpleSynchronizedThis.java',
-        message=(
-            "Shouldn't use synchronized(this)",
-            'In class org.chromium.tools.findbugs.plugin.'
-                + 'SimpleSynchronizedThis',
-            'In method org.chromium.tools.findbugs.plugin.'
-                + 'SimpleSynchronizedThis.synchronizedThis()',
-            'At SimpleSynchronizedThis.java:[line 15]',
-        )),
-    findbugs.FindBugsWarning(
-        bug_type='CHROMIUM_SYNCHRONIZED_METHOD',
-        start_line=14,
-        end_line=14,
-        file_name='SimpleSynchronizedStaticMethod.java',
-        message=(
-            "Shouldn't use synchronized method",
-            'In class org.chromium.tools.findbugs.plugin.'
-                + 'SimpleSynchronizedStaticMethod',
-            'In method org.chromium.tools.findbugs.plugin.'
-                + 'SimpleSynchronizedStaticMethod.synchronizedStaticMethod()',
-            'At SimpleSynchronizedStaticMethod.java:[line 14]',
-        )),
-    findbugs.FindBugsWarning(
-        bug_type='CHROMIUM_SYNCHRONIZED_METHOD',
-        start_line=15,
-        end_line=15,
-        file_name='SimpleSynchronizedMethod.java',
-        message=(
-            "Shouldn't use synchronized method",
-            'In class org.chromium.tools.findbugs.plugin.'
-                + 'SimpleSynchronizedMethod',
-            'In method org.chromium.tools.findbugs.plugin.'
-                + 'SimpleSynchronizedMethod.synchronizedMethod()',
-            'At SimpleSynchronizedMethod.java:[line 15]',
-        )),
-])
-
-
-def main(argv):
-
-  parser = argparse.ArgumentParser()
-  parser.add_argument(
-      '-l', '--release-build', action='store_true', dest='release',
-      help='Run the release build of the findbugs plugin test.')
-  args = parser.parse_args()
-
-  test_jar_path = os.path.join(
-      constants.GetOutDirectory(
-          'Release' if args.release else 'Debug'),
-      'lib.java', 'findbugs_plugin_test.jar')
-
-  findbugs_command, findbugs_warnings = findbugs.Run(
-      None, 'org.chromium.tools.findbugs.plugin.*', None, None, None, None,
-      [test_jar_path])
-
-  missing_warnings = _EXPECTED_WARNINGS.difference(findbugs_warnings)
-  if missing_warnings:
-    print 'Missing warnings:'
-    for w in missing_warnings:
-      print '%s' % str(w)
-
-  unexpected_warnings = findbugs_warnings.difference(_EXPECTED_WARNINGS)
-  if unexpected_warnings:
-    print 'Unexpected warnings:'
-    for w in unexpected_warnings:
-      print '%s' % str(w)
-
-  return len(unexpected_warnings) + len(missing_warnings)
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv))