Request for Review [14] JDK-8226976, SessionTimeOutTests uses == operator for String value check

Sean Mullan sean.mullan at oracle.com
Mon Jul 1 16:42:12 UTC 2019


Hi Xuelei,

There was already an RFR post for this from Jaikiran: 
https://mail.openjdk.java.net/pipermail/security-dev/2019-June/020307.html

--Sean


On 7/1/19 12:33 PM, Xuelei Fan wrote:
> Hi,
> 
> In the following test case, "==" is used to compare two strings.  As is 
> not a comment coding convention.  I would like to use "equals()" method 
> instead.
> 
> Thanks,
> Xuelei
> 
> 
> $ hg diff test/jdk/javax/net/ssl/SSLSession/SessionTimeOutTests.java
> diff -r 73f1c84ca264 
> test/jdk/javax/net/ssl/SSLSession/SessionTimeOutTests.java
> --- a/test/jdk/javax/net/ssl/SSLSession/SessionTimeOutTests.java Thu Jun 
> 27 22:03:19 2019 +0200
> +++ b/test/jdk/javax/net/ssl/SSLSession/SessionTimeOutTests.java Mon Jul 
> 01 09:29:23 2019 -0700
> @@ -283,7 +283,7 @@
>               }
>               System.out.print(sess + "      " + lifetime);
>               if (((timeout == 0) || (lifetime < timeout)) &&
> -                                  (isTimedout == "YES")) {
> +                                  isTimedout.equals("YES")) {
>                   isTimedout = "Invalidated before timeout";
>               }


More information about the security-dev mailing list