RFR: 8337980: Javac allows invocation of an inherited instance method from a static method [v2]
Archie Cobbs
acobbs at openjdk.org
Tue Oct 8 15:18:39 UTC 2024
On Tue, 8 Oct 2024 13:01:00 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> What I'm a bit worried about with this fix is that it results in `mergeAbstracts` to be called _twice_ when the code is correct.
OK now I understand your concern. This didn't occur to me before because I was assuming that `mergeAbstracts` did not modify any existing data. From a superficial look, that appears to be the case, but regardless as you might guess by my original comment that "It's possible there is an opportunity for a more thorough refactoring here" I like your patch much better. I was already wondering why the ambiguity resolution logic wasn't being incorporated into `findMethod()` (the method is named `findMethod()` not `almostFindMethod()` after all!) as you have done and assumed there was some mysterious reason for it. Apparently not. So let's go with your patch - thanks!
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20533#issuecomment-2400135979
More information about the compiler-dev
mailing list