I have been using the allopen
Plugin in a JEE Environment especially for the use with CDI (Injection and Interceptors).
It was working just fine until I updated to Kotlin 1.1.2 (Problem persists in 1.1.3).
It seems that the behavior of the plugin changed in a way which causes private
methods of a class to remain final
.
This makes the class not proxy-able for weld and causes deployments to fail. I did not change any configuration other than the kotlin version.
Is this a bug or intended behavior? How can I get CDI-Interceptors to work again?
EDIT: Provided an example.
The following kotlin class (Injectable
is the annotation activating the allOpen
-Plugin):
@Injectable
class TestBean {
fun publicFunction() {
}
private fun privateFunction() {
}
}
Compiled with Kotlin 1.1.1
@Metadata(<Removed for shortness>)
@Injectable
public class TestBean {
public void publicFunction() {
}
private void privateFunction() {
}
}
Compiled with Kotlin >=1.1.2
@Metadata(<Removed for shortness>)
@Injectable
public class TestBean {
public void publicFunction() {
}
private final void privateFunction() {
}
}
Changing private functions to final is a breaking change.