#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 , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 12 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 , 12 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 , 12 years ago
setMaxWorkers(): This was my work. Hmm, seems I had the same problem as you with renaming the variable :-)
Fixed in [o29162] and [o29173].