Comments on: PHP 1, Java 0: The method assertEquals(Object, Object) is ambiguous for the type http://www.aschroder.com/2009/10/php-1-java-0-the-method-assertequalsobject-object-is-ambiguous-for-the-type/ Notes on Web Development Wed, 23 Dec 2020 09:25:05 +0000 hourly 1 https://wordpress.org/?v=4.8.15 By: Ashley http://www.aschroder.com/2009/10/php-1-java-0-the-method-assertequalsobject-object-is-ambiguous-for-the-type/comment-page-1/#comment-1256 Thu, 22 Apr 2010 11:03:06 +0000 http://www.aschroder.com/?p=564#comment-1256 Good point Alex, thanks for contributing – perhaps the upgrade changed the default junit or java version for the project. In any case, the actual cause was less important than my little whinge about the autoboxing ambiguity and how it doesn’t (or shouldn’t) really matter which method gets called in this case.

]]>
By: Alex http://www.aschroder.com/2009/10/php-1-java-0-the-method-assertequalsobject-object-is-ambiguous-for-the-type/comment-page-1/#comment-1255 Thu, 22 Apr 2010 10:08:23 +0000 http://www.aschroder.com/?p=564#comment-1255 I’d like to know: Why did an upgrade of Eclipse suddenly start producing these errors? An upgrade of junit or Java 1.4 > 1.5 I might understand but I don’t see how this could possibly be an Eclipse issue…?

]]>
By: Carl http://www.aschroder.com/2009/10/php-1-java-0-the-method-assertequalsobject-object-is-ambiguous-for-the-type/comment-page-1/#comment-720 Wed, 25 Nov 2009 09:59:25 +0000 http://www.aschroder.com/?p=564#comment-720 The all-object Java with invisible autoboxing already exists: It’s called Scala. It fixes a number of Java’s annoyances concerning types.

]]>
By: Ashley http://www.aschroder.com/2009/10/php-1-java-0-the-method-assertequalsobject-object-is-ambiguous-for-the-type/comment-page-1/#comment-713 Thu, 19 Nov 2009 19:20:41 +0000 http://www.aschroder.com/?p=564#comment-713 Thanks Greg, good point re: doubles.

]]>
By: Greg http://www.aschroder.com/2009/10/php-1-java-0-the-method-assertequalsobject-object-is-ambiguous-for-the-type/comment-page-1/#comment-710 Thu, 19 Nov 2009 15:45:16 +0000 http://www.aschroder.com/?p=564#comment-710 using assertEquals for doubles is deprecated. You should use a delta/tolerance

If you use assertEquals(double, double, 0.0), the autoboxing ambiguity will take go away as a side benefit.

int/Integer might still be an issue of course…

]]>