ahmaddarawshi / powermock

Automatically exported from code.google.com/p/powermock
0 stars 0 forks source link

HashMap calls getClass on a mock when it's inserted some times #190

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This means that createMock indirectly calls getClass when it creates a mock
because it adds the object to the MockRepository. It only happens some times..

Original issue reported on code.google.com by johan.ha...@gmail.com on 3 Nov 2009 at 3:09

GoogleCodeExporter commented 9 years ago
This happens if the equals method on a mock uses getClass on that object (this
happens on all equals methods generated by eclipse for example). 

Proposed solution: We should not allow users to mock getClass by default. If 
this is
what the user what we should allow for "advanced" mocking. 

Original comment by johan.ha...@gmail.com on 12 Nov 2009 at 3:39

GoogleCodeExporter commented 9 years ago
Fixed in r1097

Original comment by johan.ha...@gmail.com on 15 Nov 2009 at 4:44

GoogleCodeExporter commented 9 years ago
please check https://code.google.com/p/powermock/issues/detail?id=418 
EqualsWithGetClassTest has some problem.

Original comment by cndoublehero@gmail.com on 19 Dec 2012 at 1:12