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

Bernd Eckenfels ecki at zusammenkunft.net
Mon Jul 1 17:51:42 UTC 2019


Also the `is*` prefix would point to a boolean, that’s maybe a cleaner data type than a case sensitive string?


--
http://bernd.eckenfels.net

________________________________
Von: security-dev <security-dev-bounces at openjdk.java.net> im Auftrag von Xuelei Fan <xuelei.fan at oracle.com>
Gesendet: Montag, Juli 1, 2019 6:44 PM
An: security-dev at openjdk.java.net
Betreff: Request for Review [14] JDK-8226976, SessionTimeOutTests uses == operator for String value check

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";
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/security-dev/attachments/20190701/da67210a/attachment.html>


More information about the security-dev mailing list