-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use sourcegen bytecode generator to generate internal metadata #11407
base: 4.8.x
Are you sure you want to change the base?
Conversation
inject/src/main/java/io/micronaut/inject/beans/AbstractInitializableBeanIntrospection.java
Outdated
Show resolved
Hide resolved
defaultsStorage, | ||
loadTypeMethods | ||
public static byte[] write(String className, AnnotationMetadata annotationMetadata) { | ||
Map<String, MethodDef> loadTypeMethods = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be a linked hash map? Will it impact the order of the methods written?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, it's only used for testing anyway
core-processor/src/main/java/io/micronaut/inject/annotation/AnnotationMetadataWriter.java
Outdated
Show resolved
Hide resolved
core-processor/src/main/java/io/micronaut/aop/writer/AopProxyWriter.java
Show resolved
Hide resolved
core-processor/src/main/java/io/micronaut/aop/writer/AopProxyWriter.java
Outdated
Show resolved
Hide resolved
core-processor/src/main/java/io/micronaut/aop/writer/AopProxyWriter.java
Outdated
Show resolved
Hide resolved
* @param p The class element | ||
* @return The string representation | ||
*/ | ||
private static String toTypeString(ClassElement p) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems like something that belongs in ClassElement
or a utility method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, we just do some unique string from a class
The PR rewrites all the class writers (except the evaluated expressions writer) to use a new bytecode generator from Micronaut Sourcegen.
I haven't done any major refactoring. Some classes like
BeanDefnitionWriter
is too big and need some refactoring