Modify

Opened 2 years ago

Closed 2 years ago

#14179 closed enhancement (fixed)

Duplicated lines in GeoImageLayer.java

Reported by: holgermappt Owned by: team
Priority: minor Milestone: 16.12
Component: Core image mapping Version: latest
Keywords: Cc:

Description

This looks like duplicated code in src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java, lines 201-205:

            progressMonitor.subTask(tr("Read photos..."));
            progressMonitor.setTicksCount(files.size());

            progressMonitor.subTask(tr("Read photos..."));
            progressMonitor.setTicksCount(files.size());

If I interpret the ProgressMonitor documentation correctly then subTask() and setTicksCount() both overwrite the value that was set in the previous call, so the same operation is done twice. If that interpretation is right it can be reduced to:

            progressMonitor.subTask(tr("Read photos..."));
            progressMonitor.setTicksCount(files.size());

Attachments (0)

Change History (3)

comment:1 Changed 2 years ago by Don-vip

Milestone: 16.12

comment:2 Changed 2 years ago by Don-vip

Nice catch, introduced in r2566, 7 years ago, and never noticed.

comment:3 Changed 2 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 11425/josm:

fix #14179 - remove duplicated code

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.