mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
forgot to check length()
This commit is contained in:
@@ -93,22 +93,6 @@ public class DiffString extends CharArrayCharSequence {
|
||||
System.arraycopy(myChars, myStart, dst, start, length());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
DiffString that = (DiffString)o;
|
||||
|
||||
if (length() != that.length()) return false;
|
||||
if (hashCode() != that.hashCode()) return false;
|
||||
for (int i = 0; i < length(); i++) {
|
||||
if (data(i) != that.data(i)) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static DiffString concatenateNullable(@Nullable DiffString s1, @Nullable DiffString s2) {
|
||||
if (s1 == null || s2 == null) {
|
||||
|
||||
@@ -78,7 +78,7 @@ public class CharArrayCharSequence implements CharSequenceBackedByArray, CharSeq
|
||||
if (this == anObject) {
|
||||
return true;
|
||||
}
|
||||
if (anObject == null || getClass() != anObject.getClass()) {
|
||||
if (anObject == null || getClass() != anObject.getClass() || length() != ((CharSequence)anObject).length()) {
|
||||
return false;
|
||||
}
|
||||
return CharArrayUtil.regionMatches(myChars, myStart, myEnd, (CharSequence)anObject);
|
||||
|
||||
Reference in New Issue
Block a user