RFR: 8048209 : (s) Collections.synchronizedNavigableSet().tailSet(Object, boolean) synchronizes on wrong object
Hello all; This change fixes an issue with the instance returned by Collections.synchronizedNavigableSet().tailSet(Object,boolean) which synchronizes on wrong object, itself rather than the same mutex as it's source. jbsbug: https://bugs.openjdk.java.net/browse/JDK-8048209 webrev: http://cr.openjdk.java.net/~mduigou/JDK-8048209/0/webrev/ Since I was concerned that there might be other lurking errors I opted to create a fairly thorough new test which, thankfully, revealed no additional problems. Mike
On Jul 24, 2014, at 12:12 AM, Mike Duigou <mike.duigou@oracle.com> wrote:
Hello all;
This change fixes an issue with the instance returned by Collections.synchronizedNavigableSet().tailSet(Object,boolean) which synchronizes on wrong object, itself rather than the same mutex as it's source.
jbsbug: https://bugs.openjdk.java.net/browse/JDK-8048209 webrev: http://cr.openjdk.java.net/~mduigou/JDK-8048209/0/webrev/
Since I was concerned that there might be other lurking errors I opted to create a fairly thorough new test which, thankfully, revealed no additional problems.
Looks good, i like the test re-structuring, just some minor comments on that. - there are some commented out asserts. - take or leave the following... the providers could be simplified a little if you return a Stream rather than a Collection for those make methods: Supplier<..> s = () -> Collections.synchronizedSortedSet(new TreeSet<>(BASE_COLLECTION)); Stream.of(s.get(), s.get().headSet("Foxtrot"), ...) map(c -> new Object[] {c}) and also use Stream.concat. Paul.
Looks good. Trivially, should you maintain the original bugId in the test? -Chris. On 24 Jul 2014, at 08:12, Mike Duigou <mike.duigou@oracle.com> wrote:
Hello all;
This change fixes an issue with the instance returned by Collections.synchronizedNavigableSet().tailSet(Object,boolean) which synchronizes on wrong object, itself rather than the same mutex as it's source.
jbsbug: https://bugs.openjdk.java.net/browse/JDK-8048209 webrev: http://cr.openjdk.java.net/~mduigou/JDK-8048209/0/webrev/
Since I was concerned that there might be other lurking errors I opted to create a fairly thorough new test which, thankfully, revealed no additional problems.
Mike
On Jul 24 2014, at 07:01 , Chris Hegarty <chris.hegarty@oracle.com> wrote:
Looks good.
Trivially, should you maintain the original bugId in the test?
The test file is actually an hg copy. I thought I would use more of the original file but did not. I will sever the link since the tests have no relation. Mike
-Chris.
On 24 Jul 2014, at 08:12, Mike Duigou <mike.duigou@oracle.com> wrote:
Hello all;
This change fixes an issue with the instance returned by Collections.synchronizedNavigableSet().tailSet(Object,boolean) which synchronizes on wrong object, itself rather than the same mutex as it's source.
jbsbug: https://bugs.openjdk.java.net/browse/JDK-8048209 webrev: http://cr.openjdk.java.net/~mduigou/JDK-8048209/0/webrev/
Since I was concerned that there might be other lurking errors I opted to create a fairly thorough new test which, thankfully, revealed no additional problems.
Mike
participants (3)
-
Chris Hegarty
-
Mike Duigou
-
Paul Sandoz