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 <se...@gmail.com> on 2013/06/17 15:52:19 UTC

Writes to AbstractContentEncoder.completed field

At present, the classes ChunkEncoder and LengthDelimitedEncoder both
use the code

this.completed = true;

This is equivalent to super.complete(); these are the only remaining
external acceses to the field.

Any objections to making that change?

The completed field can then be deprecated so accidental external
access will be flagged.

One day we can make it private, which will stop completed from ever
being reset back to false (which I assume would cause some problems!)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Writes to AbstractContentEncoder.completed field

Posted by sebb <se...@gmail.com>.
On 17 June 2013 17:24, Oleg Kalnichevski <ol...@apache.org> wrote:
> On Mon, 2013-06-17 at 14:52 +0100, sebb wrote:
>> At present, the classes ChunkEncoder and LengthDelimitedEncoder both
>> use the code
>>
>> this.completed = true;
>>
>> This is equivalent to super.complete(); these are the only remaining
>> external acceses to the field.
>>
>> Any objections to making that change?
>>
>> The completed field can then be deprecated so accidental external
>> access will be flagged.
>>
>> One day we can make it private, which will stop completed from ever
>> being reset back to false (which I assume would cause some problems!)
>
> This will probably help make FindBugs reports look prettier but will
> hardly make a difference unless we make a decision to stop using direct
> access to protected variables consistently across the code base.

I think it will help slightly because the compiler will warn about access.
So at least usages within the HC codebase will be flagged and can be
resolved, even if external code can still bypass the access methods.
If external code ignores the deprecation then it suffers any consequences ...

> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Writes to AbstractContentEncoder.completed field

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, 2013-06-17 at 14:52 +0100, sebb wrote:
> At present, the classes ChunkEncoder and LengthDelimitedEncoder both
> use the code
> 
> this.completed = true;
> 
> This is equivalent to super.complete(); these are the only remaining
> external acceses to the field.
> 
> Any objections to making that change?
> 
> The completed field can then be deprecated so accidental external
> access will be flagged.
> 
> One day we can make it private, which will stop completed from ever
> being reset back to false (which I assume would cause some problems!)

This will probably help make FindBugs reports look prettier but will
hardly make a difference unless we make a decision to stop using direct
access to protected variables consistently across the code base.

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org