Skip to content

Commit

Permalink
Merge pull request #896 from abersnaze/observable-string-remove-7
Browse files Browse the repository at this point in the history
removing java 7 dep
  • Loading branch information
abersnaze committed Feb 18, 2014
2 parents 89ff375 + 945e0ce commit ef2da8a
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import java.nio.charset.CoderResult;
import java.nio.charset.CodingErrorAction;
import java.util.Arrays;
import java.util.Objects;
import java.util.regex.Pattern;

import rx.Observable;
Expand Down Expand Up @@ -461,14 +460,23 @@ public String getText() {

@Override
public int hashCode() {
return Objects.hash(number, text);
int result = 31 + number;
result = 31 * result + (text == null ? 0 : text.hashCode());
return result;
}

@Override
public boolean equals(Object obj) {
if (!(obj instanceof Line))
return false;
return Objects.equals(number, ((Line) obj).number) && Objects.equals(text, ((Line) obj).text);
Line other = (Line) obj;
if (number != other.number)
return false;
if (other.text == text)
return true;
if (text == null)
return false;
return text.equals(other.text);
}

@Override
Expand Down

0 comments on commit ef2da8a

Please sign in to comment.