Changeset 14222 in josm


Ignore:
Timestamp:
2018-09-04T23:35:01+02:00 (6 years ago)
Author:
Don-vip
Message:

see #16498 - simplify build.xml and update to latest snapshot of error_prone, patched for Java 12 compatibility

See https://github.com/google/error-prone/pull/1107
See https://github.com/google/error-prone/commit/3f2ca43e53266e84e17e4fb3f34888be5cb29293#commitcomment-30382503

Location:
trunk
Files:
2 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r14218 r14222  
    4040        <property name="checkstyle-build.dir" location="${base.dir}/build2"/>
    4141        <property name="epsg.output" location="${base.dir}/data/projection/custom-epsg"/>
    42         <property name="error_prone_ant.jar" location="${tools.dir}/error_prone_ant.jar"/>
     42        <property name="error_prone_core.jar" location="${tools.dir}/error_prone_core.jar"/>
     43        <property name="error_prone_javac.jar" location="${tools.dir}/error_prone_javac.jar"/>
     44        <property name="jformatstring.jar" location="${spotbugs.dir}/jFormatString-3.0.0.jar"/>
    4345        <property name="dist.jar" location="${dist.dir}/josm-custom.jar"/>
    4446        <property name="dist-optimized.jar" location="${dist.dir}/josm-custom-optimized.jar"/>
     
    6062        <condition property="isJava12"><matches string="${ant.java.version}" pattern="1[2-9]" /></condition>
    6163        <condition property="isJava13"><matches string="${ant.java.version}" pattern="1[3-9]" /></condition>
    62         <!-- error_prone works differently on Java 10+, see https://github.com/google/error-prone/issues/860 -->
    63         <condition property="javac.compiler" value="modern" else="com.google.errorprone.ErrorProneAntCompilerAdapter">
    64             <isset property="isJava10"/>
    65         </condition>
    6664        <!-- Disable jacoco on Java 13+, see https://github.com/jacoco/jacoco/pull/738 -->
    6765        <condition property="coverageByDefault">
     
    8785                <include name="*.jar"/>
    8886            </fileset>
     87        </path>
     88        <path id="processor.path">
     89            <pathelement location="${error_prone_core.jar}"/>
     90            <pathelement location="${jformatstring.jar}"/>
    8991        </path>
    9092    </target>
     
    322324    <target name="compile-jmapviewer" depends="init">
    323325        <!-- JMapViewer -->
    324         <javac compiler="${javac.compiler}" sourcepath="" srcdir="${src.dir}"
     326        <javac sourcepath="" srcdir="${src.dir}" fork="yes"
    325327            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/**"
    326328            destdir="${build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
    327             <compilerclasspath>
    328                 <pathelement location="${error_prone_ant.jar}"/>
    329             </compilerclasspath>
    330             <compilerarg line="-XDcompilePolicy=simple" compiler="modern"/>
    331             <compilerarg line="-processorpath ${error_prone_ant.jar}" compiler="modern"/>
     329            <compilerarg value="-J-Xbootclasspath/p:${error_prone_javac.jar}" unless:set="isJava9"/>
     330            <compilerarg line="-XDcompilePolicy=simple"/>
     331            <compilerarg value="-processorpath"/>
     332            <compilerarg pathref="processor.path"/>
    332333            <compilerarg value="-Xlint:cast"/>
    333334            <compilerarg value="-Xlint:deprecation"/>
     
    343344            <!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 -->
    344345            <compilerarg value="-XDignore.symbol.file"/>
    345             <compilerarg value="-Xep:CatchAndPrintStackTrace:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
    346             <compilerarg value="-Xep:ReferenceEquality:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
    347             <compilerarg value="-Xep:StringSplitter:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
    348             <compilerarg value="-Xplugin:ErrorProne -Xep:CatchAndPrintStackTrace:OFF -Xep:ReferenceEquality:OFF -Xep:StringSplitter:OFF" compiler="modern"/>
     346            <compilerarg value="-Xplugin:ErrorProne -Xep:CatchAndPrintStackTrace:OFF -Xep:ReferenceEquality:OFF -Xep:StringSplitter:OFF"/>
    349347            <compilerarg line="-Xmaxwarns 1000"/>
    350348        </javac>
     
    352350    <target name="compile" depends="init,javacc,compile-cots,compile-jmapviewer">
    353351        <!-- JOSM -->
    354         <javac compiler="${javac.compiler}" sourcepath="" srcdir="${src.dir}"
     352        <javac sourcepath="" srcdir="${src.dir}" fork="yes"
    355353            excludes="com/**,javax/**,gnu/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/**,org/tukaani/**"
    356354            destdir="${build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
    357             <compilerclasspath>
    358                 <pathelement location="${error_prone_ant.jar}"/>
    359             </compilerclasspath>
    360             <compilerarg line="-XDcompilePolicy=simple" compiler="modern"/>
    361             <compilerarg line="-processorpath ${error_prone_ant.jar}" compiler="modern"/>
     355            <compilerarg value="-J-Xbootclasspath/p:${error_prone_javac.jar}" unless:set="isJava9"/>
     356            <compilerarg line="-XDcompilePolicy=simple"/>
     357            <compilerarg value="-processorpath"/>
     358            <compilerarg pathref="processor.path"/>
    362359            <compilerarg value="-Xlint:cast"/>
    363360            <compilerarg value="-Xlint:deprecation"/>
     
    373370            <!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 -->
    374371            <compilerarg value="-XDignore.symbol.file"/>
    375             <compilerarg value="-Xep:ReferenceEquality:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
    376             <compilerarg value="-Xep:ImmutableEnumChecker:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
    377             <compilerarg value="-Xep:FutureReturnValueIgnored:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
    378             <compilerarg value="-Xep:FloatingPointLiteralPrecision:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
    379             <compilerarg value="-Xep:ShortCircuitBoolean:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
    380             <compilerarg value="-Xep:StringSplitter:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
    381             <compilerarg value="-Xep:JdkObsolete:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
    382             <compilerarg value="-Xep:UnnecessaryParentheses:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
    383             <compilerarg value="-Xep:EqualsGetClass:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
    384             <compilerarg value="-Xep:ThreadPriorityCheck:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
    385             <compilerarg value="-Xep:UndefinedEquals:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
    386             <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"/>
     372            <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"/>
    387373            <compilerarg line="-Xmaxwarns 1000"/>
    388374            <exclude name="org/openstreetmap/josm/io/audio/fx/*.java" if:set="noJavaFX"/>
  • trunk/src/org/openstreetmap/josm/data/osm/DataSet.java

    r14219 r14222  
    957957            if (!eventsToFire.isEmpty()) {
    958958                lock.readLock().lock();
    959                 lock.writeLock().unlock();
    960959                try {
     960                    lock.writeLock().unlock();
    961961                    if (eventsToFire.size() < MAX_SINGLE_EVENTS) {
    962962                        for (AbstractDatasetChangedEvent event : eventsToFire) {
Note: See TracChangeset for help on using the changeset viewer.