Skip to content

JavaType.Class should contain full info on annotations, methods, constructors, superclasses #150

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

Closed
sambsnyd opened this issue Jan 14, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@sambsnyd
Copy link
Member

Some visitors (like openrewrite/rewrite-spring#9) may benefit from or outright require the ability to look up information about classes, their methods, their annotations, that aren't sources being parsed as part of the current run. i.e.: Any symbol or class coming from a dependency. We do have access to this information since without it the java compiler wouldn't be able to successfully parse & type attribute java source into ASTs.

JavaType.Class is the appropriate place for this information to go.

@okundzich
Copy link
Member

@tkvangorder - is this still an issue or is it taken care of by your work on java template?

@sambsnyd
Copy link
Member Author

This is still an issue

@jkschneider
Copy link
Member

Annotations are available on

type -> tsym -> metadata -> attributes -> [n] -> type

org.openjdk.tools.javac.code.Attribute always refers to an annotation.

@sambsnyd sambsnyd changed the title JavaType.Class should contain full info on annotations, methods, annotations of methods JavaType.Class should contain full info on annotations, methods, superclasses Jun 15, 2021
@sambsnyd sambsnyd changed the title JavaType.Class should contain full info on annotations, methods, superclasses JavaType.Class should contain full info on annotations, methods, constructors, superclasses Jun 15, 2021
@sambsnyd sambsnyd added this to the 7.8.0 milestone Jun 15, 2021
@sambsnyd sambsnyd removed this from the 7.8.0 milestone Jun 30, 2021
@traceyyoshima
Copy link
Contributor

@sambsnyd can this be closed now that we have full type attribution?

@sambsnyd
Copy link
Member Author

sambsnyd commented Oct 8, 2021

Yes, we now have this capability.

@sambsnyd sambsnyd closed this as completed Oct 8, 2021
knutwannheden pushed a commit that referenced this issue Mar 4, 2025
Use explicit receiver when available in mapBinaryOperation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants