[PATCH] Review quest for bug 8023878 TEST_BUG java/nio/file/WatchService/SensitivityModifier.java fails intermittently

Eric Wang yiming.wang at oracle.com
Mon Sep 9 05:35:20 PDT 2013


On 2013/9/6 3:44, Alan Bateman wrote:
> On 03/09/2013 13:15, Eric Wang wrote:
>> Hi,
>>
>> Please help to review the fix 
>> http://cr.openjdk.java.net/~ewang/8023878/webrev.00/ for bug 
>> https://bugs.openjdk.java.net/browse/JDK-8023878.
>>
>> There's a defect in the loop of old test as below, if the 
>> eventRecived is true, the while loop is broken which causes keys of 
>> watcher are not reset, it causes the watcher.take() is hung in next 
>> execution in the for loop.
> Sorry the delay, I've been busy with other things.
>
> I think your analysis is right, the while loop terminates when the 
> event is detected but there may be more than one event queued. Your 
> fixes looks okay, an alternative would be to just change L106 only.
>
> -Alan
Hi Alan,

I added the if (!eventReceived) to avoid unnecessary loop for 
performance concern, but it is not a issue for a simple test. below is 
the alternative. if you are OK with it, please help to be my sponsor.

http://cr.openjdk.java.net/~ewang/8023878/webrev.01/ 
<http://cr.openjdk.java.net/%7Eewang/8023878/webrev.01/>
Thanks,
Eric


More information about the nio-dev mailing list