[
https://issues.apache.org/jira/browse/GROOVY-9776?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17272344#comment-17272344
]
Eric Milles commented on GROOVY-9776:
-------------------------------------
The issue comes with a cast to LinePart (last line of bytecode snippet) that
the compiler adds for this line:
https://github.com/rkrisztian/search/blob/task/improve_color_highlighting/search-app/src/main/groovy/search/resultsprinter/linepart/LinePartitioner.groovy#L27
There is no package for this type and so it fails for find a type "LinePart" in
the default package.
{code}
// Method descriptor #39 (Ljava/lang/Object;)Ljava/lang/Object;
// Stack: 7, Locals: 2
public java.lang.Object doCall(java.lang.Object linePart);
0 aload_1 [linePart]
1 instanceof search.resultsprinter.linepart.PlainTextLinePart [41]
4 ifne 11
7 iconst_1
8 goto 12
11 iconst_0
12 ifeq 27
15 iconst_1
16 anewarray java.lang.Object [43]
19 dup
20 iconst_0
21 aload_1 [linePart]
22 aastore
23 invokestatic
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.createList(java.lang.Object[])
: java.util.List [49]
26 areturn
27 aload_0 [this]
28 getfield
search.resultsprinter.linepart.LinePartitioner$_partitionBy_closure1.searchPatternAsDelimiter
: groovy.lang.Reference [28]
31 invokevirtual groovy.lang.Reference.get() : java.lang.Object [55]
34 checkcast java.util.regex.Pattern [57]
37 aload_1 [linePart]
38 checkcast LinePart [59]
{code}
> ClassNotFoundException in test execution with Groovy >3.0.3
> -----------------------------------------------------------
>
> Key: GROOVY-9776
> URL: https://issues.apache.org/jira/browse/GROOVY-9776
> Project: Groovy
> Issue Type: Bug
> Components: bytecode, Compiler
> Affects Versions: 3.0.5, 3.0.6
> Reporter: rkrisztian
> Priority: Major
>
> I've got this weird ClassNotFoundException with Groovy 3.0.5 and above when a
> test class tries to reuse an abstract class from the main sources:
> https://github.com/rkrisztian/search/tree/task/improve_color_highlighting
> This branch as you can see from the build log of TravisCI, reproduces the
> error:
> https://travis-ci.org/github/rkrisztian/search/jobs/734837733
> Which goes away if I downgrade Groovy to 3.0.3.
> Could you please help me find out why?
> Note: not urgent, it's my hobby project. But I'll keep the branch until the
> issue is fixed.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)