I have silly question about Java (6/7/8) grammar - are those two snippets of method invocation always equivalent?
with
this
this.myMethod(4);
without
this
myMethod(4);
Note: Of course the problem is about every number, type and combination of arguments
Weaker statement: given program P
, can I create program P'
only by deleting this.
in front of each and every method invocation?
I've taken into account local classes, anonymous classes, inner classes and various inheritance but could have not find any contradiction. So i believe both snippets are actually the same. Unfortunately I can't manage to find any suitable proof (e.g. from the official grammar).
Could you prove me wrong by contradiction or give me some clues for construction of the equivalence proof? Thanks a lot.
EDIT: the equivalence was proven wrong (see comments below) What about the weaker statement?