Community
Participate
Working Groups
Build 20020109 I was writing a junit test which did the following: float x = p.getX(); assertEquals("0,0", 0f, x); It gave me a compiler error saying that: The method assertEquals(byte, byte) ... is not applicable for the arguments (java.lang.String, float, float). I was trying to target the assertEquals methods for floats, which does exist. However, it has an extra argument, float delta. That is, the signature is assertEquals(String, float, float, float). It took me a while to figure this out. At first I thought it was a compiler bug in resolution of overloaded methods, since I thought there was an assertEquals(String, float, float). It would be nice if the error message either mentioned the closest match, or had a more generic message which did not refer to any particular concrete method. For example, There is no method named assertEquals which is applicable for the arguments (java.lang.String, float, float).
Error message could indeed be improved
We now try to find a better match so cases when the parameter order is wrong or you are missing a parameter will be more helpful.