﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
19334	[PATCH] Upgrade to error_prone 2.4.0	Don-vip	team	"Follow-up of ticket:18755#comment:7

Now that error_prone works with recent versions of Java, we no longer need to patch it and can use it through Ivy.

Attached patch does it. New default rules require a lot of javadoc changes. Also the public -> protected change of abstract constructors should probably require a rebuild of all plugins.

The new version finds two critical bugs that need to be solved as well:
{{{
    [javac] C:\SVN\josm\core\src\org\openstreetmap\josm\gui\preferences\imagery\ImageryProvidersPanel.java:414: warning: [ModifyCollectionInEnhancedForLoop] Modifying a collection while iterating over it in a loop may cause a ConcurrentModificationException to be thrown or lead to undefined behavior.
    [javac]                     removalEffect.accept(map.remove(i));
    [javac]                                                    ^
    [javac]     (see https://errorprone.info/bugpattern/ModifyCollectionInEnhancedForLoop)
    [javac] C:\SVN\josm\core\src\org\openstreetmap\josm\data\validation\tests\DuplicateNode.java:191: warning: [ModifyCollectionInEnhancedForLoop] Modifying a collection while iterating over it in a loop may cause a ConcurrentModificationException to be thrown or lead to undefined behavior.
    [javac]                                         typeMap.put(type, Boolean.TRUE);
    [javac]                                                    ^
    [javac]     (see https://errorprone.info/bugpattern/ModifyCollectionInEnhancedForLoop)
    [javac] 2 warnings
}}}

See https://errorprone.info/bugpattern/ModifyCollectionInEnhancedForLoop"	defect	closed	normal	20.06	Core		fixed		
