https://kotlinlang.org logo
Title
a

adrik77

04/05/2018, 1:21 PM
Hi @channel I’m facing an error using guice
@Assisted
annotation. I have a function similar to this
fun createPublishHysCmd(@Assisted("message") message: TBase)
When I see the compiled version, it decompiles to:
public abstract fun createPublishHysCmd(@com.google.inject.assistedinject.Assisted message: org.apache.thrift.TBase
Without the value of the annotation. If I write a similar function in java:
PublishMessageHysCmd createPublishHysCmd(@Assisted("message") TBase message)
I can see it decompiled to:
PublishMessageHysCmd createPublishHysCmd(@Assisted("message") TBase var1)
Could
kapt
fix this for me? I couldn’t find an annotationProcessor for google guice.
g

gildor

04/05/2018, 2:48 PM
I don't think that this problem of annotation processing, really strange. Maybe you could reproduce it on some sample project
a

adrik77

04/05/2018, 3:43 PM
Yeah I will try to crate a sample project and share. BTW, In the kotlin compiled code I don’t see any imports, but In java’s yes
g

gildor

04/05/2018, 4:30 PM
compiled code? What do you mean? There is no imports in bytecode, it’s completely source code feature
a

adrik77

04/05/2018, 4:37 PM
yeah, I mean, I’m not saying this is an issue with
kapt
. I’m trying to figure out if I could fix this issue with
kapt
. The issue is that when I see bytecode (using IntelliJ decompiler) I don’t see any imports and the value of annotation
@Assisted
is not there. While if I write the same code in java, when I see the bytecode (using again IntelliJ decompiler) I see imports and the value of the annotation.
g

gildor

04/05/2018, 4:44 PM
don’t use decompiler to verify bytecode, check bytecode itself, otherwise you can fight with a decompiler bug/lack of feature/byte code that hard to convert to sources
Hard to tell something because of decompiler output