RFR : 7148584 Jar tools fails to generate manifest correctly when boundary condition hit
Issue seen when the inner Manifest.FastInputStream.peek() method is called just as we hit EOF of main buffer being parsed (the manifest input file) Simple fix involves getting peek() to return -1 if a fill() request fails to read anything. webrev : http://cr.openjdk.java.net/~coffeys/webrev.7148584.jdk8/ Bug report : http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7148584 regards, Sean.
Looks fine. On 3/9/2012 7:52 AM, Seán Coffey wrote:
Issue seen when the inner Manifest.FastInputStream.peek() method is called just as we hit EOF of main buffer being parsed (the manifest input file)
Simple fix involves getting peek() to return -1 if a fill() request fails to read anything.
webrev : http://cr.openjdk.java.net/~coffeys/webrev.7148584.jdk8/ Bug report : http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7148584
regards, Sean.
On 09/03/2012 15:52, Seán Coffey wrote:
Issue seen when the inner Manifest.FastInputStream.peek() method is called just as we hit EOF of main buffer being parsed (the manifest input file)
Simple fix involves getting peek() to return -1 if a fill() request fails to read anything.
webrev : http://cr.openjdk.java.net/~coffeys/webrev.7148584.jdk8/ Bug report : http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7148584
regards, Sean.
The change looks okay to me. On the test case then I assume it could have been done with the java.util.jar APIs rather than calling into the jar command. Also it might be cleaner to use try-with-resources. -Alan.
Alan, I did (briefly) look into using the java.util.jar API but wasn't seeing the bug being triggered. Decided to use the jar process command as an alternative. The testcase was a port from JDK 6 and didn't contain JDK 7+ features. I've converted it now though. Hope it's cleaner. http://cr.openjdk.java.net/~coffeys/webrev.7148584.jdk8.2/ regards, Sean. On 09/03/2012 16:18, Alan Bateman wrote:
On 09/03/2012 15:52, Seán Coffey wrote:
Issue seen when the inner Manifest.FastInputStream.peek() method is called just as we hit EOF of main buffer being parsed (the manifest input file)
Simple fix involves getting peek() to return -1 if a fill() request fails to read anything.
webrev : http://cr.openjdk.java.net/~coffeys/webrev.7148584.jdk8/ Bug report : http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7148584
regards, Sean.
The change looks okay to me.
On the test case then I assume it could have been done with the java.util.jar APIs rather than calling into the jar command. Also it might be cleaner to use try-with-resources.
-Alan.
On 12/03/2012 09:28, Seán Coffey wrote:
Alan,
I did (briefly) look into using the java.util.jar API but wasn't seeing the bug being triggered. Decided to use the jar process command as an alternative.
The testcase was a port from JDK 6 and didn't contain JDK 7+ features. I've converted it now though. Hope it's cleaner. http://cr.openjdk.java.net/~coffeys/webrev.7148584.jdk8.2/ Thanks Sean, the test looks much better now so thumbs up from me.
-Alan
On 03/12/2012 11:27 AM, Alan Bateman wrote:
On 12/03/2012 09:28, Seán Coffey wrote:
Alan,
I did (briefly) look into using the java.util.jar API but wasn't seeing the bug being triggered. Decided to use the jar process command as an alternative.
The testcase was a port from JDK 6 and didn't contain JDK 7+ features. I've converted it now though. Hope it's cleaner. http://cr.openjdk.java.net/~coffeys/webrev.7148584.jdk8.2/ Thanks Sean, the test looks much better now so thumbs up from me.
-Alan
Hi Sean, the classpath attribute key in a Manifest is 'Class-Path' with a big 'P', so the test run but I'm not sure it tests what it should. Rémi
On 12/03/2012 11:34, Rémi Forax wrote:
Hi Sean, the classpath attribute key in a Manifest is 'Class-Path' with a big 'P', so the test run but I'm not sure it tests what it should.
Rémi
Attribute names are case insensitive so it shouldn't case a problem, but I agree it would have been nicer to use Class-Path. -Alan.
participants (4)
-
Alan Bateman
-
Rémi Forax
-
Seán Coffey
-
Xueming Shen