RFR 7183985: Class.getAnnotation() throws an ArrayStoreException when the annotation class not present

Martin Buchholz martinrb at google.com
Thu Mar 1 00:13:48 UTC 2018


I was surprised to learn that junit has a magic assertEquals specifically
for Object[]
assertEquals(Object[], Object[])
but that is obviously a bad idea and junit eventually deprecated it.
https://junit.org/junit4/javadoc/4.12/org/junit/Assert.html#assertEquals(java.lang.Object[],
java.lang.Object[])
Follow their lead and rename your method to assertArrayEquals

 124     static void assertEquals(Object[] actual, Object[] expected) {


More information about the core-libs-dev mailing list