I agree, this would be a short cut in case of cs is not a String.In case of cs is a String, user likely would have used the standard equals() method to avoid the double check by instanceof.
In case of HotSpot compilation AND inlining, there should be no difference.
-Ulf Am 04.01.2010 16:15, Alexander Veit schrieb:
Hi,it seems thatif (cs.equals(this)) return true; should be replaced with if (cs instanceof String) return cs.equals(this); or completely left out. Does anyone agree?