Change String comparison to equals() from == (#10022)
Motivation: Even if it was stored in the string constant pool, I thought it was safe to compare it through the Equals() method. Modification: So, I changed "==" comparison to equals() comparison Result: It has become safer to compare String values with different references and with the same values.
This commit is contained in:
parent
f88a343455
commit
1859170e69
@ -99,7 +99,7 @@ public class LastInboundHandler extends ChannelDuplexHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception {
|
public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception {
|
||||||
if (writabilityStates == "") {
|
if ("".equals(writabilityStates)) {
|
||||||
writabilityStates = String.valueOf(ctx.channel().isWritable());
|
writabilityStates = String.valueOf(ctx.channel().isWritable());
|
||||||
} else {
|
} else {
|
||||||
writabilityStates += "," + ctx.channel().isWritable();
|
writabilityStates += "," + ctx.channel().isWritable();
|
||||||
|
Loading…
Reference in New Issue
Block a user