You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2009/03/18 23:11:50 UTC

[jira] Created: (HTTPCORE-194) org.apache.http.protocol.BasicHttpProcessor is final but has protected final fields

org.apache.http.protocol.BasicHttpProcessor is final but has protected final fields
-----------------------------------------------------------------------------------

                 Key: HTTPCORE-194
                 URL: https://issues.apache.org/jira/browse/HTTPCORE-194
             Project: HttpComponents HttpCore
          Issue Type: Improvement
          Components: HttpCore
            Reporter: Sebb


org.apache.http.protocol.BasicHttpProcessor is final but has protected final fields which refer to mutable objects.

{code}
    protected final List requestInterceptors = new ArrayList(); 
    protected final List responseInterceptors = new ArrayList();
{code}

The protected qualifier could be reduced to package protected without affecting any 3rd party code.
Assuming that 3rd party code is not supposed to use the HC packages, then it seems to me that the fields should be made private.

The class is not currently thread-safe, but it does attempt to prevent null items from being added to the lists, however another package can circumvent this protection.
It would be safer if the fields were made private



-- 
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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Resolved: (HTTPCORE-194) org.apache.http.protocol.BasicHttpProcessor is final but has protected final fields

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-194?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved HTTPCORE-194.
---------------------------

    Resolution: Fixed

> org.apache.http.protocol.BasicHttpProcessor is final but has protected final fields
> -----------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-194
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-194
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>          Components: HttpCore
>            Reporter: Sebb
>
> org.apache.http.protocol.BasicHttpProcessor is final but has protected final fields which refer to mutable objects.
> {code}
>     protected final List requestInterceptors = new ArrayList(); 
>     protected final List responseInterceptors = new ArrayList();
> {code}
> The protected qualifier could be reduced to package protected without affecting any 3rd party code.
> Assuming that 3rd party code is not supposed to use the HC packages, then it seems to me that the fields should be made private.
> The class is not currently thread-safe, but it does attempt to prevent null items from being added to the lists, however another package can circumvent this protection.
> It would be safer if the fields were made private

-- 
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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCORE-194) org.apache.http.protocol.BasicHttpProcessor is final but has protected final fields

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12683212#action_12683212 ] 

Oleg Kalnichevski commented on HTTPCORE-194:
--------------------------------------------

Sebastian,

Feel free to just go ahead and fix things that need fixing

Oleg

> org.apache.http.protocol.BasicHttpProcessor is final but has protected final fields
> -----------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-194
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-194
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>          Components: HttpCore
>            Reporter: Sebb
>
> org.apache.http.protocol.BasicHttpProcessor is final but has protected final fields which refer to mutable objects.
> {code}
>     protected final List requestInterceptors = new ArrayList(); 
>     protected final List responseInterceptors = new ArrayList();
> {code}
> The protected qualifier could be reduced to package protected without affecting any 3rd party code.
> Assuming that 3rd party code is not supposed to use the HC packages, then it seems to me that the fields should be made private.
> The class is not currently thread-safe, but it does attempt to prevent null items from being added to the lists, however another package can circumvent this protection.
> It would be safer if the fields were made private

-- 
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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCORE-194) org.apache.http.protocol.BasicHttpProcessor is final but has protected final fields

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12683242#action_12683242 ] 

Sebb commented on HTTPCORE-194:
-------------------------------

OK - but I may be wrong ... also sometimes useful to have the JIRA issue anyway.

commit -m "HTTPCORE-194 - make fields final to prevent callers bypassing the null checks"
    Committed revision 755787.

> org.apache.http.protocol.BasicHttpProcessor is final but has protected final fields
> -----------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-194
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-194
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>          Components: HttpCore
>            Reporter: Sebb
>
> org.apache.http.protocol.BasicHttpProcessor is final but has protected final fields which refer to mutable objects.
> {code}
>     protected final List requestInterceptors = new ArrayList(); 
>     protected final List responseInterceptors = new ArrayList();
> {code}
> The protected qualifier could be reduced to package protected without affecting any 3rd party code.
> Assuming that 3rd party code is not supposed to use the HC packages, then it seems to me that the fields should be made private.
> The class is not currently thread-safe, but it does attempt to prevent null items from being added to the lists, however another package can circumvent this protection.
> It would be safer if the fields were made private

-- 
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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org