You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "daniellansun (via GitHub)" <gi...@apache.org> on 2026/05/04 17:36:22 UTC
[PR] GROOVY-11993: Support serializable method reference [groovy]
daniellansun opened a new pull request, #2514:
URL: https://github.com/apache/groovy/pull/2514
https://issues.apache.org/jira/browse/GROOVY-11993
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-11993: Support serializable method reference [groovy]
Posted by "daniellansun (via GitHub)" <gi...@apache.org>.
daniellansun merged PR #2514:
URL: https://github.com/apache/groovy/pull/2514
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-11993: Support serializable method reference [groovy]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #2514:
URL: https://github.com/apache/groovy/pull/2514#issuecomment-4374588367
## ✅ All tests passed ✅
🏷️ Commit: f66004a2c78999cc30d99c021892d13c8dbe5160
▶️ Tests: 194530 executed
⚪️ Checks: 48/48 completed
---
_Learn more about TestLens at [testlens.app](https://testlens.app)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-11993: Support serializable method reference [groovy]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #2514:
URL: https://github.com/apache/groovy/pull/2514#issuecomment-4376792304
## ✅ All tests passed ✅
🏷️ Commit: bcc92fa8c8281e8c985addced9fef67ad75bdf11
▶️ Tests: 60153 executed
⚪️ Checks: 48/48 completed
---
_Learn more about TestLens at [testlens.app](https://testlens.app)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-11993: Support serializable method reference [groovy]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #2514:
URL: https://github.com/apache/groovy/pull/2514#issuecomment-4377111307
## ✅ All tests passed ✅
🏷️ Commit: 751293791c94cc093a0b0159b3d7b73c8cc6d0d5
▶️ Tests: 194586 executed
⚪️ Checks: 48/48 completed
---
_Learn more about TestLens at [testlens.app](https://testlens.app)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-11993: Support serializable method reference [groovy]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #2514:
URL: https://github.com/apache/groovy/pull/2514#discussion_r3183382138
##########
src/main/java/org/codehaus/groovy/classgen/asm/sc/AbstractFunctionalInterfaceWriter.java:
##########
@@ -156,4 +179,92 @@ default Parameter prependParameter(final List<Parameter> parameterList, final St
parameterList.add(0, parameter);
return parameter;
}
+
+ default SerializedLambdaKey createSerializedLambdaKey(final String abstractMethodDesc, final int implMethodKind, final ClassNode implClass, final MethodNode implMethod, final Parameter[] parameters, final ClassNode functionalType, final MethodNode abstractMethod, final int capturedArgCount) {
+ return new SerializedLambdaKey(
+ implMethodKind,
+ getClassInternalName(implClass),
+ implMethod.getName(),
+ getMethodDescriptor(implMethod),
+ getClassInternalName(functionalType.redirect()),
+ abstractMethod.getName(),
+ abstractMethodDesc,
+ createInstantiatedMethodType(abstractMethodDesc, implMethod, parameters).getDescriptor(),
+ capturedArgCount
+ );
+ }
+
+ default void addDeserializeLambdaDispatcherEntry(final WriterController controller, final Parameter[] parameters, final SerializedLambdaKey key, final MethodNode helperMethod) {
+ BlockStatement dispatcher = getOrAddDeserializeLambdaDispatcher(controller, parameters);
+ MethodCallExpression helperCall = callX(classX(controller.getClassNode()), helperMethod.getName(), args(varX(parameters[0])));
+ helperCall.setImplicitThis(false);
+ helperCall.setMethodTarget(helperMethod);
+
+ List<Statement> statements = dispatcher.getStatements();
+ statements.add(statements.size() - 1, ifS(boolX(matchesSerializedLambda(varX(parameters[0]), key)), returnS(helperCall)));
+ }
+
+ default BlockStatement getOrAddDeserializeLambdaDispatcher(final WriterController controller, final Parameter[] parameters) {
+ ClassNode enclosingClass = controller.getClassNode();
+ BlockStatement dispatcher = enclosingClass.getNodeMetaData(DeserializeLambdaDispatcher.class);
+ if (dispatcher != null) {
+ return dispatcher;
+ }
+
+ dispatcher = new BlockStatement();
+ dispatcher.addStatement(returnS(callX(classX(ClassHelper.make(Objects.class)), "requireNonNull", args(nullX(), constX("Invalid lambda deserialization")))));
+
Review Comment:
The dispatcher fallback currently does `Objects.requireNonNull(null, "Invalid lambda deserialization")`, which will always throw a NullPointerException. This works as a fail-fast, but it’s non-obvious and produces an exception type/stacktrace that’s harder to diagnose. Consider replacing this with an explicit `throw` of a more appropriate exception (e.g., `java.io.InvalidObjectException` or `IllegalArgumentException`) so invalid/mismatched SerializedLambda cases are clearer.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-11993: Support serializable method reference [groovy]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #2514:
URL: https://github.com/apache/groovy/pull/2514#issuecomment-4373292389
## [Codecov](https://app.codecov.io/gh/apache/groovy/pull/2514?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `96.93878%` with `3 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 67.8074%. Comparing base ([`36870fa`](https://app.codecov.io/gh/apache/groovy/commit/36870fa03c9f07d629ba7b4ebcc279d60cfc65cd?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`6a69ca4`](https://app.codecov.io/gh/apache/groovy/commit/6a69ca4f58cc7729c2d32a5b53040798016c71d3?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 7 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/groovy/pull/2514?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...sc/StaticTypesMethodReferenceExpressionWriter.java](https://app.codecov.io/gh/apache/groovy/pull/2514?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesMethodReferenceExpressionWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc01ldGhvZFJlZmVyZW5jZUV4cHJlc3Npb25Xcml0ZXIuamF2YQ==) | 91.8919% | [1 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/groovy/pull/2514?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/groovy/pull/2514?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #2514 +/- ##
==================================================
+ Coverage 67.3329% 67.8074% +0.4745%
+ Complexity 32276 32263 -13
==================================================
Files 1490 1489 -1
Lines 125080 123926 -1154
Branches 22525 22241 -284
==================================================
- Hits 84220 84031 -189
+ Misses 33535 32621 -914
+ Partials 7325 7274 -51
```
| [Files with missing lines](https://app.codecov.io/gh/apache/groovy/pull/2514?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [...sgen/asm/sc/AbstractFunctionalInterfaceWriter.java](https://app.codecov.io/gh/apache/groovy/pull/2514?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FAbstractFunctionalInterfaceWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9BYnN0cmFjdEZ1bmN0aW9uYWxJbnRlcmZhY2VXcml0ZXIuamF2YQ==) | `80.0000% <100.0000%> (+18.2979%)` | :arrow_up: |
| [...roovy/classgen/asm/sc/StaticTypesLambdaWriter.java](https://app.codecov.io/gh/apache/groovy/pull/2514?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesLambdaWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc0xhbWJkYVdyaXRlci5qYXZh) | `94.3182% <100.0000%> (-0.1570%)` | :arrow_down: |
| [...sc/StaticTypesMethodReferenceExpressionWriter.java](https://app.codecov.io/gh/apache/groovy/pull/2514?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesMethodReferenceExpressionWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc01ldGhvZFJlZmVyZW5jZUV4cHJlc3Npb25Xcml0ZXIuamF2YQ==) | `88.4058% <91.8919%> (+0.4891%)` | :arrow_up: |
... and [4 files with indirect coverage changes](https://app.codecov.io/gh/apache/groovy/pull/2514/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-11993: Support serializable method reference [groovy]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #2514:
URL: https://github.com/apache/groovy/pull/2514#issuecomment-4373528601
## ✅ All tests passed ✅
🏷️ Commit: 6a69ca4f58cc7729c2d32a5b53040798016c71d3
▶️ Tests: 97162 executed
⚪️ Checks: 28/28 completed
---
_Learn more about TestLens at [testlens.app](https://testlens.app)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-11993: Support serializable method reference [groovy]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #2514:
URL: https://github.com/apache/groovy/pull/2514#issuecomment-4379018532
## ✅ All tests passed ✅
🏷️ Commit: 2847877c24befbe3847c65a08e66f65ebfc44b7b
▶️ Tests: 109715 executed
⚪️ Checks: 48/48 completed
---
_Learn more about TestLens at [testlens.app](https://testlens.app)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-11993: Support serializable method reference [groovy]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #2514:
URL: https://github.com/apache/groovy/pull/2514#issuecomment-4374196232
## ✅ All tests passed ✅
🏷️ Commit: f19f9d876390e057b5dfd283a73acee7c9cc883b
▶️ Tests: 189955 executed
⚪️ Checks: 48/48 completed
---
_Learn more about TestLens at [testlens.app](https://testlens.app)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-11993: Support serializable method reference [groovy]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #2514:
URL: https://github.com/apache/groovy/pull/2514#issuecomment-4378008525
## ✅ All tests passed ✅
🏷️ Commit: 6b78dfadaa08dbd71f5e8e3f528799e9721b8626
▶️ Tests: 194489 executed
⚪️ Checks: 48/48 completed
---
_Learn more about TestLens at [testlens.app](https://testlens.app)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-11993: Support serializable method reference [groovy]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #2514:
URL: https://github.com/apache/groovy/pull/2514#issuecomment-4382200998
## ✅ All tests passed ✅
🏷️ Commit: 4a5d2939b7cda1831d420498cdcaa6ef69bdf3c5
▶️ Tests: 193493 executed
⚪️ Checks: 48/48 completed
---
_Learn more about TestLens at [testlens.app](https://testlens.app)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org