We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
CheckstyleBear should error when use_spaces is False or indent_size is not 2
If `checkstyle_configs = Google`, indentation checking using 2 spaces, according to https://google.github.io/styleguide/javaguide.html#s4.2-block-indentation

`use_spaces=False` must emit an error
`indent_size` must be set to 2, otherwise emit an error.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `bears/java/CheckstyleBear.py`
Content:
```
1 from coalib.bearlib.abstractions.Linter import linter
2 from coalib.settings.Setting import path
3 
4 
5 known_checkstyles = {
6     "google": "https://raw.githubusercontent.com/checkstyle/checkstyle/master/src/main/resources/google_checks.xml",
7     "sun": 'https://raw.githubusercontent.com/checkstyle/checkstyle/master/src/main/resources/sun_checks.xml',
8     "android-check-easy": "https://raw.githubusercontent.com/noveogroup/android-check/master/android-check-plugin/src/main/resources/checkstyle/checkstyle-easy.xml",
9     "android-check-hard": "https://raw.githubusercontent.com/noveogroup/android-check/master/android-check-plugin/src/main/resources/checkstyle/checkstyle-hard.xml",
10     "geosoft": "http://geosoft.no/development/geosoft_checks.xml"}
11 
12 
13 def known_checkstyle_or_path(setting):
14     if str(setting) in known_checkstyles.keys():
15         return str(setting)
16     else:
17         return path(setting)
18 
19 
20 @linter(executable='java',
21         output_format='regex',
22         output_regex=r'\[(?P<severity>WARN|INFO)\].*?'
23                      r'(?P<line>\d+):?(?P<column>\d+)?. '
24                      r'(?P<message>.*?) *\[(?P<origin>[a-zA-Z]+?)\]')
25 class CheckstyleBear:
26     """
27     Check Java code for possible style, semantic and design issues.
28 
29     For more information, consult
30     <http://checkstyle.sourceforge.net/checks.html>.
31     """
32 
33     LANGUAGES = {"Java"}
34     AUTHORS = {'The coala developers'}
35     AUTHORS_EMAILS = {'coala-devel@googlegroups.com'}
36     LICENSE = 'AGPL-3.0'
37     CAN_DETECT = {'Formatting', 'Smell'}
38 
39     def setup_dependencies(self):
40         type(self).checkstyle_jar_file = self.download_cached_file(
41             'http://sourceforge.net/projects/checkstyle/files/checkstyle/6.15'
42             '/checkstyle-6.15-all.jar',
43             "checkstyle.jar")
44 
45     def create_arguments(
46             self, filename, file, config_file,
47             checkstyle_configs: known_checkstyle_or_path="google"):
48         """
49         :param checkstyle_configs:
50             A file containing configs to use in ``checkstyle``. It can also
51             have the special values:
52 
53             - google - Google's Java style. More info at
54               <http://checkstyle.sourceforge.net/style_configs.html>.
55             - sun - Sun's Java style. These are the same
56               as the default Eclipse checks. More info at
57               <http://checkstyle.sourceforge.net/style_configs.html>.
58             - android-check-easy - The easy Android configs provided by the
59               android-check eclipse plugin. More info at
60               <https://github.com/noveogroup/android-check>.
61             - android-check-hard - The hard Android confis provided by the
62               android-check eclipse plugin. More info at
63               <https://github.com/noveogroup/android-check>.
64             - geosoft - The Java style followed by GeoSoft. More info at
65               <http://geosoft.no/development/javastyle.html>
66         """
67         if checkstyle_configs in known_checkstyles:
68             checkstyle_configs = self.download_cached_file(
69                 known_checkstyles[checkstyle_configs],
70                 checkstyle_configs + ".xml")
71 
72         return ('-jar', self.checkstyle_jar_file, '-c',
73                 checkstyle_configs, filename)
74
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/bears/java/CheckstyleBear.py b/bears/java/CheckstyleBear.py
--- a/bears/java/CheckstyleBear.py
+++ b/bears/java/CheckstyleBear.py
@@ -10,6 +10,13 @@
     "geosoft": "http://geosoft.no/development/geosoft_checks.xml"}
 
 
+def check_invalid_configuration(checkstyle_configs, use_spaces, indent_size):
+    if (checkstyle_configs is 'google' and
+            (not use_spaces or indent_size != 2)):
+        raise ValueError('Google checkstyle config does not support '
+                         'use_spaces=False or indent_size != 2')
+
+
 def known_checkstyle_or_path(setting):
     if str(setting) in known_checkstyles.keys():
         return str(setting)
@@ -44,7 +51,8 @@
 
     def create_arguments(
             self, filename, file, config_file,
-            checkstyle_configs: known_checkstyle_or_path="google"):
+            checkstyle_configs: known_checkstyle_or_path="google",
+            use_spaces: bool=True, indent_size: int=2):
         """
         :param checkstyle_configs:
             A file containing configs to use in ``checkstyle``. It can also
@@ -64,6 +72,9 @@
             - geosoft - The Java style followed by GeoSoft. More info at
               <http://geosoft.no/development/javastyle.html>
         """
+        check_invalid_configuration(
+            checkstyle_configs, use_spaces, indent_size)
+
         if checkstyle_configs in known_checkstyles:
             checkstyle_configs = self.download_cached_file(
                 known_checkstyles[checkstyle_configs],

{"golden_diff": "diff --git a/bears/java/CheckstyleBear.py b/bears/java/CheckstyleBear.py\n--- a/bears/java/CheckstyleBear.py\n+++ b/bears/java/CheckstyleBear.py\n@@ -10,6 +10,13 @@\n     \"geosoft\": \"http://geosoft.no/development/geosoft_checks.xml\"}\n \n \n+def check_invalid_configuration(checkstyle_configs, use_spaces, indent_size):\n+    if (checkstyle_configs is 'google' and\n+            (not use_spaces or indent_size != 2)):\n+        raise ValueError('Google checkstyle config does not support '\n+                         'use_spaces=False or indent_size != 2')\n+\n+\n def known_checkstyle_or_path(setting):\n     if str(setting) in known_checkstyles.keys():\n         return str(setting)\n@@ -44,7 +51,8 @@\n \n     def create_arguments(\n             self, filename, file, config_file,\n-            checkstyle_configs: known_checkstyle_or_path=\"google\"):\n+            checkstyle_configs: known_checkstyle_or_path=\"google\",\n+            use_spaces: bool=True, indent_size: int=2):\n         \"\"\"\n         :param checkstyle_configs:\n             A file containing configs to use in ``checkstyle``. It can also\n@@ -64,6 +72,9 @@\n             - geosoft - The Java style followed by GeoSoft. More info at\n               <http://geosoft.no/development/javastyle.html>\n         \"\"\"\n+        check_invalid_configuration(\n+            checkstyle_configs, use_spaces, indent_size)\n+\n         if checkstyle_configs in known_checkstyles:\n             checkstyle_configs = self.download_cached_file(\n                 known_checkstyles[checkstyle_configs],\n", "issue": "CheckstyleBear should error when use_spaces is False or indent_size is not 2\nIf `checkstyle_configs = Google`, indentation checking using 2 spaces, according to https://google.github.io/styleguide/javaguide.html#s4.2-block-indentation\n\n`use_spaces=False` must emit an error\n`indent_size` must be set to 2, otherwise emit an error.\n\n", "before_files": [{"content": "from coalib.bearlib.abstractions.Linter import linter\nfrom coalib.settings.Setting import path\n\n\nknown_checkstyles = {\n    \"google\": \"https://raw.githubusercontent.com/checkstyle/checkstyle/master/src/main/resources/google_checks.xml\",\n    \"sun\": 'https://raw.githubusercontent.com/checkstyle/checkstyle/master/src/main/resources/sun_checks.xml',\n    \"android-check-easy\": \"https://raw.githubusercontent.com/noveogroup/android-check/master/android-check-plugin/src/main/resources/checkstyle/checkstyle-easy.xml\",\n    \"android-check-hard\": \"https://raw.githubusercontent.com/noveogroup/android-check/master/android-check-plugin/src/main/resources/checkstyle/checkstyle-hard.xml\",\n    \"geosoft\": \"http://geosoft.no/development/geosoft_checks.xml\"}\n\n\ndef known_checkstyle_or_path(setting):\n    if str(setting) in known_checkstyles.keys():\n        return str(setting)\n    else:\n        return path(setting)\n\n\n@linter(executable='java',\n        output_format='regex',\n        output_regex=r'\\[(?P<severity>WARN|INFO)\\].*?'\n                     r'(?P<line>\\d+):?(?P<column>\\d+)?. '\n                     r'(?P<message>.*?) *\\[(?P<origin>[a-zA-Z]+?)\\]')\nclass CheckstyleBear:\n    \"\"\"\n    Check Java code for possible style, semantic and design issues.\n\n    For more information, consult\n    <http://checkstyle.sourceforge.net/checks.html>.\n    \"\"\"\n\n    LANGUAGES = {\"Java\"}\n    AUTHORS = {'The coala developers'}\n    AUTHORS_EMAILS = {'coala-devel@googlegroups.com'}\n    LICENSE = 'AGPL-3.0'\n    CAN_DETECT = {'Formatting', 'Smell'}\n\n    def setup_dependencies(self):\n        type(self).checkstyle_jar_file = self.download_cached_file(\n            'http://sourceforge.net/projects/checkstyle/files/checkstyle/6.15'\n            '/checkstyle-6.15-all.jar',\n            \"checkstyle.jar\")\n\n    def create_arguments(\n            self, filename, file, config_file,\n            checkstyle_configs: known_checkstyle_or_path=\"google\"):\n        \"\"\"\n        :param checkstyle_configs:\n            A file containing configs to use in ``checkstyle``. It can also\n            have the special values:\n\n            - google - Google's Java style. More info at\n              <http://checkstyle.sourceforge.net/style_configs.html>.\n            - sun - Sun's Java style. These are the same\n              as the default Eclipse checks. More info at\n              <http://checkstyle.sourceforge.net/style_configs.html>.\n            - android-check-easy - The easy Android configs provided by the\n              android-check eclipse plugin. More info at\n              <https://github.com/noveogroup/android-check>.\n            - android-check-hard - The hard Android confis provided by the\n              android-check eclipse plugin. More info at\n              <https://github.com/noveogroup/android-check>.\n            - geosoft - The Java style followed by GeoSoft. More info at\n              <http://geosoft.no/development/javastyle.html>\n        \"\"\"\n        if checkstyle_configs in known_checkstyles:\n            checkstyle_configs = self.download_cached_file(\n                known_checkstyles[checkstyle_configs],\n                checkstyle_configs + \".xml\")\n\n        return ('-jar', self.checkstyle_jar_file, '-c',\n                checkstyle_configs, filename)\n", "path": "bears/java/CheckstyleBear.py"}], "after_files": [{"content": "from coalib.bearlib.abstractions.Linter import linter\nfrom coalib.settings.Setting import path\n\n\nknown_checkstyles = {\n    \"google\": \"https://raw.githubusercontent.com/checkstyle/checkstyle/master/src/main/resources/google_checks.xml\",\n    \"sun\": 'https://raw.githubusercontent.com/checkstyle/checkstyle/master/src/main/resources/sun_checks.xml',\n    \"android-check-easy\": \"https://raw.githubusercontent.com/noveogroup/android-check/master/android-check-plugin/src/main/resources/checkstyle/checkstyle-easy.xml\",\n    \"android-check-hard\": \"https://raw.githubusercontent.com/noveogroup/android-check/master/android-check-plugin/src/main/resources/checkstyle/checkstyle-hard.xml\",\n    \"geosoft\": \"http://geosoft.no/development/geosoft_checks.xml\"}\n\n\ndef check_invalid_configuration(checkstyle_configs, use_spaces, indent_size):\n    if (checkstyle_configs is 'google' and\n            (not use_spaces or indent_size != 2)):\n        raise ValueError('Google checkstyle config does not support '\n                         'use_spaces=False or indent_size != 2')\n\n\ndef known_checkstyle_or_path(setting):\n    if str(setting) in known_checkstyles.keys():\n        return str(setting)\n    else:\n        return path(setting)\n\n\n@linter(executable='java',\n        output_format='regex',\n        output_regex=r'\\[(?P<severity>WARN|INFO)\\].*?'\n                     r'(?P<line>\\d+):?(?P<column>\\d+)?. '\n                     r'(?P<message>.*?) *\\[(?P<origin>[a-zA-Z]+?)\\]')\nclass CheckstyleBear:\n    \"\"\"\n    Check Java code for possible style, semantic and design issues.\n\n    For more information, consult\n    <http://checkstyle.sourceforge.net/checks.html>.\n    \"\"\"\n\n    LANGUAGES = {\"Java\"}\n    AUTHORS = {'The coala developers'}\n    AUTHORS_EMAILS = {'coala-devel@googlegroups.com'}\n    LICENSE = 'AGPL-3.0'\n    CAN_DETECT = {'Formatting', 'Smell'}\n\n    def setup_dependencies(self):\n        type(self).checkstyle_jar_file = self.download_cached_file(\n            'http://sourceforge.net/projects/checkstyle/files/checkstyle/6.15'\n            '/checkstyle-6.15-all.jar',\n            \"checkstyle.jar\")\n\n    def create_arguments(\n            self, filename, file, config_file,\n            checkstyle_configs: known_checkstyle_or_path=\"google\",\n            use_spaces: bool=True, indent_size: int=2):\n        \"\"\"\n        :param checkstyle_configs:\n            A file containing configs to use in ``checkstyle``. It can also\n            have the special values:\n\n            - google - Google's Java style. More info at\n              <http://checkstyle.sourceforge.net/style_configs.html>.\n            - sun - Sun's Java style. These are the same\n              as the default Eclipse checks. More info at\n              <http://checkstyle.sourceforge.net/style_configs.html>.\n            - android-check-easy - The easy Android configs provided by the\n              android-check eclipse plugin. More info at\n              <https://github.com/noveogroup/android-check>.\n            - android-check-hard - The hard Android confis provided by the\n              android-check eclipse plugin. More info at\n              <https://github.com/noveogroup/android-check>.\n            - geosoft - The Java style followed by GeoSoft. More info at\n              <http://geosoft.no/development/javastyle.html>\n        \"\"\"\n        check_invalid_configuration(\n            checkstyle_configs, use_spaces, indent_size)\n\n        if checkstyle_configs in known_checkstyles:\n            checkstyle_configs = self.download_cached_file(\n                known_checkstyles[checkstyle_configs],\n                checkstyle_configs + \".xml\")\n\n        return ('-jar', self.checkstyle_jar_file, '-c',\n                checkstyle_configs, filename)\n", "path": "bears/java/CheckstyleBear.py"}]}