Modify

Opened 5 weeks ago

Closed 4 weeks ago

Last modified 3 weeks 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 5 weeks ago.

Download all attachments as: .zip

Change History (20)

Changed 5 weeks ago by Don-vip

Attachment: 19334.diff added

comment:1 Changed 4 weeks ago by simon04

Wow, that's great news! :-)

comment:2 Changed 4 weeks ago by Don-vip

In 16553/josm:

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

comment:3 Changed 4 weeks ago by Don-vip

In 16555/josm:

see #19334 - avoid ConcurrentModificationException while iterating over maps

comment:4 Changed 4 weeks ago by Don-vip

Resolution: fixed
Status: newclosed

In 16556/josm:

fix #19334 - Upgrade to error_prone 2.4.0

comment:5 Changed 4 weeks ago by simon04

In 16571/josm:

see #19334 - Use error_prone javac via ivy:cachepath

comment:6 Changed 4 weeks ago by simon04

comment:7 Changed 3 weeks ago by simon04

In 16621/josm:

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

comment:10 Changed 3 weeks ago by simon04

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.