Modify

Opened 3 weeks ago

Last modified 10 days ago

#24635 new task

Fix new PMD warnings

Reported by: stoecker Owned by: team
Priority: normal Milestone: 26.03
Component: Core Version:
Keywords: Cc: gaben, GerdP

Description

After PMD upgrade a bunch of new warnings cam up.

Anyone time to help fixing them?

Attachments (0)

Change History (19)

comment:1 by gaben, 3 weeks ago

Anyone time..?

I don't have any at the moment, but hopefully I will have some in the following weeks.

comment:2 by GerdP, 3 weeks ago

Sorry, the recent changes caused another build failure in my Eclipse installation, so atm I try to fix that.

comment:3 by stoecker, 3 weeks ago

I found that an "svn cleanup --remove-ignored" helped. I had to do this for the CI to work.

comment:4 by stoecker, 3 weeks ago

Also note, that while I tried to keep downwards compatibility intact I may have created some places where Java >= 21 is required. I don't plan to actively search such issues as long as the JOSM server stuff for the needed builds does still work with Java 11.

comment:5 by GerdP, 3 weeks ago

My problems with Eclipse are fixed. No idea what exactly was wrong, it used an older version of the compression library.

comment:6 by GerdP, 3 weeks ago

Where do I see the bunch of PMD warnings?

comment:7 by GerdP, 3 weeks ago

Ah, didn't use svn update today. Now I see when running ant pmd

in reply to:  5 comment:8 by stoecker, 3 weeks ago

Replying to GerdP:

My problems with Eclipse are fixed. No idea what exactly was wrong

That's the reason why I don't use eclipse. That "No idea why" happened too often to me...

comment:9 by GerdP, 3 weeks ago

I can take care about the "Public member ... declared in a non-public type" messages. My understanding is that I just have to remove the public key word.

in reply to:  9 comment:10 by stoecker, 3 weeks ago

Replying to GerdP:

I can take care about the "Public member ... declared in a non-public type" messages. My understanding is that I just have to remove the public key word.

Or change to "protected"? I'm not totally sure. Had only a short look at the PMD description.

comment:11 by GerdP, 3 weeks ago

In https://github.com/pmd/pmd/pull/6231 I see that either public should be removed or private should be added.
Anyhow there seem to be more to this because when I change the flagged places in src\org\openstreetmap\josm\data\coor\Coordinate.java I can no longer compile. Not yet sure if this is a PMD error or if I have to change more code.

comment:12 by stoecker, 3 weeks ago

In 19520/josm:

ignore rule PublicMemberInNonPublicType, see #24635

comment:13 by stoecker, 2 weeks ago

In 19535/josm:

remove a lot of PMD warnings, especially outdated ignores, see #24635

comment:14 by stoecker, 2 weeks ago

In 19536/josm:

remove PMD ImplicitFunctionalInterface, see #24635

comment:15 by stoecker, 2 weeks ago

In 19537/josm:

fix one more PMD, see #24635

comment:16 by stoecker, 2 weeks ago

In 19538/josm:

fix one more PMD, see #24635, drop java.util.Date in SyncEditorLayerIndex

comment:17 by stoecker, 2 weeks ago

Only 2 types missing:

  • ReplaceJavaUtilDate
  • OverrideBothEqualsAndHashCodeOnComparable

comment:18 by stoecker, 13 days ago

In 19539/josm:

see #24635 - remove usage of Date

comment:19 by stoecker, 10 days ago

In 19541/josm:

remove outdated expiry data check, see #24635

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to stoecker.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


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