This content has been marked as final. Show 3 replies
The extra method is generated by the compiler as part of Generics. It is a thunk to the other one.
Ok, now I know what it is... But I still get compiler errors if I generate code that tries to call it. Is there anyway to tell that the method is not actually callable from code (and it is just an artifact of the generics)?
My code reflects on a JAR file and spits out something akin to a test case and because StringMap.put(Object,Object) is identified as a method via reflection, my code generates a call to it:
Yes, when this is compiled you get:
...\test.java:177: cannot find symbol
symbol : method put(java.lang.Object,java.lang.Object)
location: class StringMap
I just figured this out. Thanks for pointing out that this was generated by the compiler - Method.isSynthetic() returns "true" for methods like this.