Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#19334 closed defect (fixed)

[PATCH] Upgrade to error_prone 2.4.0

Reported by: Don-vip Owned by: team
Priority: normal Milestone: 20.06
Component: Core Version:
Keywords: Cc:

Description

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

Attachments (1)

19334.diff (131.7 KB ) - added by Don-vip 4 years ago.

Download all attachments as: .zip

Change History (21)

by Don-vip, 4 years ago

Attachment: 19334.diff added

comment:1 by simon04, 4 years ago

Wow, that's great news! :-)

comment:2 by Don-vip, 4 years ago

In 16553/josm:

see #19334 - javadoc fixes + protected constructors for abstract classes

comment:3 by Don-vip, 4 years ago

In 16555/josm:

see #19334 - avoid ConcurrentModificationException while iterating over maps

comment:4 by Don-vip, 4 years ago

Resolution: fixed
Status: newclosed

In 16556/josm:

fix #19334 - Upgrade to error_prone 2.4.0

comment:5 by simon04, 4 years ago

In 16571/josm:

see #19334 - Use error_prone javac via ivy:cachepath

comment:6 by simon04, 4 years ago

The plugins failed to compile on JDK11 – https://josm.openstreetmap.de/jenkins/job/JOSM-Plugins/jdk=JDK11/1869/console

Fixed via [o35489]

comment:7 by simon04, 4 years ago

In 16621/josm:

see #19334 - Use @SuppressWarnings to ignore seldom occurring error-prone warnings

comment:10 by simon04, 4 years ago

In 16624/josm:

see #19334 - Use @SuppressWarnings to ignore seldom occurring error-prone warnings

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.