Skip to content
This repository has been archived by the owner on Feb 23, 2022. It is now read-only.

Commit

Permalink
Fix String comparison to use value equality.
Browse files Browse the repository at this point in the history
Some places were using reference equality instead of value equality.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=96975509
  • Loading branch information
iflan committed Sep 28, 2015
1 parent ce4c0e6 commit 2fd63e3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/com/google/common/css/compiler/ast/CssTreeBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,7 @@ public void onOperator(ParserToken expressionToken) {
Preconditions.checkArgument(expressionToken.getToken().length() == 1);

// We are going to change the state unless it's a space operator
if (expressionToken.getToken() != " ") {

if (!" ".equals(expressionToken.getToken())) {
// We may need to construct the corresponding composite node if the last
// one in the list is not a composite node or if it is not based on the
// same operator
Expand All @@ -460,8 +459,8 @@ public void onOperator(ParserToken expressionToken) {
}

if (!(lastChild instanceof CssCompositeValueNode)
|| ((CssCompositeValueNode) lastChild).getOperator().toString()
== expressionToken.getToken()) {
|| ((CssCompositeValueNode) lastChild).getOperator().toString().equals(
expressionToken.getToken())) {
CssCompositeValueNode node = new CssCompositeValueNode(
Lists.newArrayList(lastChild),
Operator.valueOf(expressionToken.getToken().charAt(0)),
Expand Down

0 comments on commit 2fd63e3

Please sign in to comment.