Re: PATCH [6901992] : Possible InvalidJarIndexException due to bug in sun.misc.JarIndex.merge()

2012-06-15 Thread Diego Belfer
Hi Chris,

Here is a new patch containing new version of the tests. The new versions
generate a the Jar on the fly as we discussed.

Let me know if there is anything else you think should be improved.

Best,
Diego

On Thu, Jun 14, 2012 at 7:32 AM, Chris Hegarty wrote:

> Diego,
>
> It's not too difficult to create jars on the fly using the Jar API. Here
> is a small example that I think would work nice in this case. Files created
> ( and paths are relative to the jtreg scratch, or working dir if running
> outside of jtreg ).
>
> Do you think you could use similar to create the jars for your test?
>
>createJar("a.jar", jarAList);
>createJar("b.jar", jarBList);
>...
>
>static void createJar(String jarName, Map contents)
>throws Exception
>{
>try (FileOutputStream aJar = new FileOutputStream(jarName);
> JarOutputStream jos = new JarOutputStream(aJar)) {
>Set> entries = contents.entrySet();
>for (Entry entry : entries)
>writeJarEntry(jos, entry.getKey(),
>  entry.getValue().getBytes("**ASCII"));
>}
>}
>
>static void writeJarEntry(JarOutputStream jos, String name, byte[] data)
>throws Exception
>{
>JarEntry entry = new JarEntry(name);
>jos.putNextEntry(entry);
>jos.write(data);
>}
>
>static final Map jarAList = new HashMap<>();
>static final Map jarBList = new HashMap<>();
>static {
>jarAList.put("com/foo/**resource1.txt", "some random data");
>jarAList.put("com/bar/**resource2.txt", "some more random data!");
>jarAList.put("com/baz/**resource3.txt", "even more random
> data!!!");
>jarBList.put("x/y/resourceA.**dat", "Hello there");
>jarBList.put("x/y/resourceB.**dat", "Goodbye");
>jarBList.put("x/y/resourceC.**dat", "Hello\nfrom\nb\ndot\njar");
>}
>
> Thanks,
> -Chris.
>
>
> On 14/06/2012 03:20, Diego Belfer wrote:
>
>> Hi Chris,
>>
>> There is no way to generate a jar without directory entries using the
>> jar tool; there is no option for that. What do you think is the best way
>> to handle this ?
>> I don't want to re-implement the logic for creating a jar using the
>> JarOutputStream class.
>>
>> Do you think it is possible to add a new option to the Jar tool Main
>> class to exclude directory entries? The option does not need to be
>> exposed by the command line tool to final users if this an issue,
>> although I think it may be useful for them too.
>>
>> Best,
>> Diego
>>
>>
>> On Wed, Jun 13, 2012 at 7:12 PM, Diego Belfer > > wrote:
>>
>>Chris,
>>
>>I was thinking of something similar. I will create the jars and
>>their contents using Java code. There is no need of creating real
>>class files, using a few resource files and some directories will be
>>enough.
>>
>>Best,
>>Diego
>>
>>
>>On Wed, Jun 13, 2012 at 6:46 PM, chris hegarty
>>> >
>> wrote:
>>
>>Diego,
>>
>>I'm thinking that some of the trivial source files, to compile
>>and built into the jars, could be simply created and written by
>>the test itself, rather than checking them all in. If this makes
>>it cleaner. I really don't like all the file in
>>test/sun/misc/JarIndex/__**metaInfFilenames, but at least it is
>>
>>quite understandable.
>>
>>-Chris.
>>
>>
>>On 13/06/2012 20:36, Diego Belfer wrote:
>>
>>Hi Chris,
>>
>>That's right. The only non-cleanup change is the one in the
>>merge.
>>
>>Regarding the test case,  I will re-write them in order to
>>generate the
>>jars on fly. I'd scanned the jdk/test folder and found a few
>>jars,
>>that's why I included them.  I have seen your test case, I
>>will use it
>>as a sample.
>>
>>I had not seen your comment in the bug report. Maybe there
>>are other
>>cases which trigger the InvalidJarIndexException, but, as
>>far as I could
>>see, the validIndex method checks that at least one entry of
>>the jar
>>matches the target path found in the index. If directory
>>entries are not
>>present in the jar, stripped paths generated during the
>>merge and used
>>by the index will return jars which may not contain entries
>>for them,
>>triggering the exception.
>>When all directory entries are present, if a jar contains an
>>entry for
>>"xxx/yyy/resource.file", it  will contain entries for "xxx",
>>"xxx/yyy"
>>and "xxx/yyy/resource.file".
>>
>>
>>Best,
>>Diego
>>
>>
>>On Wed, Jun 13, 2012 at 12:05 PM, Chris Hegarty
>>> 

hg: jdk8/tl/jdk: 7177556: Put TestProviderLeak.java on the ProblemList until test can be reworked

2012-06-15 Thread bradford . wetmore
Changeset: 8e5635ded425
Author:wetmore
Date:  2012-06-15 17:42 -0700
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/8e5635ded425

7177556: Put TestProviderLeak.java on the ProblemList until test can be reworked
Reviewed-by: khazra

! test/ProblemList.txt



hg: jdk8/tl/jdk: 7175758: Improve unit test of Map iterators and Iterator.remove()

2012-06-15 Thread mike . duigou
Changeset: e60cedd3a4aa
Author:mduigou
Date:  2012-06-15 13:01 -0700
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/e60cedd3a4aa

7175758: Improve unit test of Map iterators and Iterator.remove()
Summary: Adds additional tests of Map iterators and Iterator.remove()
Reviewed-by: lancea

! test/java/util/Map/Collisions.java



hg: jdk8/tl/jdk: 7176485: (bf) Allow temporary buffer cache to grow to IOV_MAX

2012-06-15 Thread alan . bateman
Changeset: 23394d686f74
Author:alanb
Date:  2012-06-15 17:16 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/23394d686f74

7176485: (bf) Allow temporary buffer cache to grow to IOV_MAX
Reviewed-by: chegar, coffeys

! make/java/nio/mapfile-linux
! make/java/nio/mapfile-solaris
! src/share/classes/sun/nio/ch/IOUtil.java
! src/share/classes/sun/nio/ch/Util.java
! src/solaris/native/sun/nio/ch/FileDispatcherImpl.c
! src/solaris/native/sun/nio/ch/IOUtil.c
! src/windows/native/sun/nio/ch/IOUtil.c
! src/windows/native/sun/nio/ch/SocketDispatcher.c
! src/windows/native/sun/nio/ch/nio_util.h



hg: jdk8/tl/jdk: 3 new changesets

2012-06-15 Thread sean . mullan
Changeset: 8deec0d1fc6f
Author:mullan
Date:  2012-06-15 08:43 -0400
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/8deec0d1fc6f

7176326: CertPath/CertPathBuilderTest failures after webrev 
6854712_6637288_7126011
Reviewed-by: xuelei

! src/share/classes/sun/security/provider/certpath/BasicChecker.java
+ test/java/security/cert/CertPathBuilder/zeroLengthPath/ZeroLengthPath.java

Changeset: 0e382512610f
Author:mullan
Date:  2012-06-15 08:47 -0400
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/0e382512610f

Merge


Changeset: e01b47409e37
Author:mullan
Date:  2012-06-15 09:16 -0400
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/e01b47409e37

Merge




hg: jdk8/tl/jdk: 7156963: Incorrect copyright header in java/io/SerialCallbackContext

2012-06-15 Thread sean . coffey
Changeset: 00c9d6cce3ec
Author:coffeys
Date:  2012-06-15 14:16 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/00c9d6cce3ec

7156963: Incorrect copyright header in java/io/SerialCallbackContext
Reviewed-by: weijun, coffeys
Contributed-by: edvard.wende...@oracle.com

! src/share/classes/java/io/SerialCallbackContext.java