Hi Marc,

right, the summary of the issue I referenced isn't specific enough for you. 
I quickly put together a simple reproducer [1] but I haven't yet actually 
debugged the Jandex code. It looks like the relevant method is [2] and line 
[3].

[1] https://github.com/aloubyansky/playground/tree/jacoco-jandex
[2] 
https://github.com/wildfly/jandex/blob/2.4.1.Final/src/main/java/org/jboss/jandex/Indexer.java#L1822
[3] 
https://github.com/wildfly/jandex/blob/2.4.1.Final/src/main/java/org/jboss/jandex/Indexer.java#L1897

Hope that helps.

Thanks,
Alexey
On Tuesday, November 2, 2021 at 1:47:18 PM UTC+1 Marc R. Hoffmann wrote:

> Hi Alexey,
>
> if I look at the stack trace of the original ticket I assume that this is 
> not a problem with Jandex, but the code which makes assumptions about the 
> data collected with Jandex. So I don’t think we can debug this from our 
> side.
>
> Please feel free to to get in touch again, as soon as you can pinpoint the 
> issue down to JaCoCo.
>
> Thanks,
> -marc
>
> On 2. Nov 2021, at 11:24, Alexey Loubyansky <olub...@redhat.com> wrote:
>
> Hi Marc,
>
> thanks for your response. I can describe what I was observing but I am not 
> sure I'll be able to provide the necessary details to conclude where the 
> info gets lost.
>
> In our case we are scanning the classpath looking for methods with 
> specific annotations and then we are trying to figure out the method 
> parameter names (among other things) using the Jandex library [1]. It 
> appears Jandex does not actually require classes to be compiled with the 
> `-parameters` argument to figure it out, it may pull the info from the 
> local var table instead, IIUC.
> So, we have a Quarkus JaCoCo extension that allows to integrate JaCoCo 
> into Quarkus tests. The extension calls the JaCoCo instrumenter API here 
> [2]. If instead of returning the `enhanced` byte array I return the 
> original `bytes` array, Jandex can figure out the method parameter names. I 
> we return the `enhanced` array, Jandex fails to figure it out. If we 
> compile the classes with the `-parameters` argument though, it works.
> I realize we need to debug this further to provide more info for you about 
> what exactly Jandex is looking for in this case. But I thought I would 
> still report the issue just in case it rings a bell.
>
> [1] https://github.com/wildfly/jandex
> [2] 
> https://github.com/quarkusio/quarkus/blob/main/test-framework/jacoco/deployment/src/main/java/io/quarkus/jacoco/deployment/JacocoProcessor.java#L83
>
> Thanks,
> Alexey
> On Tuesday, November 2, 2021 at 10:56:29 AM UTC+1 Marc R. Hoffmann wrote:
>
>> Hi Alexey,
>>
>> thanks for raising this issue.
>>
>> I think JaCoCo does the following:
>>
>> * The original local variable table is preserved
>> * JaCoCo adds a *synthetic* method $jacocoInit which has no corresponding 
>> source, therefore no var table
>> * JaCoCo adds a additional local variable (for the probe array) which has 
>> no corresponding source, therefore no var table
>>
>> Can you please give a specific instance, where the local variable table 
>> is missing?
>>
>> Thanks,
>> -marc
>>
>>
>>
>> On 2. Nov 2021, at 08:48, Alexey Loubyansky <olub...@redhat.com> wrote:
>>
>> Hello,
>>
>> it looks like the local variable table is missing after instrumentation 
>> in some cases.
>> This was manifested in a Quarkus issue [1] Although there is a workaround 
>> adding a compiler arg, there still seems to be an issue with the 
>> instrumentation. Will it be worth creating an issue?
>>
>> [1] https://github.com/quarkusio/quarkus/issues/21066
>>
>> Thanks,
>> Alexey
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "JaCoCo and EclEmma Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jacoco+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jacoco/129a49d3-d611-419c-a601-ef979cf0119en%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jacoco/129a49d3-d611-419c-a601-ef979cf0119en%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>>
>>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to jacoco+un...@googlegroups.com.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jacoco/fd9c24a1-58c9-4c86-a5c5-f774eee3fe98n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jacoco/fd9c24a1-58c9-4c86-a5c5-f774eee3fe98n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/8a1d0244-9d90-4a46-a2bd-ef766ce919f2n%40googlegroups.com.

Reply via email to