[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12565060#action_12565060
 ] 

Sebb commented on HTTPCLIENT-740:
---------------------------------

The RefQueueWorker constructor is passed "this" as a parameter, and uses that 
to call handleReference().

Even if the class is not extended, this is a bug, because the constructor has 
not finished, and therefore the object may not have been completely constructed.

The "this" reference must not be used by another thread until the constructor 
returns. The started thread may use it before the constructor returns.

[See p41 of Java Concurrency in Practice for more details]

> AbstractConnPool constructor calls thread.Start()
> -------------------------------------------------
>
>                 Key: HTTPCLIENT-740
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-740
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>            Reporter: Sebb
>            Priority: Trivial
>
> AbstractConnPool constructor calls thread.Start()
> Findbugs says:
> Constructor invokes Thread.start()
> The constructor starts a thread. This is likely to be wrong if the class is 
> ever extended/subclassed, since the thread will be started before the 
> subclass constructor is started.
> The class is not final (and the constructor is protected) which suggests that 
> the class is intended to be extended...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to