Line 3 you create new log, then ask that to getUser, so of course its empty.
Instead of a new log class, B needs a reference to the real log instance that you created and interacted with. How that happens depends on the code where log and B are created, which I don't see here.
JamesCherrill
... trying to help
8,513 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,455
Skill Endorsements: 30