I discovered that classes with default equals method has different instances of meta object Method. Why is it so? At first glance it looks not optimal because method objects are immutable.
class X {}
Method defaultM = Object.class.getMethod("equals", Object.class)
Method xMethod = X.class.getMethod("equals", Object.class)
xMethod != defaultM
xMethod.equals(defaultM)
Aucun commentaire:
Enregistrer un commentaire