You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Roland Weber (JIRA)" <ji...@apache.org> on 2007/04/07 13:17:32 UTC

[jira] Created: (HTTPCORE-65) Allow for explicit null in HttpContext and HttpParams

Allow for explicit null in HttpContext and HttpParams
-----------------------------------------------------

                 Key: HTTPCORE-65
                 URL: https://issues.apache.org/jira/browse/HTTPCORE-65
             Project: HttpComponents Core
          Issue Type: Improvement
          Components: HttpCore
    Affects Versions: 4.0-alpha4
            Reporter: Roland Weber
            Priority: Minor


Both HttpContext and HttpParams support hierarchies. The current implementations ([Sync]HttpExecutionContext, BasicHttpParams) do allow for overriding a parent/default value with another value, but they do not allow for overriding with null. Implementation alternatives:
- lookup the map entry instead of the value, do not fall back to parent/default if an entry is there with a null value
- use a dedicated constant to represent an explicit null value

cheers,
  Roland


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


[jira] Commented: (HTTPCORE-65) Allow for explicit null in HttpContext and HttpParams

Posted by "Roland Weber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-65?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487450 ] 

Roland Weber commented on HTTPCORE-65:
--------------------------------------

Hi Oleg,

I'm thinking from an application programmer's perspective. There is some component in HttpConn or HttpNIO or HttpAuth or whatever that expects and interprets parameters. For example a connection. There are default parameters loaded from somewhere, which get picked up by that HttpComponent. Now the application developer realizes that the defaults are good in general, but there is this one request that does not get executed correctly because of the default. If another value has to be set to replace the default, that is fine. Just put it in the request parameters. But what if there is no other value to be set, but only the default that should be unset? The application programmer has control over the HttpParam leaf object that is used by the component, but not over the component itself. Unless you expect application developers to hack HttpComponents code in this situation.

I recently stumbled over a case where explicit null values are used in a configuration file because of this problem. I didn't write it down though, so I don't have a link.

cheers,
  Roland


> Allow for explicit null in HttpContext and HttpParams
> -----------------------------------------------------
>
>                 Key: HTTPCORE-65
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-65
>             Project: HttpComponents Core
>          Issue Type: Improvement
>          Components: HttpCore
>    Affects Versions: 4.0-alpha4
>            Reporter: Roland Weber
>            Priority: Minor
>
> Both HttpContext and HttpParams support hierarchies. The current implementations ([Sync]HttpExecutionContext, BasicHttpParams) do allow for overriding a parent/default value with another value, but they do not allow for overriding with null. Implementation alternatives:
> - lookup the map entry instead of the value, do not fall back to parent/default if an entry is there with a null value
> - use a dedicated constant to represent an explicit null value
> cheers,
>   Roland

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


[jira] Commented: (HTTPCORE-65) Allow for explicit null in HttpContext and HttpParams

Posted by "Roland Weber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-65?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487409 ] 

Roland Weber commented on HTTPCORE-65:
--------------------------------------

Hi Oleg,

that method helps for outside inspection of an HttpParams object, but it does not solve the problem I raised. We should change the behavior of getParameter()/getAttribute() to not return a (grand-)parent value if the local object or one of the parents overrides with null.
An application that has a default, which is picked up for example when a request gets executed, can use isParameterSetLocally() to determine where exactly that parameter comes from. But knowing that the default is set on the HttpClient level does not help to un-set it for a specific request execution.

cheers,
  Roland



> Allow for explicit null in HttpContext and HttpParams
> -----------------------------------------------------
>
>                 Key: HTTPCORE-65
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-65
>             Project: HttpComponents Core
>          Issue Type: Improvement
>          Components: HttpCore
>    Affects Versions: 4.0-alpha4
>            Reporter: Roland Weber
>            Priority: Minor
>
> Both HttpContext and HttpParams support hierarchies. The current implementations ([Sync]HttpExecutionContext, BasicHttpParams) do allow for overriding a parent/default value with another value, but they do not allow for overriding with null. Implementation alternatives:
> - lookup the map entry instead of the value, do not fall back to parent/default if an entry is there with a null value
> - use a dedicated constant to represent an explicit null value
> cheers,
>   Roland

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


[jira] Commented: (HTTPCORE-65) Allow for explicit null in HttpContext and HttpParams

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

Oleg Kalnichevski commented on HTTPCORE-65:
-------------------------------------------

> As long as you can guarantee that the behavior of all components for any null parameter is identical to that of one specific parameter 
> that is explicitly given, this will not be needed.

Various *HttpParams helper classes are intended to take care of that (unless I am missing something). 

Oleg

> Allow for explicit null in HttpContext and HttpParams
> -----------------------------------------------------
>
>                 Key: HTTPCORE-65
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-65
>             Project: HttpComponents Core
>          Issue Type: Improvement
>          Components: HttpCore
>    Affects Versions: 4.0-alpha4
>            Reporter: Roland Weber
>            Priority: Minor
>
> Both HttpContext and HttpParams support hierarchies. The current implementations ([Sync]HttpExecutionContext, BasicHttpParams) do allow for overriding a parent/default value with another value, but they do not allow for overriding with null. Implementation alternatives:
> - lookup the map entry instead of the value, do not fall back to parent/default if an entry is there with a null value
> - use a dedicated constant to represent an explicit null value
> cheers,
>   Roland

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


[jira] Commented: (HTTPCORE-65) Allow for explicit null in HttpContext and HttpParams

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

Oleg Kalnichevski commented on HTTPCORE-65:
-------------------------------------------

Roland,

HttpParams interface has a method called isParameterSetLocally() that is intended exactly for that purpose. We could add something similar to  ExecutionContext. Would that solve the problem for you?

Oleg

> Allow for explicit null in HttpContext and HttpParams
> -----------------------------------------------------
>
>                 Key: HTTPCORE-65
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-65
>             Project: HttpComponents Core
>          Issue Type: Improvement
>          Components: HttpCore
>    Affects Versions: 4.0-alpha4
>            Reporter: Roland Weber
>            Priority: Minor
>
> Both HttpContext and HttpParams support hierarchies. The current implementations ([Sync]HttpExecutionContext, BasicHttpParams) do allow for overriding a parent/default value with another value, but they do not allow for overriding with null. Implementation alternatives:
> - lookup the map entry instead of the value, do not fall back to parent/default if an entry is there with a null value
> - use a dedicated constant to represent an explicit null value
> cheers,
>   Roland

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


[jira] Commented: (HTTPCORE-65) Allow for explicit null in HttpContext and HttpParams

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

Oleg Kalnichevski commented on HTTPCORE-65:
-------------------------------------------

You do not want the default value, you just do not read it, no? What specific use case do you have in mind?

Oleg

> Allow for explicit null in HttpContext and HttpParams
> -----------------------------------------------------
>
>                 Key: HTTPCORE-65
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-65
>             Project: HttpComponents Core
>          Issue Type: Improvement
>          Components: HttpCore
>    Affects Versions: 4.0-alpha4
>            Reporter: Roland Weber
>            Priority: Minor
>
> Both HttpContext and HttpParams support hierarchies. The current implementations ([Sync]HttpExecutionContext, BasicHttpParams) do allow for overriding a parent/default value with another value, but they do not allow for overriding with null. Implementation alternatives:
> - lookup the map entry instead of the value, do not fall back to parent/default if an entry is there with a null value
> - use a dedicated constant to represent an explicit null value
> cheers,
>   Roland

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


[jira] Resolved: (HTTPCORE-65) Allow for explicit null in HttpContext and HttpParams

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

Roland Weber resolved HTTPCORE-65.
----------------------------------

    Resolution: Won't Fix

As long as you can guarantee that the behavior of all components for any null parameter is identical to that of one specific parameter that is explicitly given, this will not be needed.

> Allow for explicit null in HttpContext and HttpParams
> -----------------------------------------------------
>
>                 Key: HTTPCORE-65
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-65
>             Project: HttpComponents Core
>          Issue Type: Improvement
>          Components: HttpCore
>    Affects Versions: 4.0-alpha4
>            Reporter: Roland Weber
>            Priority: Minor
>
> Both HttpContext and HttpParams support hierarchies. The current implementations ([Sync]HttpExecutionContext, BasicHttpParams) do allow for overriding a parent/default value with another value, but they do not allow for overriding with null. Implementation alternatives:
> - lookup the map entry instead of the value, do not fall back to parent/default if an entry is there with a null value
> - use a dedicated constant to represent an explicit null value
> cheers,
>   Roland

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


[jira] Commented: (HTTPCORE-65) Allow for explicit null in HttpContext and HttpParams

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

Oleg Kalnichevski commented on HTTPCORE-65:
-------------------------------------------

Roland,

I can't think of a single case where this might be useful, but I will not stand in your way, if you want to provide this feature.

Oleg

> Allow for explicit null in HttpContext and HttpParams
> -----------------------------------------------------
>
>                 Key: HTTPCORE-65
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-65
>             Project: HttpComponents Core
>          Issue Type: Improvement
>          Components: HttpCore
>    Affects Versions: 4.0-alpha4
>            Reporter: Roland Weber
>            Priority: Minor
>
> Both HttpContext and HttpParams support hierarchies. The current implementations ([Sync]HttpExecutionContext, BasicHttpParams) do allow for overriding a parent/default value with another value, but they do not allow for overriding with null. Implementation alternatives:
> - lookup the map entry instead of the value, do not fall back to parent/default if an entry is there with a null value
> - use a dedicated constant to represent an explicit null value
> cheers,
>   Roland

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