Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix resolving super methodcalls in anonymous inner classes (fixes #1962) #2585

Merged

Conversation

maartenc
Copy link
Contributor

@maartenc maartenc commented Apr 1, 2020

Fixes #1962 .

@MysterAitch MysterAitch added this to the next release (3.15.18) milestone Apr 4, 2020
@MysterAitch
Copy link
Member

Seems to be good, with JLS 15.9 (specifically 15.9.5), though I do add the caveat that I don't fully understand it all 😅

https://docs.oracle.com/javase/specs/jls/se11/html/jls-15.html#jls-15.9

I'm marking this as being for the next release, but will leave the PR open for a short while just in case there is any additional comment to add.

…ingTypeDeclOrObjectCreationExpr()` to explain the distinction between the two.
…types (inconsistent use of fully-qualified and simple names)
@MysterAitch
Copy link
Member

Just added some documentation to the pr to help explain the difference between the two methods.

Please do feel free to edit / revert these commits if you wish (I'll not be offended!), and instead I'll include them in a separate PR.

MysterAitch added a commit to MysterAitch/javaparser that referenced this pull request Apr 5, 2020
 javaparser#1949

```
Solving at MyClass (line 7,col 9): doSomething
Error :(
UnsolvedSymbolException{context='null', name='We are unable to find the method declaration corresponding to MyInterface.super.doSomething()', cause='null'}
	at com.github.javaparser.symbolsolver.JavaSymbolSolver.resolveDeclaration(JavaSymbolSolver.java:167)
	at com.github.javaparser.ast.expr.MethodCallExpr.resolve(MethodCallExpr.java:313)
	at com.github.javaparser.symbolsolver.Issue1949Test.testReflectionFirst(Issue1949Test.java:53)
```
@maartenc
Copy link
Contributor Author

maartenc commented Apr 5, 2020

looks good, thx! :-)

@MysterAitch MysterAitch merged commit 5d63f63 into javaparser:master Apr 5, 2020
@MysterAitch
Copy link
Member

In that case, let's kick-off the merge :)

@maartenc maartenc deleted the ResolveAnonymousSuperMethodCallFix branch April 5, 2020 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UnsolvedSymbolException thrown on super.<method> declaration inside inner class
2 participants