/*
 * Copyright 2012 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.errorprone.bugpatterns;

/**
 * @author ptoomey@google.com (Patrick Toomey)
 */
public class InvalidStringEqualityPositiveCases {

  public boolean testEquality(String x, String y) {
    boolean retVal;

    //BUG: Suggestion includes "x.equals(y)" 
    retVal = (x == y);
    //BUG: Suggestion includes "!x.equals(y)"
    retVal = (x != y);
    //BUG: Suggestion includes "(x + y).equals(y + x)"
    retVal = (x + y == y + x);
    //BUG: Suggestion includes "!(x + y).equals(y + x)"
    retVal = (x + y != y + x);
    //BUG: Suggestion includes "(x + "str").equals(y + "str")" 
    retVal = (x + "str" == y + "str");
    //BUG: Suggestion includes "!(x + "str").equals(y + "str")" 
    retVal = (x + "str" != y + "str");
    //BUG: Suggestion includes ""str".equals(x)"
    retVal = ("str" == x);
     //BUG: Suggestion includes ""str".equals(x)"
    retVal = (x == "str") ;
    //BUG: Suggestion includes ""str2".equals("str")"
    retVal = ("str2" == "str");    
    final String constValue = "str";
    //BUG: Suggestion includes "constValue.equals(x)"
    retval = (x == constValue);
    //BUG: Suggestion includes "!constValue.equals(x)"
    retval = (x != constValue);
    //BUG: Suggestion includes "(x + y + constValue).equals(x + y)"
    retval = (x + y + constValue == x + y);
    final String constValue2 = "str2";
    //BUG: Suggestion includes "(constValue + constValue2).equals(x)"
    retval = (constValue + constValue2 == x);
    //BUG: Suggestion includes "(constValue + constValue2).equals(x)"
    retval = (x == constValue + constValue2);

    return retVal;
  }

}

@@ -1685,33 +1685,33 @@
 uals(x)%22%0A    ret
-v
+V
 al = (x == const
@@ -1772,33 +1772,33 @@
 uals(x)%22%0A    ret
-v
+V
 al = (x != const
@@ -1872,33 +1872,33 @@
 (x + y)%22%0A    ret
-v
+V
 al = (x + y + co
@@ -2029,25 +2029,25 @@
 (x)%22%0A    ret
-v
+V
 al = (constV
@@ -2149,17 +2149,17 @@
 %0A    ret
-v
+V
 al = (x 

fix capitalization of retVal