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

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

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

   ## 🚨 TestLens detected 2 failed tests 🚨
   
   ### Test Summary
   > [!TIP]
   > Inspect all details with the [TestLens 
CLI](https://testlens.app/docs/features/cli): `testlens pr 3333`
   
   #### [Build and test / lts \(25, 
ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/46113736758/job/140882775680?pr=3333)
 > :test
   
   | Test | Runs | Flakiness |
   |---|---|--:|
   | GrabResolverTest > testResolverDefinitionResolvesDependency\(\) | ❌ | 
0% 🟢 |
   | GrabResolverTest > 
testResolverDefinitionResolvesDependencyWithShorthand\(\) | ❌ | 0% 🟢 |
   
   🏷️ Commit: 8a8c2152b3d4c33981852a47d2ea50b78b790222
   ▶️ Tests:  63483 executed
   🟡 Checks: 8/24 completed
   
   ### Test Failures
   
   <details><summary><strong>GrabResolverTest > 
testResolverDefinitionResolvesDependency()</strong> (:test in <a 
href="https://github.com/apache/groovy/actions/runs/46113736758/job/140882775680?pr=3333";>Build
 and test / lts (25, ubuntu-latest)</a>)</summary>
   
   ```
   java.lang.AssertionError: Forked JVM for 
groovy.grape.GrabResolverTest#testResolverDefinitionResolvesDependency failed:
   org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
failed:
   General error during conversion: Error grabbing Grapes 

> GroovyMBean does not support the use of overloaded MBean operations that have 
> the same number of parameters
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-2807
>                 URL: https://issues.apache.org/jira/browse/GROOVY-2807
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-jmx
>            Reporter: Meyrick Kirby
>            Assignee: Daniel Sun
>            Priority: Major
>         Attachments: GroovyMBean.java
>
>
> I've been using groovy.util.GroovyMBean to access MBeans running on the JBoss 
> 4 server.  Some of the operations/methods of the MBeans are overloaded, e.g.:
> {code}
> void redeploy(java.lang.String url)
> void redeploy(java.net.URL url)
> void redeploy(org.jboss.deployment.DeploymentInfo sdi)
> {code}
> Currently it's impossible to invoke the first 2.
> The problem is, when the GroovyMBean is constructed it stores a signature for 
> each operation from its specified MBean in a HashMap, using the operation 
> name and the number of parameters as its key.  Later, when the invokeMethod 
> method is invoked, it uses the method name and the number of parameters to 
> retrieve the signature to invoke the operation on the MBean.  Thus for 
> overloaded operations with the same number of parameters, only the last 
> operation found will be stored in the HashMap.
> If another variant of the operation is invoked on the GroovyMBean then an 
> incorrect signature will be passed to the MBeanServer which results in an 
> exception occurring on the server.
> The fix I've used (suggested by a comment in the source code)  is to 
> construct a key out of the name of the operation and the sum of the hash 
> codes of the class names of the parameters.
> The problem is, this required 2 new createOperationKey methods:
> {code}
> String createOperationKey(MBeanOperationInfo opInfo)
> String createOperationKey(String method, Object[] args)
> {code}
> The first is invoked by the constructor, and the second that is invoked by 
> the invokeMethod method.  The original createOperationKey method is removed.  
> This might create backwards compatibility problems.
> I've included an adjusted GroovyMBean class, although temporarily in a new 
> package (groovy.util.adjusted).
> This issue is an extension of issue GROOVY-1291



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

Reply via email to