Suppress "Unlikely argument type for equals()" warnings in tests
This new warning was introduced in Eclipse 4.7 Oxygen [1]. The only instances of the warning are in test code that is asserting that some class does not compare equal to Strings. As in the Gerrit project [2] these asserts are arguably overkill, but arguably also a reasonable test of an equals implementation. Ignore the warning in these cases. Note that if the project is opened in an earlier version of Eclipse, a warning "Unsupported @SuppressWarnings" will be emitted. [1] https://www.eclipse.org/eclipse/news/4.7/M6/ [2] https://gerrit-review.googlesource.com/#/c/gerrit/+/110339/ Change-Id: I08ea33d71e6009cf0f37e6492a475931f447256b Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
parent
021e72b801
commit
190b575be1
|
@ -587,6 +587,7 @@ public void testGetFirstByte() {
|
||||||
assertEquals(id.getFirstByte(), a.getFirstByte());
|
assertEquals(id.getFirstByte(), a.getFirstByte());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unlikely-arg-type")
|
||||||
@Test
|
@Test
|
||||||
public void testNotEquals() {
|
public void testNotEquals() {
|
||||||
AbbreviatedLongObjectId a = new LongObjectId(1L, 2L, 3L, 4L)
|
AbbreviatedLongObjectId a = new LongObjectId(1L, 2L, 3L, 4L)
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
public class EditListTest {
|
public class EditListTest {
|
||||||
|
@SuppressWarnings("unlikely-arg-type")
|
||||||
@Test
|
@Test
|
||||||
public void testEmpty() {
|
public void testEmpty() {
|
||||||
final EditList l = new EditList();
|
final EditList l = new EditList();
|
||||||
|
|
|
@ -125,6 +125,7 @@ public void testToString() {
|
||||||
assertEquals("REPLACE(1-2,1-4)", e.toString());
|
assertEquals("REPLACE(1-2,1-4)", e.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unlikely-arg-type")
|
||||||
@Test
|
@Test
|
||||||
public void testEquals1() {
|
public void testEquals1() {
|
||||||
final Edit e1 = new Edit(1, 2, 3, 4);
|
final Edit e1 = new Edit(1, 2, 3, 4);
|
||||||
|
|
|
@ -60,6 +60,7 @@ public void testId() throws Exception {
|
||||||
assertSame(a, a.getId());
|
assertSame(a, a.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unlikely-arg-type")
|
||||||
@Test
|
@Test
|
||||||
public void testEquals() throws Exception {
|
public void testEquals() throws Exception {
|
||||||
final RevCommit a1 = commit();
|
final RevCommit a1 = commit();
|
||||||
|
|
Loading…
Reference in New Issue