Skip to content

Commit

Permalink
see #16498 - simplify build.xml and update to latest snapshot of erro…
Browse files Browse the repository at this point in the history
…r_prone, patched for Java 12 compatibility

See google/error-prone#1107
See google/error-prone@3f2ca43#commitcomment-30382503

git-svn-id: https://josm.openstreetmap.de/svn/trunk@14222 0c6e7542-c601-0410-84e7-c038aed88b3b
  • Loading branch information
don-vip committed Sep 4, 2018
1 parent 1149bd1 commit 0d84652
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 34 deletions.
52 changes: 19 additions & 33 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
<property name="proj-build.dir" location="${base.dir}/build2"/>
<property name="checkstyle-build.dir" location="${base.dir}/build2"/>
<property name="epsg.output" location="${base.dir}/data/projection/custom-epsg"/>
<property name="error_prone_ant.jar" location="${tools.dir}/error_prone_ant.jar"/>
<property name="error_prone_core.jar" location="${tools.dir}/error_prone_core.jar"/>
<property name="error_prone_javac.jar" location="${tools.dir}/error_prone_javac.jar"/>
<property name="jformatstring.jar" location="${spotbugs.dir}/jFormatString-3.0.0.jar"/>
<property name="dist.jar" location="${dist.dir}/josm-custom.jar"/>
<property name="dist-optimized.jar" location="${dist.dir}/josm-custom-optimized.jar"/>
<property name="java.lang.version" value="1.8" />
Expand All @@ -59,10 +61,6 @@
<condition property="isJava11"><matches string="${ant.java.version}" pattern="1[1-9]" /></condition>
<condition property="isJava12"><matches string="${ant.java.version}" pattern="1[2-9]" /></condition>
<condition property="isJava13"><matches string="${ant.java.version}" pattern="1[3-9]" /></condition>
<!-- error_prone works differently on Java 10+, see https://github.com/google/error-prone/issues/860 -->
<condition property="javac.compiler" value="modern" else="com.google.errorprone.ErrorProneAntCompilerAdapter">
<isset property="isJava10"/>
</condition>
<!-- Disable jacoco on Java 13+, see https://github.com/jacoco/jacoco/pull/738 -->
<condition property="coverageByDefault">
<not>
Expand All @@ -87,6 +85,10 @@
<include name="*.jar"/>
</fileset>
</path>
<path id="processor.path">
<pathelement location="${error_prone_core.jar}"/>
<pathelement location="${jformatstring.jar}"/>
</path>
</target>

<!--
Expand Down Expand Up @@ -321,14 +323,13 @@ Build-Date: ${build.tstamp}
</target>
<target name="compile-jmapviewer" depends="init">
<!-- JMapViewer -->
<javac compiler="${javac.compiler}" sourcepath="" srcdir="${src.dir}"
<javac sourcepath="" srcdir="${src.dir}" fork="yes"
excludes="com/**,javax/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/Demo.java,org/openstreetmap/gui/jmapviewer/JMapViewerTree.java,org/openstreetmap/gui/jmapviewer/checkBoxTree/**,org/openstreetmap/josm/**,org/tukaani/**,gnu/**"
destdir="${build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
<compilerclasspath>
<pathelement location="${error_prone_ant.jar}"/>
</compilerclasspath>
<compilerarg line="-XDcompilePolicy=simple" compiler="modern"/>
<compilerarg line="-processorpath ${error_prone_ant.jar}" compiler="modern"/>
<compilerarg value="-J-Xbootclasspath/p:${error_prone_javac.jar}" unless:set="isJava9"/>
<compilerarg line="-XDcompilePolicy=simple"/>
<compilerarg value="-processorpath"/>
<compilerarg pathref="processor.path"/>
<compilerarg value="-Xlint:cast"/>
<compilerarg value="-Xlint:deprecation"/>
<compilerarg value="-Xlint:dep-ann"/>
Expand All @@ -342,23 +343,19 @@ Build-Date: ${build.tstamp}
<compilerarg value="-Xlint:unchecked"/>
<!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 -->
<compilerarg value="-XDignore.symbol.file"/>
<compilerarg value="-Xep:CatchAndPrintStackTrace:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
<compilerarg value="-Xep:ReferenceEquality:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
<compilerarg value="-Xep:StringSplitter:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
<compilerarg value="-Xplugin:ErrorProne -Xep:CatchAndPrintStackTrace:OFF -Xep:ReferenceEquality:OFF -Xep:StringSplitter:OFF" compiler="modern"/>
<compilerarg value="-Xplugin:ErrorProne -Xep:CatchAndPrintStackTrace:OFF -Xep:ReferenceEquality:OFF -Xep:StringSplitter:OFF"/>
<compilerarg line="-Xmaxwarns 1000"/>
</javac>
</target>
<target name="compile" depends="init,javacc,compile-cots,compile-jmapviewer">
<!-- JOSM -->
<javac compiler="${javac.compiler}" sourcepath="" srcdir="${src.dir}"
<javac sourcepath="" srcdir="${src.dir}" fork="yes"
excludes="com/**,javax/**,gnu/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/**,org/tukaani/**"
destdir="${build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
<compilerclasspath>
<pathelement location="${error_prone_ant.jar}"/>
</compilerclasspath>
<compilerarg line="-XDcompilePolicy=simple" compiler="modern"/>
<compilerarg line="-processorpath ${error_prone_ant.jar}" compiler="modern"/>
<compilerarg value="-J-Xbootclasspath/p:${error_prone_javac.jar}" unless:set="isJava9"/>
<compilerarg line="-XDcompilePolicy=simple"/>
<compilerarg value="-processorpath"/>
<compilerarg pathref="processor.path"/>
<compilerarg value="-Xlint:cast"/>
<compilerarg value="-Xlint:deprecation"/>
<compilerarg value="-Xlint:dep-ann"/>
Expand All @@ -372,18 +369,7 @@ Build-Date: ${build.tstamp}
<compilerarg value="-Xlint:unchecked"/>
<!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 -->
<compilerarg value="-XDignore.symbol.file"/>
<compilerarg value="-Xep:ReferenceEquality:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
<compilerarg value="-Xep:ImmutableEnumChecker:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
<compilerarg value="-Xep:FutureReturnValueIgnored:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
<compilerarg value="-Xep:FloatingPointLiteralPrecision:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
<compilerarg value="-Xep:ShortCircuitBoolean:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
<compilerarg value="-Xep:StringSplitter:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
<compilerarg value="-Xep:JdkObsolete:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
<compilerarg value="-Xep:UnnecessaryParentheses:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
<compilerarg value="-Xep:EqualsGetClass:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
<compilerarg value="-Xep:ThreadPriorityCheck:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
<compilerarg value="-Xep:UndefinedEquals:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
<compilerarg value="-Xplugin:ErrorProne -Xep:ReferenceEquality:OFF -Xep:ImmutableEnumChecker:OFF -Xep:FutureReturnValueIgnored:OFF -Xep:FloatingPointLiteralPrecision:OFF -Xep:ShortCircuitBoolean:OFF -Xep:StringSplitter:OFF -Xep:JdkObsolete:OFF -Xep:UnnecessaryParentheses:OFF -Xep:EqualsGetClass:OFF -Xep:ThreadPriorityCheck:OFF -Xep:UndefinedEquals:OFF" compiler="modern"/>
<compilerarg value="-Xplugin:ErrorProne -Xep:ReferenceEquality:OFF -Xep:ImmutableEnumChecker:OFF -Xep:FutureReturnValueIgnored:OFF -Xep:FloatingPointLiteralPrecision:OFF -Xep:ShortCircuitBoolean:OFF -Xep:StringSplitter:OFF -Xep:JdkObsolete:OFF -Xep:UnnecessaryParentheses:OFF -Xep:EqualsGetClass:OFF -Xep:ThreadPriorityCheck:OFF -Xep:UndefinedEquals:OFF"/>
<compilerarg line="-Xmaxwarns 1000"/>
<exclude name="org/openstreetmap/josm/io/audio/fx/*.java" if:set="noJavaFX"/>
</javac>
Expand Down
2 changes: 1 addition & 1 deletion src/org/openstreetmap/josm/data/osm/DataSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -956,8 +956,8 @@ public void endUpdate() {

if (!eventsToFire.isEmpty()) {
lock.readLock().lock();
lock.writeLock().unlock();
try {
lock.writeLock().unlock();
if (eventsToFire.size() < MAX_SINGLE_EVENTS) {
for (AbstractDatasetChangedEvent event : eventsToFire) {
fireEventToListeners(event);
Expand Down
Binary file not shown.
Binary file added tools/error_prone_javac.jar
Binary file not shown.

0 comments on commit 0d84652

Please sign in to comment.