RFR: JDK-8168141: javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java: No notif received!

Staffan Larsen staffan.larsen at oracle.com
Tue Nov 8 10:58:08 UTC 2016


Spurious wakeups can cause wait() to finish early in which case the while loop is needed. But the timeout to wait() doesn’t add anything. And if the while loop is there the next statement is not needed:


112         if (li.received < 1) {
113             throw new RuntimeException("No notif received!");


> On 8 Nov 2016, at 11:44, Robbin Ehn <robbin.ehn at oracle.com> wrote:
> 
> Hi Ujwal,
> 
> synchronized(li) {
> 	while (li.received < 1) {
> 		li.wait(100);
> 	}
> }
> 
> I don't see why we need while loop ?
> 
> To me it looks like you could just do:
> 
> synchronized(li) {
> 	li.wait();
> }
> 
> Since either we got notification and received must be bigger than 0.
> Or jtreg timed out.
> 
> /Robbin ('r'eviewer)
> 
> On 11/04/2016 12:03 PM, Ujwal Vangapally wrote:
>> Please review this small change for the bug below
>> 
>> https://bugs.openjdk.java.net/browse/JDK-8168141
>> 
>> Webrev:
>> http://cr.openjdk.java.net/~asapre/sponsorships/Ujwal/JDK-8168141/webrev.01/
>> 
>> 
>> Thanks,
>> Ujwal.



More information about the serviceability-dev mailing list