Code Review Request JDK-8161106 Improve SSLSocket test template

Bradford Wetmore bradford.wetmore at oracle.com
Wed Oct 26 16:31:19 UTC 2016


Xuelei,

Sorry that I didn't have time to look at this earlier.

Why did you create a new file SSLSocketSample.java instead of just 
updating SSLSocketTemplate.java?  Why should I use one vs the other?

IMHO, unless there's a good reason to keep both, we should just copy the 
contents of SSLSocketSample.java to SSLSocketTemplate.java, and remove 
SSLSocketSample.java.

Brad



On 7/24/2016 10:22 PM, Weijun Wang wrote:
>
>
> On 7/25/2016 13:14, Xuelei Fan wrote:
>> On 7/25/2016 12:15 PM, Weijun Wang wrote:
>>> Is it possible to use a single new CountDownLatch(2)?
>>>
>> Per the spec, the countDown() release all waiting threads if the count
>> reaches zero, and the await() will not return until the latch has
>> counted down to zero, or interrupted or timeout.  It's difficult to use
>> one instance of CountDownLatch(2) for two conditions.
>
> Ah, yes. I forgot about that.
>
>>
>>> Also, I think comments on lines 145-149 and 199-203 are not really
>>> necessary, the println() lines after them are quite clear.
>>>
>> The comments make the logic easier to understand, I think.  Let's keep
>> the comments if it is not a big concern of yours.
>
> Sure.
>
> So everything looks fine to me.
>
> Thanks
> Max
>
>>
>> Thanks,
>> Xuelei
>>
>>> --Max
>>>
>>> On 7/25/2016 11:38, Xuelei Fan wrote:
>>>> Hi Weijun,
>>>>
>>>> Please review this update.  Per you suggestion, I updated to use
>>>> CountDownLatch for the synchronization between client and server.
>>>> CountDownLatch is more simple than ReentrantLock in the context.
>>>>
>>>>     http://cr.openjdk.java.net/~xuelei/8161106/webrev.03/
>>>>
>>>> Thanks,
>>>> Xuelei
>>>>
>>


More information about the security-dev mailing list