[ 
https://issues.apache.org/jira/browse/GROOVY-12576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18135518#comment-18135518
 ] 

ASF GitHub Bot commented on GROOVY-12576:
-----------------------------------------

testlens-app[bot] commented on PR #3102:
URL: https://github.com/apache/groovy/pull/3102#issuecomment-6537269695

   ## 🚨 TestLens detected 2 failed tests 🚨
   
   ### Test Summary
   > [!TIP]
   > Inspect all details with the [TestLens 
CLI](https://testlens.app/docs/features/cli): `testlens pr 3102`
   
   #### [Build and test / lts \(17, 
ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/41153777589/job/124395959824?pr=3102)
 > :test
   
   | Test | Runs | Flakiness |
   |---|---|--:|
   | MethodReferenceTest > 
testMethodReferencesInStaticAndDefaultMethodsOfInterface\(\) | ❌ | 0% 🟢 |
   
   #### [Build and test / lts \(21, 
ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/41153777589/job/124395959781?pr=3102)
 > :test
   
   | Test | Runs | Flakiness |
   |---|---|--:|
   | MethodReferenceTest > 
testMethodReferencesInStaticAndDefaultMethodsOfInterface\(\) | ❌ | 0% 🟢 |
   
   🏷️ Commit: e01034c17f44aadd92af4c5bb96f7d2bd7d79962
   ▶️ Tests:  57866 executed
   🟡 Checks: 14/24 completed
   
   ### Test Failures
   
   <details><summary><strong>MethodReferenceTest > 
testMethodReferencesInStaticAndDefaultMethodsOfInterface()</strong> (:test in 
<a 
href="https://github.com/apache/groovy/actions/runs/41153777589/job/124395959824?pr=3102";>Build
 and test / lts (17, ubuntu-latest)</a>)</summary>
   
   ```
   java.lang.ClassFormatError: Method gstring$I$ctorRef$make$0$1 in class I has 
illegal modifiers: 0x101A
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
        at 
java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
        at groovy.lang.GroovyClassLoader.access$000(GroovyClassLoader.java:90)
        at 
groovy.lang.GroovyClassLoader$ClassCollector.createClass(GroovyClassLoader.java:1305)
        at groovy.lang.GroovyClassLoader.collect(GroovyClassLoader.java:284)
        at 
groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:440)
        at 
groovy.lang.GroovyClassLoader.lambda$parseClass$2(GroovyClassLoader.java:378)
        at 
org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:143)
        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:378)
        at groovy.lang.GroovyShell.parseClass(GroovyShell.java:664)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:677)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:689)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:551)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:587)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:571)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:107)
        at 
groovy.transform.stc.MethodReferenceTest.testMethodReferencesInStaticAndDefaultMethodsOfInterface(MethodReferenceTest.groovy:1613)
   ```
   
   </details>
   <details><summary><strong>MethodReferenceTest > 
testMethodReferencesInStaticAndDefaultMethodsOfInterface()</strong> (:test in 
<a 
href="https://github.com/apache/groovy/actions/runs/41153777589/job/124395959781?pr=3102";>Build
 and test / lts (21, ubuntu-latest)</a>)</summary>
   
   ```
   java.lang.ClassFormatError: Method gstring$I$ctorRef$make$0$1 in class I has 
illegal modifiers: 0x101A
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027)
        at 
java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
        at groovy.lang.GroovyClassLoader.access$000(GroovyClassLoader.java:90)
        at 
groovy.lang.GroovyClassLoader$ClassCollector.createClass(GroovyClassLoader.java:1305)
        at groovy.lang.GroovyClassLoader.collect(GroovyClassLoader.java:284)
        at 
groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:440)
        at 
groovy.lang.GroovyClassLoader.lambda$parseClass$2(GroovyClassLoader.java:378)
        at 
org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:143)
        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:378)
        at groovy.lang.GroovyShell.parseClass(GroovyShell.java:664)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:677)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:689)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:551)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:587)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:571)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:107)
        at 
groovy.transform.stc.MethodReferenceTest.testMethodReferencesInStaticAndDefaultMethodsOfInterface(MethodReferenceTest.groovy:1613)
   ```
   
   </details>
   
   ### Rerun Controls
   > [!NOTE]
   > Checks are currently running using the configuration below.
   
   Select tests to mute in this pull request:
   
   🔲 MethodReferenceTest > 
testMethodReferencesInStaticAndDefaultMethodsOfInterface\(\) <!

> SC: toString(), hashCode(), equals() and getClass() in a closure ignore the 
> delegate and the owner
> --------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12576
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12576
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>    Affects Versions: 5.0.8, 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Assignee: Daniel Sun
>            Priority: Major
>
> Under {{@CompileStatic}}, an implicit-this call to a method of {{Object}} in 
> a closure or lambda is made on the closure itself:
> {code:groovy}
> @groovy.transform.CompileStatic
> class C {
>     String m() { new StringBuilder().with { append('w'); toString() } }
> }
> assert new C().m() == 'w' // C$_m_closure1@1b2c3d4
> {code}
> 4.0.33 returns {{'w'}}. The type checker looks up the methods of {{Closure}} 
> before the delegate and the owner, and that lookup also returns the methods 
> {{Closure}} inherits from {{Object}}. With {{with}}, {{tap}}, {{identity}} or 
> a {{@DelegatesTo(strategy = DELEGATE_FIRST)}} method this ignores the 
> delegate; in a plain closure it ignores the owner, and in a lambda the 
> enclosing instance, which Java and dynamic Groovy both use. This happens in 
> methods, constructors, field initializers and static initializers.
> Dynamic Groovy tries the closure first only for methods that {{Closure}} or 
> {{GroovyObject}} declare; a method the closure inherits from elsewhere goes 
> to the delegate or the owner according to the resolve strategy. Expected: the 
> same under static compilation. Methods declared by {{Closure}}, such as 
> {{getDelegate()}}, still resolve against the closure, and a closure without a 
> this object (from {{dehydrate()}}) uses its own method.
> Dynamic Groovy goes to the delegate or owner since GROOVY-11858 (master and 
> 6.0.x). In 5.x, dynamic and statically compiled code both call the closure's 
> own method; in 4.0, statically compiled code went to the owner while dynamic 
> code called the closure's method. So the fix lines static compilation up with 
> 6.0+ dynamic behaviour, and fits 6.0.x but not 5.1.x.
> PR: https://github.com/apache/groovy/pull/3102



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to