Erroneous String Compare
QiAnXinCodeSafe opened this issue · comments
奇安信CodeSafe commented
Strings should be compared with the equals() method, not == or !=.
Luke Sandberg commented
Typically that is true, but in this case we are attempting to ensure that
the user is passing us a constant string, by ensuring that it is interned.
So == is correct in this case.
…On Tue, Sep 3, 2019 at 1:29 AM 奇安信CodeSafe ***@***.***> wrote:
https://github.com/google/closure-templates/blob/f3aa5254595ab0ab66a0aa8e2a4be23b043a3e52/java/src/com/google/template/soy/data/SanitizedContents.java#L273
Strings should be compared with the equals() method, not == or !=.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#189?email_source=notifications&email_token=AABTJXDHXNTT4OOMYCVQYSLQHYN7XA5CNFSM4ITDNU4KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HI5L2DQ>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABTJXD3FZCLOWG4HX6NHBDQHYN7XANCNFSM4ITDNU4A>
.