You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sebb <se...@gmail.com> on 2009/03/30 16:05:02 UTC

[Compress] Do output streams really need the putNextEntry() method?

The abstract parent class for archive output streams has the method

putArchiveEntry(ArchiveEntry)

but all the implementations - apart from Ar - also define the specific method

putNextEntry(xxxArchiveEntry) where xxx = Zip, Jar, etc.

Do we really need the latter method?
Would it not just be simpler to keep the generic method and throw an
Exception (e.g. ClassCast or IllegalParameter) if the wrong type of
ArchiveEntry was provided?

If the method is needed, then it ought to be documented in the abstract class.

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


Re: [Compress] Do output streams really need the putNextEntry() method?

Posted by Stefan Bodewig <bo...@apache.org>.
On 2009-03-30, sebb <se...@gmail.com> wrote:

> On 30/03/2009, Stefan Bodewig <bo...@apache.org> wrote:
>> On 2009-03-30, sebb <se...@gmail.com> wrote:


>>> What about the corresponding getNextxxxEntry() methods?

>>> I suppose they do avoid a cast.


>> Yes, in one case (tar IIRC) they have been explicitly asked for via
>> JIRA.

> Could not find the JIRA issue.

It was a private email follow-up I received when I closed COMPRESS-49
that never made it into JIRA, sorry.

Stefan

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


Re: [Compress] Do output streams really need the putNextEntry() method?

Posted by sebb <se...@gmail.com>.
On 30/03/2009, Stefan Bodewig <bo...@apache.org> wrote:
> On 2009-03-30, sebb <se...@gmail.com> wrote:
>
>
> > What about the corresponding getNextxxxEntry() methods?
>
>  > I suppose they do avoid a cast.
>
>
> Yes, in one case (tar IIRC) they have been explicitly asked for via
>  JIRA.
>

Could not find the JIRA issue. The commit was r743259, which does not
mention a JIRA issue, nor can I find the revision number in JIRA. I
was hoping to use the JIRA reference in the class documentation ;-)

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

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


Re: [Compress] Do output streams really need the putNextEntry() method?

Posted by Stefan Bodewig <bo...@apache.org>.
On 2009-03-30, sebb <se...@gmail.com> wrote:

> What about the corresponding getNextxxxEntry() methods?

> I suppose they do avoid a cast.

Yes, in one case (tar IIRC) they have been explicitly asked for via
JIRA.

Stefan

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


Re: [Compress] Do output streams really need the putNextEntry() method?

Posted by Christian Grobmeier <gr...@gmail.com>.
> OK, I'll remove them.
>
> What about the corresponding getNextxxxEntry() methods?
> I suppose they do avoid a cast.

Correct.

I'll don't need them so specific stuff. For ChangeSet its all enough
to have ArchiveEntry aswell.

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


Re: [Compress] Do output streams really need the putNextEntry() method?

Posted by sebb <se...@gmail.com>.
On 30/03/2009, Stefan Bodewig <bo...@apache.org> wrote:
> On 2009-03-30, sebb <se...@gmail.com> wrote:
>
>  > The abstract parent class for archive output streams has the method
>
>  > putArchiveEntry(ArchiveEntry)
>
>  > but all the implementations - apart from Ar - also define the specific method
>
>  > putNextEntry(xxxArchiveEntry) where xxx = Zip, Jar, etc.
>
>  > Do we really need the latter method?
>
>
> Not really.
>
>  I assume they are there because the original codebases already
>  contained them.  In ZIP's case that's because the original Ant code
>  tried to mimic java.util.ZipOutputStream.

OK, I'll remove them.

What about the corresponding getNextxxxEntry() methods?

I suppose they do avoid a cast.

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

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


Re: [Compress] Do output streams really need the putNextEntry() method?

Posted by Stefan Bodewig <bo...@apache.org>.
On 2009-03-30, sebb <se...@gmail.com> wrote:

> The abstract parent class for archive output streams has the method

> putArchiveEntry(ArchiveEntry)

> but all the implementations - apart from Ar - also define the specific method

> putNextEntry(xxxArchiveEntry) where xxx = Zip, Jar, etc.

> Do we really need the latter method?

Not really.

I assume they are there because the original codebases already
contained them.  In ZIP's case that's because the original Ant code
tried to mimic java.util.ZipOutputStream.

Stefan


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