You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Stefan Bodewig <bo...@apache.org> on 2011/07/21 06:04:16 UTC

[compress] Require Java5?

Hi,

no, this is not about generics or enums or ...

This time it is methods added in the classlib, in particular
java.util.zip.Inflater#getBytesRead and friends which return longs
rather than ints that are returned by getTotalIn.

Since ZIP entry size is an unsigned four byte int even without Zip64
support it simply doesn't fit into an int and some bugs cannot properly
be fixed by using the Java4 method. (COMPRESS-129 is one).

Things will become worse with Zip64 as we'd need unsigned longs but I'm
willing to accept that as theoretical cases.

The alternative would be to use some reflection magic inside the ZIP
package (which I'm willing to do).

Stefan

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


Re: [compress] Require Java5?

Posted by Christian Grobmeier <gr...@gmail.com>.
> I like the idea of many smaller consecutive releases (release early,
> release often) instead of a big bang release.
>
> For example:
>
> - 1.2: Current trunk to gather bug fixes
> - 1.3: Zip64 (Java 5)
> - 2.0: Break compatibility, generics, and so on.
>

+1, i like that approach very much!

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


Re: [compress] Require Java5?

Posted by Gary Gregory <ga...@gmail.com>.
On Thu, Jul 21, 2011 at 5:19 AM, Stefan Bodewig <bo...@apache.org> wrote:
> On 2011-07-21, Christian Grobmeier wrote:
>
>> On Thu, Jul 21, 2011 at 10:44 AM, Stefan Bodewig <bo...@apache.org> wrote:
>>> On 2011-07-21, Christian Grobmeier wrote:
>
>>>> If we lift up to 1.5 as a minimum what about lifting to compress 2.0?
>
>>> Depends on what we want to do.  If we want to break BWC by introducing
>>> genrics, then let's do that.  I am currently withholding some work I
>>> started to get the permissions stuff straightened because the API would
>>> look quite different with enums.
>
>> I am heavily +1 on a good looking, modern API. All the compression
>> implementations are complex enough.
>
> Agreed.  I really didn't want to to open his can of worms, though.  To
> me it seems we have two questions that can be addressed separately - do
> we want to require Java5 and do we want to break API compatibility.
>
> It is quite possible the answer is yes to both.  OTOH we could do this
> in two steps and release the accumulated bugfixes in a 1.2 version that
> already requires Java5 but doesn't break any APIs and then redesign for
> 2.x using genrics and whatnot.

+1 to Java 5.

I like the idea of many smaller consecutive releases (release early,
release often) instead of a big bang release.

For example:

- 1.2: Current trunk to gather bug fixes
- 1.3: Zip64 (Java 5)
- 2.0: Break compatibility, generics, and so on.

Gary

>
>>> On top Java5 would give us a pack200 compressor mor or less for free,
>>> but this could be done without breaking APIs as well.
>
>> Not sure what you mean - Java 5 is giving it to you for free and with
>> Java 1.4 you need to implement it all yourself?
>
> Basically yes,
> <http://download.oracle.com/javase/1.5.0/docs/api/java/util/jar/Pack200.html>
> only that I wouldn't implement it in Java 1.4 at all.
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>



-- 
Thank you,
Gary

http://garygregory.wordpress.com/
http://garygregory.com/
http://people.apache.org/~ggregory/
http://twitter.com/GaryGregory

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


Re: [compress] Require Java5?

Posted by Stefan Bodewig <bo...@apache.org>.
On 2011-07-21, sebb wrote:

> However just doing that without adding @Override and minimal generics
> will result in compilation warnings; it seems wromg to release source
> that does not compile cleanly.

The zip64 branch now requires Java5 but I'm having a hard time seeing
any compiler warnings.  The compiler plugin in commons-parent doesn't
allow me to set showWarnings and my clumsy attempts to override the
configuration in my pom have all failed so far (as has running mvn with
-Dmaven.compiler.showWarnings) - I'm outside of my Maven Fu.

So far I don't see a single warning which must be wrong.

Stefan

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


Re: [compress] Require Java5?

Posted by sebb <se...@gmail.com>.
On 21 July 2011 10:19, Stefan Bodewig <bo...@apache.org> wrote:
> On 2011-07-21, Christian Grobmeier wrote:
>
>> On Thu, Jul 21, 2011 at 10:44 AM, Stefan Bodewig <bo...@apache.org> wrote:
>>> On 2011-07-21, Christian Grobmeier wrote:
>
>>>> If we lift up to 1.5 as a minimum what about lifting to compress 2.0?
>
>>> Depends on what we want to do.  If we want to break BWC by introducing
>>> genrics, then let's do that.  I am currently withholding some work I
>>> started to get the permissions stuff straightened because the API would
>>> look quite different with enums.
>
>> I am heavily +1 on a good looking, modern API. All the compression
>> implementations are complex enough.
>
> Agreed.  I really didn't want to to open his can of worms, though.  To
> me it seems we have two questions that can be addressed separately - do
> we want to require Java5 and do we want to break API compatibility.
>
> It is quite possible the answer is yes to both.  OTOH we could do this
> in two steps and release the accumulated bugfixes in a 1.2 version that
> already requires Java5 but doesn't break any APIs and then redesign for
> 2.x using genrics and whatnot.

+1 to requiring Java 1.5

However just doing that without adding @Override and minimal generics
will result in compilation warnings; it seems wromg to release source
that does not compile cleanly.

AFAIK generics do not break binary compatibility, but it can be tricky
to get the types correct.

>>> On top Java5 would give us a pack200 compressor mor or less for free,
>>> but this could be done without breaking APIs as well.
>
>> Not sure what you mean - Java 5 is giving it to you for free and with
>> Java 1.4 you need to implement it all yourself?
>
> Basically yes,
> <http://download.oracle.com/javase/1.5.0/docs/api/java/util/jar/Pack200.html>
> only that I wouldn't implement it in Java 1.4 at all.
>
> 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] Require Java5?

Posted by Stefan Bodewig <bo...@apache.org>.
On 2011-07-21, Christian Grobmeier wrote:

> On Thu, Jul 21, 2011 at 10:44 AM, Stefan Bodewig <bo...@apache.org> wrote:
>> On 2011-07-21, Christian Grobmeier wrote:

>>> If we lift up to 1.5 as a minimum what about lifting to compress 2.0?

>> Depends on what we want to do.  If we want to break BWC by introducing
>> genrics, then let's do that.  I am currently withholding some work I
>> started to get the permissions stuff straightened because the API would
>> look quite different with enums.

> I am heavily +1 on a good looking, modern API. All the compression
> implementations are complex enough.

Agreed.  I really didn't want to to open his can of worms, though.  To
me it seems we have two questions that can be addressed separately - do
we want to require Java5 and do we want to break API compatibility.

It is quite possible the answer is yes to both.  OTOH we could do this
in two steps and release the accumulated bugfixes in a 1.2 version that
already requires Java5 but doesn't break any APIs and then redesign for
2.x using genrics and whatnot.

>> On top Java5 would give us a pack200 compressor mor or less for free,
>> but this could be done without breaking APIs as well.

> Not sure what you mean - Java 5 is giving it to you for free and with
> Java 1.4 you need to implement it all yourself?

Basically yes,
<http://download.oracle.com/javase/1.5.0/docs/api/java/util/jar/Pack200.html>
only that I wouldn't implement it in Java 1.4 at all.

Stefan

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


Re: [compress] Require Java5?

Posted by Christian Grobmeier <gr...@gmail.com>.
On Thu, Jul 21, 2011 at 10:44 AM, Stefan Bodewig <bo...@apache.org> wrote:
> On 2011-07-21, Christian Grobmeier wrote:
>
>> If we lift up to 1.5 as a minimum what about lifting to compress 2.0?
>
> Depends on what we want to do.  If we want to break BWC by introducing
> genrics, then let's do that.  I am currently withholding some work I
> started to get the permissions stuff straightened because the API would
> look quite different with enums.

I am heavily +1 on a good looking, modern API. All the compression
implementations are complex enough.

I just read you other mail on Compress-18. As I understand it, J5
would give you some more freedom on this one.

> On top Java5 would give us a pack200 compressor mor or less for free,
> but this could be done without breaking APIs as well.

Not sure what you mean - Java 5 is giving it to you for free and with
Java 1.4 you need to implement it all yourself? If this is the
question I would go for the free version. Java 1.4 is dead and even
Java 5 is old.

In the past 3 years I have not heard of any comercial project using
1.4.2. Even my financial customer recently decided to upgrade from
Java 1.3 (!!) to Java 6 - leaving out Java 1.4 ;-)

Cheers
Christian

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


Re: [compress] Require Java5?

Posted by Stefan Bodewig <bo...@apache.org>.
On 2011-07-21, Christian Grobmeier wrote:

> If we lift up to 1.5 as a minimum what about lifting to compress 2.0?

Depends on what we want to do.  If we want to break BWC by introducing
genrics, then let's do that.  I am currently withholding some work I
started to get the permissions stuff straightened because the API would
look quite different with enums.

On top Java5 would give us a pack200 compressor mor or less for free,
but this could be done without breaking APIs as well.

Stefan

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


Re: [compress] Require Java5?

Posted by Niall Pemberton <ni...@gmail.com>.
On Thu, Jul 21, 2011 at 9:08 AM, Christian Grobmeier
<gr...@gmail.com> wrote:
> On Thu, Jul 21, 2011 at 9:50 AM, Henri Yandell <fl...@gmail.com> wrote:
>> I think the argument is the other way. You should be explaining why
>> you wouldn't simply just move to Java 5.
>
> +1 - Java 1.4 must die now.
>
>> +1 to JDK 1.5 minimum.
>
> +1
>
> If we lift up to 1.5 as a minimum what about lifting to compress 2.0?
> Then we can speak about generics and enums too because we don't need
> to be so strict on BC :-)

Moving to Java 5 and using generics doesn't necessarily mean a break
in backwards compatibility. Commons IO 2.0 did this and was backwardly
compatible.

I would suggest doing the compatible changes first and make a
list(JIRA) of incompatible changes. If its small then it may be more
desirable to deprecate & add new method names.

Niall

> Cheers
> Christian
>
>>
>> Hen
>>
>> On Wed, Jul 20, 2011 at 9:04 PM, Stefan Bodewig <bo...@apache.org> wrote:
>>> Hi,
>>>
>>> no, this is not about generics or enums or ...
>>>
>>> This time it is methods added in the classlib, in particular
>>> java.util.zip.Inflater#getBytesRead and friends which return longs
>>> rather than ints that are returned by getTotalIn.
>>>
>>> Since ZIP entry size is an unsigned four byte int even without Zip64
>>> support it simply doesn't fit into an int and some bugs cannot properly
>>> be fixed by using the Java4 method. (COMPRESS-129 is one).
>>>
>>> Things will become worse with Zip64 as we'd need unsigned longs but I'm
>>> willing to accept that as theoretical cases.
>>>
>>> The alternative would be to use some reflection magic inside the ZIP
>>> package (which I'm willing to do).
>>>
>>> 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
>>
>>
>
>
>
> --
> http://www.grobmeier.de
>
> ---------------------------------------------------------------------
> 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] Require Java5?

Posted by Simone Tripodi <si...@apache.org>.
Hi all guys,
I'm +1 to Java5 too.

And IMHO many other should follow the same path :P
Have a nice day, all the best!
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Thu, Jul 21, 2011 at 10:08 AM, Christian Grobmeier
<gr...@gmail.com> wrote:
> On Thu, Jul 21, 2011 at 9:50 AM, Henri Yandell <fl...@gmail.com> wrote:
>> I think the argument is the other way. You should be explaining why
>> you wouldn't simply just move to Java 5.
>
> +1 - Java 1.4 must die now.
>
>> +1 to JDK 1.5 minimum.
>
> +1
>
> If we lift up to 1.5 as a minimum what about lifting to compress 2.0?
> Then we can speak about generics and enums too because we don't need
> to be so strict on BC :-)
>
> Cheers
> Christian
>
>>
>> Hen
>>
>> On Wed, Jul 20, 2011 at 9:04 PM, Stefan Bodewig <bo...@apache.org> wrote:
>>> Hi,
>>>
>>> no, this is not about generics or enums or ...
>>>
>>> This time it is methods added in the classlib, in particular
>>> java.util.zip.Inflater#getBytesRead and friends which return longs
>>> rather than ints that are returned by getTotalIn.
>>>
>>> Since ZIP entry size is an unsigned four byte int even without Zip64
>>> support it simply doesn't fit into an int and some bugs cannot properly
>>> be fixed by using the Java4 method. (COMPRESS-129 is one).
>>>
>>> Things will become worse with Zip64 as we'd need unsigned longs but I'm
>>> willing to accept that as theoretical cases.
>>>
>>> The alternative would be to use some reflection magic inside the ZIP
>>> package (which I'm willing to do).
>>>
>>> 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
>>
>>
>
>
>
> --
> http://www.grobmeier.de
>
> ---------------------------------------------------------------------
> 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] Require Java5?

Posted by Christian Grobmeier <gr...@gmail.com>.
On Thu, Jul 21, 2011 at 9:50 AM, Henri Yandell <fl...@gmail.com> wrote:
> I think the argument is the other way. You should be explaining why
> you wouldn't simply just move to Java 5.

+1 - Java 1.4 must die now.

> +1 to JDK 1.5 minimum.

+1

If we lift up to 1.5 as a minimum what about lifting to compress 2.0?
Then we can speak about generics and enums too because we don't need
to be so strict on BC :-)

Cheers
Christian

>
> Hen
>
> On Wed, Jul 20, 2011 at 9:04 PM, Stefan Bodewig <bo...@apache.org> wrote:
>> Hi,
>>
>> no, this is not about generics or enums or ...
>>
>> This time it is methods added in the classlib, in particular
>> java.util.zip.Inflater#getBytesRead and friends which return longs
>> rather than ints that are returned by getTotalIn.
>>
>> Since ZIP entry size is an unsigned four byte int even without Zip64
>> support it simply doesn't fit into an int and some bugs cannot properly
>> be fixed by using the Java4 method. (COMPRESS-129 is one).
>>
>> Things will become worse with Zip64 as we'd need unsigned longs but I'm
>> willing to accept that as theoretical cases.
>>
>> The alternative would be to use some reflection magic inside the ZIP
>> package (which I'm willing to do).
>>
>> 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
>
>



-- 
http://www.grobmeier.de

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


Re: [compress] Require Java5?

Posted by Henri Yandell <fl...@gmail.com>.
I think the argument is the other way. You should be explaining why
you wouldn't simply just move to Java 5.

+1 to JDK 1.5 minimum.

Hen

On Wed, Jul 20, 2011 at 9:04 PM, Stefan Bodewig <bo...@apache.org> wrote:
> Hi,
>
> no, this is not about generics or enums or ...
>
> This time it is methods added in the classlib, in particular
> java.util.zip.Inflater#getBytesRead and friends which return longs
> rather than ints that are returned by getTotalIn.
>
> Since ZIP entry size is an unsigned four byte int even without Zip64
> support it simply doesn't fit into an int and some bugs cannot properly
> be fixed by using the Java4 method. (COMPRESS-129 is one).
>
> Things will become worse with Zip64 as we'd need unsigned longs but I'm
> willing to accept that as theoretical cases.
>
> The alternative would be to use some reflection magic inside the ZIP
> package (which I'm willing to do).
>
> 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