Index: /trunk/README
===================================================================
--- /trunk/README	(revision 10580)
+++ /trunk/README	(revision 10581)
@@ -121,4 +121,6 @@
                             problems in source code); can be launched as an ant target in build.xml
     - commons-cli-1.3.1.jar dependency of Groovy Ant task
+    - error_prone_ant-2.0.9.jar
+                            used to detect code errors during compilation
     - findbugs/             libs and config files for findbugs (automatically detects common bugs and potential
                             problems in source code); can be launched as an ant target in build.xml
Index: /trunk/build.xml
===================================================================
--- /trunk/build.xml	(revision 10580)
+++ /trunk/build.xml	(revision 10581)
@@ -26,4 +26,5 @@
         <property name="epsg.output" location="${base.dir}/data/projection/custom-epsg"/>
         <property name="groovy.jar" location="${base.dir}/tools/groovy-all-2.4.7.jar"/>
+        <property name="error_prone_ant.jar" location="${base.dir}/tools/error_prone_ant-2.0.9.jar"/>
         <!-- build parameter: compression level (ant -Dclevel=N)
                  N ranges from 0 (no compression) to 9 (maximum compression)
@@ -244,6 +245,10 @@
         </javac>
         <!-- JMapViewer -->
-        <javac sourcepath="" srcdir="${src.dir}" excludes="com/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/Demo.java,org/openstreetmap/josm/**,JOSM.java,gnu/**"
+        <javac compiler="com.google.errorprone.ErrorProneAntCompilerAdapter" sourcepath="" srcdir="${src.dir}" 
+            excludes="com/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/Demo.java,org/openstreetmap/josm/**,JOSM.java,gnu/**"
             destdir="build" target="1.8" source="1.8" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
+            <compilerclasspath>
+                <pathelement location="${error_prone_ant.jar}"/>
+            </compilerclasspath>
             <compilerarg value="-Xlint:cast"/>
             <compilerarg value="-Xlint:deprecation"/>
@@ -261,6 +266,10 @@
         </javac>
         <!-- JOSM -->
-        <javac sourcepath="" srcdir="${src.dir}" excludes="com/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/Demo.java"
+        <javac compiler="com.google.errorprone.ErrorProneAntCompilerAdapter" sourcepath="" srcdir="${src.dir}" 
+            excludes="com/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/Demo.java"
             destdir="build" target="1.8" source="1.8" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
+            <compilerclasspath>
+                <pathelement location="${error_prone_ant.jar}"/>
+            </compilerclasspath>
             <compilerarg value="-Xlint:cast"/>
             <compilerarg value="-Xlint:deprecation"/>
