Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 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:

Description

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 by The111, 11 years ago

Resolution: fixed
Status: newclosed

Fixed in [o29162].

Version 0, edited 11 years ago by The111 (next)

comment:2 by stoecker, 11 years ago

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 by The111, 11 years ago

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 by stoecker, 11 years ago

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
Action
as closed The owner will remain The111.
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.