-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Bad class file when compiling Micronaut 4.8.1 project #11749
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
Comments
@graemerocher @dstepanov Confirm this bug. Micronaut-core Looks like the bug with return types with generics, like From micronaut-openapi:
@Generated("io.micronaut.openapi.generator.JavaMicronautServerCodegen")
@Controller
public interface RequestBodyApi {
/**
* A method to send a simple model in body
*
* @param simpleModel (optional)
* @return Success (status code 200)
* or An unexpected error has occurred (status code default)
*/
@Post("/sendSimpleModel")
Mono<@Valid SimpleModel> sendSimpleModel(
@Body @Nullable(inherited = true) @Valid SimpleModel simpleModel
);
....
}
@Generated
class $RequestBodyController$Definition$Intercepted extends RequestBodyController implements Intercepted {
private final Interceptor[][] $interceptors;
private final ExecutableMethod[] $proxyMethods;
private final RequestBodyController $target;
public Mono $$access$$sendSimpleModel(SimpleModel simpleModel) {
return super.sendSimpleModel(simpleModel);
}
public Mono sendSimpleModel(SimpleModel simpleModel) {
return (Mono)(new MethodInterceptorChain(this.$interceptors[0], this, this.$proxyMethods[0], new Object[]{simpleModel})).proceed();
}
....
}
// $FF: synthetic class
@Generated
class $RequestBodyController$Definition$Intercepted extends RequestBodyController implements Intercepted {
private final Interceptor[][] $interceptors;
private final ExecutableMethod[] $proxyMethods;
private final RequestBodyController $target;
public Mono<T> $$access$$sendSimpleModel(SimpleModel simpleModel) {
return super.sendSimpleModel(simpleModel);
}
public Mono<T> sendSimpleModel(SimpleModel simpleModel) {
return (Mono)(new MethodInterceptorChain(this.$interceptors[0], this, this.$proxyMethods[0], new Object[]{simpleModel})).proceed();
}
....
} As you see, with micronaut-core |
It may be related. We have a similar error since 4.8.1
Similar interfaces do not produce de same problem. Generate code is
|
@dstepanov can you take a look? |
For us, it is fixed in 4.8.2 |
Confirmed: all works fine with micronaut platform 4.8.2 |
Same here, 4.8.2 seems to works fine. Thanks for the fast response! |
Expected Behavior
The project should compile without errors
Actual Behaviour
I tried to upgrade a project from Micronaut 4.8.0 to 4.8.1 but it fails to compile.
I see the same problem in multiple projects.
Steps To Reproduce
./gradlew build
Environment Information
Example Application
https://github.com/goeh/bad-class-file
Version
4.8.1
The text was updated successfully, but these errors were encountered: