commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Grobmeier <grobme...@gmail.com>
Subject [compress] Patch for SANDBOX-284
Date Tue, 17 Mar 2009 07:48:12 GMT
Hi all,

just made a quick fix for SANDBOX-284:
https://issues.apache.org/jira/browse/SANDBOX-284

I could not test it with a general working testcase, since this is a
platform problem and i have only OSX.
However, GUMP will not run on windows too, i guess. I think here is
some refactoring necessary to make
this code more testable.

Before I do this, this brings me to a question of codestyle. I prefer
to do quite less in the constructor. TarArchiveEntry does quite much,
and i think this is necessary in this case. The other option would be
to construct it empty and do all that stuff in a setter, which would
bring no benefit. To make it testable, I would have to extract some
methods from the constructor. Normally I would mark them private, but
private methods cannot be tested, except with reflection.

My question is, is it common use at commons to test with reflection in
that special and rare cases? Or should I mark the package scoped, just
for the sake of testability?

I think I would prefer option one, even when it reminds me on the
story with cannonballs and that birds.

Cheers,
Christian

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


Mime
View raw message