Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#8321 closed defect (fixed)

JMapViewer constructor does not use parameter downloadThreadCount

Reported by: The111 Owned by: The111
Priority: normal Milestone:
Component: JMapViewer Version: latest
Keywords: Cc:


One available constructor for JMapViewer has a parameter downloadThreadCount which is unused. No matter what argument is passed to the constructor, the JobDispatcher's thread count is determined by its own static field. This bug originated in [o9846].

Attachments (0)

Change History (4)

comment:1 Changed 8 years ago by The111

Resolution: fixed
Status: newclosed

Fixed in [o29162] and [o29173].

Last edited 8 years ago by The111 (previous) (diff)

comment:2 Changed 8 years ago by stoecker

Changing WORKER_THREAD_MAX_COUNT is not really good style. Upper case always indicates a constant. I suggest to rename the variable accordingly.

comment:3 Changed 8 years ago by The111

True. I was a bit puzzled by both the uppercase naming of a non-final static field, and also the fact that the field was public. However, I was driven by a desire to change as little code as possible, so chose the hacky fix of altering the public field directly. The worst thing though is that I completely overlooked an already available method JobDispatcher.setMaxWorkers which adheres to the philosophy of encapsulation.

I added a new change [o29173] which renames the non-final static fields WORKER_THREAD_MAX_COUNT and WORKER_THREAD_TIMEOUT to workerThreadMaxCount and workerThreadTimeout and changes both their access levels from public to protected. I also utilized the setMaxWorkers method to mutate the protected field.

comment:4 Changed 8 years ago by stoecker

setMaxWorkers(): This was my work. Hmm, seems I had the same problem as you with renaming the variable :-)

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain The111.
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.