feedback-to-code/mozzarella huggingface dataset:
Repository: mockito/mockito
Issue: Mockito 5 any() does not match a vararg int[] argument anymore. I need to use any(int[].class) to get the ArgumentMatcher to work

Mockito 5.2.0/5.3.1 any() ArgumentMatcher does not match a vararg int[] argument anymore.
I need to use any(int[].class) to get the ArgumentMatcher to work.

This mocking does NOT WORK:
when(myMock.myMethod(eq(myOtherMock), any()).thenReturn(myResultMap);

This mocking DOES WORK:
when(myMock.myMethod(eq(myOtherMock), any(int[].class))).thenReturn(myResultMap);




Issue comments:
This breaking change is listed in the release notes of Mockito 5: https://github.com/mockito/mockito/releases/tag/v5.0.0
@hensan64 Good catch on the wrong JavaDoc for these methods. Let me add these caveats to the JavaDoc.

Pull request review comments:

Patch that resolved the issue:
diff --git a/src/main/java/org/mockito/ArgumentMatchers.java b/src/main/java/org/mockito/ArgumentMatchers.java
index 6e83f8e847..05580a7c29 100644
--- a/src/main/java/org/mockito/ArgumentMatchers.java
+++ b/src/main/java/org/mockito/ArgumentMatchers.java
@@ -115,7 +115,7 @@
 public class ArgumentMatchers {
 
     /**
-     * Matches <strong>anything</strong>, including nulls and varargs.
+     * Matches <strong>anything</strong>, including nulls.
      *
      * <p>
      * See examples in javadoc for {@link ArgumentMatchers} class
@@ -125,7 +125,8 @@ public class ArgumentMatchers {
      * <strong>Notes : </strong><br/>
      * <ul>
      *     <li>For primitive types use {@link #anyChar()} family or {@link #isA(Class)} or {@link #any(Class)}.</li>
-     *     <li>Since mockito 2.1.0 {@link #any(Class)} is not anymore an alias of this method.</li>
+     *     <li>Since Mockito 2.1.0 {@link #any(Class)} is not anymore an alias of this method.</li>
+     *     <li>Since Mockito 5.0.0 this no longer matches varargs. Use {@link #any(Class)} instead.</li>
      * </ul>
      * </p>
      *
@@ -162,7 +163,8 @@ public static <T> T any() {
      * <ul>
      *     <li>For primitive types use {@link #anyChar()} family.</li>
      *     <li>Since Mockito 2.1.0 this method will perform a type check thus <code>null</code> values are not authorized.</li>
-     *     <li>Since mockito 2.1.0 {@link #any()} is no longer an alias of this method.</li>
+     *     <li>Since Mockito 2.1.0 {@link #any()} is no longer an alias of this method.</li>
+     *     <li>Since Mockito 5.0.0 this method can match varargs if the array type is specified, for example <code>any(String[].class)</code>.</li>
      * </ul>
      * </p>
      *


Test patch:
Repository: mockito/mockito
Issue: Function name is incorrect.
Labels: please contribute

I saw [DoAnswerStyleStubbing](https://github.com/mockito/mockito/blob/96eb5e0cbff80a1545b1093db1baf4e33a2041e7/src/main/java/org/mockito/internal/stubbing/DoAnswerStyleStubbing.java#L27-L29) class code.
I thought that below is correct.

```java
boolean isSet() {
    return !answers.isEmpty();
}
```
After execute `setAnswers` function with answers, instance will return `isSet is false`.
I think it looks strange.

And [InvocationContainerImpl](https://github.com/mockito/mockito/blob/96eb5e0cbff80a1545b1093db1baf4e33a2041e7/src/main/java/org/mockito/internal/stubbing/InvocationContainerImpl.java#L112-L114) also need to be changed as follow.
```java
public boolean hasAnswersForStubbing() {
    return doAnswerStyleStubbing.isSet();
}
```

Issue comments:
@ByoungJoonIm Feel free to send us a PR that fixes this.
Hi I made a pr that fixes this, thank you

Pull request review comments:

Patch that resolved the issue:
diff --git a/src/main/java/org/mockito/internal/stubbing/DoAnswerStyleStubbing.java b/src/main/java/org/mockito/internal/stubbing/DoAnswerStyleStubbing.java
index e143379362..c15fc025b4 100644
--- a/src/main/java/org/mockito/internal/stubbing/DoAnswerStyleStubbing.java
+++ b/src/main/java/org/mockito/internal/stubbing/DoAnswerStyleStubbing.java
@@ -25,7 +25,7 @@ void setAnswers(List<Answer<?>> answers, Strictness stubbingStrictness) {
     }
 
     boolean isSet() {
-        return answers.isEmpty();
+        return answers.size() > 0;
     }
 
     void clear() {
diff --git a/src/main/java/org/mockito/internal/stubbing/InvocationContainerImpl.java b/src/main/java/org/mockito/internal/stubbing/InvocationContainerImpl.java
index 832b1b155b..927d230e0f 100644
--- a/src/main/java/org/mockito/internal/stubbing/InvocationContainerImpl.java
+++ b/src/main/java/org/mockito/internal/stubbing/InvocationContainerImpl.java
@@ -110,7 +110,7 @@ public void setAnswersForStubbing(List<Answer<?>> answers, Strictness strictness
     }
 
     public boolean hasAnswersForStubbing() {
-        return !doAnswerStyleStubbing.isSet();
+        return doAnswerStyleStubbing.isSet();
     }
 
     public boolean hasInvocationForPotentialStubbing() {


Test patch:
Repository: mockito/mockito
Issue: Mockito#reset Condescending Documentation

Hello,

I just realised that the method `Mockito.reset()` existed at all. The documentation in the most recent version states:

>  Smart Mockito users hardly use this feature because they know it could be a sign of poor tests.

At the core, I totally agree, this shouldn't be necessary. Nevertheless, the first sentence of the comment feels rather rude / condescending. I suggest a rephrase to something like

> Using this method could be a sign of poor tests. \<rest of the doc here\>

Would help with that.

See the following link: https://github.com/mockito/mockito/blob/main/src/main/java/org/mockito/Mockito.java#L2581




Issue comments:
Yes that is certainly true. Do you mind sending us a PR to improve the wording?

Pull request review comments:

Patch that resolved the issue:
diff --git a/src/main/java/org/mockito/Mockito.java b/src/main/java/org/mockito/Mockito.java
index 98c46e1c80..ee5a133038 100644
--- a/src/main/java/org/mockito/Mockito.java
+++ b/src/main/java/org/mockito/Mockito.java
@@ -749,7 +749,7 @@
  *
  * <h3 id="17">17. <a class="meaningful_link" href="#resetting_mocks" name="resetting_mocks">Resetting mocks</a> (Since 1.8.0)</h3>
  *
- * Smart Mockito users hardly use this feature because they know it could be a sign of poor tests.
+ * Using this method could be an indication of poor testing.
  * Normally, you don't need to reset your mocks, just create new mocks for each test method.
  * <p>
  * Instead of <code>reset()</code> please consider writing simple, small and focused test methods over lengthy, over-specified tests.


Test patch:
Repository: mockito/mockito
Issue: Need separate module for java 21 tests

As requested [here](https://github.com/mockito/mockito/pull/3173#issuecomment-1826754327) and [here](https://github.com/mockito/mockito/pull/3167#discussion_r1405377557), Mockito would benefit from a separate module with java 21 language level for testing newer language features that aren't available in Java 11.

Note: I have a PR ready for this.

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/settings.gradle.kts b/settings.gradle.kts
index ecc1e15460..b90dea2ee6 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -22,7 +22,8 @@ include(
     "osgi-test",
     "bom",
     "errorprone",
-    "programmatic-test"
+    "programmatic-test",
+    "java21"
 )
 
 // https://developer.android.com/studio/command-line/variables#envar
diff --git a/subprojects/java21/java21.gradle b/subprojects/java21/java21.gradle
new file mode 100644
index 0000000000..9a2415d516
--- /dev/null
+++ b/subprojects/java21/java21.gradle
@@ -0,0 +1,24 @@
+apply from: "$rootDir/gradle/dependencies.gradle"
+apply from: "$rootDir/gradle/java-test.gradle"
+
+description = "Test suite for Java 21 Mockito"
+
+dependencies {
+    implementation project.rootProject
+    testImplementation libraries.junit4
+    testImplementation libraries.assertj
+}
+
+java {
+    sourceCompatibility = JavaVersion.VERSION_21
+    targetCompatibility = JavaVersion.VERSION_21
+    toolchain {
+        languageVersion = JavaLanguageVersion.of(21)
+    }
+}
+
+tasks.named('test') {
+    if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_21)) {
+        enabled = false
+    }
+}


Test patch:
Repository: kestra-io/kestra
Issue: Execution Ui : 2 call to ExecutionController not needed any more 

on 49f829e, we introduced a new feature that return last execution if terminated on `executions/{executionId}/follow`, we don't need anymore to call `executions/{executionId}` 

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/ui/src/components/executions/ExecutionRoot.vue b/ui/src/components/executions/ExecutionRoot.vue
index 0990bda65b..b848cd263e 100644
--- a/ui/src/components/executions/ExecutionRoot.vue
+++ b/ui/src/components/executions/ExecutionRoot.vue
@@ -45,9 +45,6 @@ export default {
         };
     },
     created() {
-        if (!this.execution) {
-            this.$store.dispatch("execution/loadExecution", this.$route.params);
-        }
         this.$store
             .dispatch("execution/followExecution", this.$route.params)
             .then(sse => {


Test patch:
Repository: kestra-io/kestra
Issue: Flow page: empty page on nav click 
Labels: bug

Switching between tabs on flow page lead to an empty page : 
![image](https://user-images.githubusercontent.com/2064609/76195687-2688df80-61e9-11ea-87e3-cacecdbb3088.png)
We need to press F5 to have the current page displayed well 

Issue comments:
we should have automatic tests for this in CI. I will fix this and produce tests.
:+1: 

Pull request review comments:

Patch that resolved the issue:
diff --git a/ui/src/components/flows/FlowEdit.vue b/ui/src/components/flows/FlowEdit.vue
index 3b9a259a75..84765d0a61 100644
--- a/ui/src/components/flows/FlowEdit.vue
+++ b/ui/src/components/flows/FlowEdit.vue
@@ -170,9 +170,6 @@ export default {
                     });
             }
         }
-    },
-    destroyed() {
-        this.$store.commit("flow/setFlow", undefined);
     }
 };
 </script>


Test patch:
Repository: kestra-io/kestra
Issue: Flow list page don't allow pagination & sort
Labels: bug

On flow page (home) : 
* The pagination is not working  
* The sort is not working also 

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/core/src/main/java/org/kestra/core/services/FlowService.java b/core/src/main/java/org/kestra/core/services/FlowService.java
index d1ba9bb3d1..161818a89e 100644
--- a/core/src/main/java/org/kestra/core/services/FlowService.java
+++ b/core/src/main/java/org/kestra/core/services/FlowService.java
@@ -38,7 +38,7 @@ public ArrayListTotal<ExecutionMetricsAggregation> findAndAggregate(String query
         Map<String, Stats> last24hStatsMap =
             executionRepositoryInterface.findLast24hDurationStats(execQuery, pageable);
 
-        List<Flow> flows = flowRepositoryInterface.find(query, pageable);
+        ArrayListTotal<Flow> flows = flowRepositoryInterface.find(query, pageable);
 
         // We build a map of all the flows (since some flows do no have executions but we want them)
         Map<String, ExecutionMetricsAggregation> result = new HashMap<>();
@@ -62,7 +62,7 @@ public ArrayListTotal<ExecutionMetricsAggregation> findAndAggregate(String query
 
 
         return new ArrayListTotal<ExecutionMetricsAggregation>(new ArrayList(result.values()),
-            result.values().size());
+            flows.getTotal());
     }
 
     /**


Test patch:
Repository: kestra-io/kestra
Issue: Input values are not well displayed

this part is wrong : 

```html
                <template v-slot:cell(value)="row">
                    <span
                        v-if="['string', 'optional', 'float', 'int', 'instant'].includes(row.item.key)"
                    >{{row.item.value}}</span>
                    <b-link
                        class="btn btn-primary"
                        v-if="['optionalFile', 'file'].includes(row.item.key)"
                        target="_blank"
                        :href="itemUrl(row.item.value)"
                    >{{$t('download')}}</b-link>
                </template>
```

it's was hardcoded with a flow... 
We need to fetch the current flow and look at `inputs.type` in order to determine if it's a file or not. 


Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/ui/src/components/executions/Overview.vue b/ui/src/components/executions/Overview.vue
index d4964a3925..f07fec6288 100644
--- a/ui/src/components/executions/Overview.vue
+++ b/ui/src/components/executions/Overview.vue
@@ -28,15 +28,13 @@
                 class="mb-0"
             >
                 <template v-slot:cell(value)="row">
-                    <span
-                        v-if="['string', 'optional', 'float', 'int', 'instant'].includes(row.item.key)"
-                    >{{row.item.value}}</span>
                     <b-link
+                        v-if="isFile(row.item)"
                         class="btn btn-primary"
-                        v-if="['optionalFile', 'file'].includes(row.item.key)"
                         target="_blank"
                         :href="itemUrl(row.item.value)"
                     >{{$t('download')}}</b-link>
+                    <span v-else>{{row.item.value}}</span>
                 </template>
             </b-table>
         </div>
@@ -74,6 +72,9 @@ export default {
         Restart
     },
     methods: {
+        isFile(item) {
+            return `${this.execution.inputs[item.key]}`.startsWith("kestra:///")
+        },
         itemUrl(value) {
             return `${apiRoot}executions/${this.execution.id}/file?path=${value}`;
         },


Test patch:
Repository: kestra-io/kestra
Issue: Execution / TaskRun list : remove click on status button
Labels: bug


Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/ui/src/components/executions/Executions.vue b/ui/src/components/executions/Executions.vue
index b9522c106c..905f9e2b7f 100644
--- a/ui/src/components/executions/Executions.vue
+++ b/ui/src/components/executions/Executions.vue
@@ -46,7 +46,6 @@
                     </template>
                     <template v-slot:cell(state.current)="row">
                         <status
-                            @click.native="addStatusToQuery(row.item.state.current)"
                             class="status"
                             :status="row.item.state.current"
                             size="sm"
@@ -204,11 +203,6 @@ export default {
             this.flowTriggerDetails = trigger
             this.$bvModal.show('modal-triggers-details')
         },
-        addStatusToQuery(status) {
-            const token = status.toUpperCase()
-            this.$refs.searchField.search = token;
-            this.$refs.searchField.onSearch();
-        },
         triggerExecution() {
             this.$store
                 .dispatch("execution/triggerExecution", this.$route.params)


Test patch:
Repository: kestra-io/kestra
Issue: Allow description on input fields on flow
Labels: backend


Issue comments:
Easy one here :) 
```yaml
inputs:
  - name: "wrong one"
    description: "what is this ?"
```
and add the info on the ui execute tabs :) 

Pull request review comments:

Patch that resolved the issue:
diff --git a/core/src/main/java/org/kestra/core/models/flows/Input.java b/core/src/main/java/org/kestra/core/models/flows/Input.java
index 29b2a2cfc8..05848fb59f 100644
--- a/core/src/main/java/org/kestra/core/models/flows/Input.java
+++ b/core/src/main/java/org/kestra/core/models/flows/Input.java
@@ -25,6 +25,8 @@ public class Input {
     @Valid
     private Type type;
 
+    private String description;
+
     @NotNull
     private Boolean required = true;
 
diff --git a/ui/src/components/flows/ExecutionConfiguration.vue b/ui/src/components/flows/ExecutionConfiguration.vue
index 7708ba5efc..fd7f9b451e 100644
--- a/ui/src/components/flows/ExecutionConfiguration.vue
+++ b/ui/src/components/flows/ExecutionConfiguration.vue
@@ -51,6 +51,7 @@
                     :state="Boolean(input.value)"
                     :placeholder="$t('choose file')"
                 />
+                <small v-if="input.description" class="form-text text-muted">{{ input.description }}</small>
             </b-form-group>
             <b-form-group class="text-right mb-0">
                 <b-button type="submit" variant="primary" v-b-tooltip.hover.top="'(Ctrl + Enter)'">


Test patch:
diff --git a/core/src/test/java/org/kestra/core/runners/InputsTest.java b/core/src/test/java/org/kestra/core/runners/InputsTest.java
index 9098226460..98e68066fe 100644
--- a/core/src/test/java/org/kestra/core/runners/InputsTest.java
+++ b/core/src/test/java/org/kestra/core/runners/InputsTest.java
@@ -8,6 +8,7 @@
 import org.kestra.core.repositories.FlowRepositoryInterface;
 import org.kestra.core.storages.StorageInterface;
 
+import javax.inject.Inject;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -15,12 +16,10 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.time.Instant;
-import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Objects;
 import java.util.concurrent.TimeoutException;
-import javax.inject.Inject;
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.*;
Repository: kestra-io/kestra
Issue: theme uri invalid with extra "/"
Labels: bug

### Expected Behavior

Access /ui/flows get all extra resources.

### Actual Behaviour

Can't get theme-light.js and theme-light.css, here is actual URI, Please note there is an extra "/" after ui/

```
<link rel="stylesheet" href="/ui//css/theme-light.00305fce.css" data-theme="theme-light">
```
https://github.com/kestra-io/kestra/blob/0886e50d7fd828bafbea67e268f95665bd59616e/ui/public/index.html#L23-L26

https://github.com/kestra-io/kestra/blob/d9f02017a5f23b6581ca1b35d96392351a45a93f/ui/src/App.vue#L96-L110

Might be the culprit.


### Steps To Reproduce

1. Install istio and using oauth2-proxy for authentication.

### Environment Information

- Kestra Version: 0.5.0-BETA


### Example flow

_No response_

Issue comments:
Thanks for the report 
Maybe you can add create a PR with trim last `/` on `basePath` ?

Pull request review comments:

Patch that resolved the issue:
diff --git a/ui/src/App.vue b/ui/src/App.vue
index 0b233b5993..ec676de08e 100644
--- a/ui/src/App.vue
+++ b/ui/src/App.vue
@@ -98,11 +98,11 @@
                                 if (r.endsWith(".js")) {
                                     elem = document.createElement("script");
                                     elem.setAttribute("type", "text/javascript");
-                                    elem.setAttribute("src", basePath + "/" + r);
+                                    elem.setAttribute("src", basePath + r);
                                 } else {
                                     elem = document.createElement("link");
                                     elem.setAttribute("rel", "stylesheet");
-                                    elem.setAttribute("href", basePath + "/" + r);
+                                    elem.setAttribute("href", basePath + r);
                                 }
 
                                 elem.setAttribute("data-theme", theme);


Test patch:
Repository: kestra-io/kestra
Issue: Tasks with big id are blocking the `Eval expression` button
Labels: bug

### Expected Behavior

Click on the "Eval expression" button, in the "Outputs" panel

### Actual Behaviour

<img width="1468" alt="image" src="https://user-images.githubusercontent.com/1302218/194127164-af079cde-793e-4af8-bd9b-dd575857cbad.png">

Button is blocked by the very long id text

### Steps To Reproduce

_No response_

### Environment Information

- Kestra Version: 0.5.2-SNAPSHOT


### Example flow

_No response_

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index fb2834b300..ddb6772c1b 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -65,7 +65,17 @@ The frontend is located on `/ui` folder.
 - create a files `ui/.env.development.local` with content `VUE_APP_API_URL=http://localhost:8080` (or your actual server url)
 - `npm run serve` will start the development server with hot reload.
 - The server start by default on port 8090 and is reachable on `http://localhost:8090`
-- You can run `npm run build` in order to build the front-end that will be delivered from the backend (without running the `npm serve`) above.
+- You can run `npm run build` in order to build the front-end that will be delivered from the 
+backend (without running the `npm serve`) above.
+
+> If you have CORS restrictions when using the local development npm server, you need to configure 
+> the backend to allow the http://localhost:8090 origin
+> ```cors:
+>      enabled: true
+>      configurations:
+>        all:
+>          allowedOrigins:
+>            - http://localhost:8090```
 
 #### Develop plugins
 A complete documentation for developing plugin can be found [here](https://kestra.io/docs/plugin-developer-guide/).
diff --git a/.gitignore b/.gitignore
index e4da400134..4e27998258 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,6 +14,8 @@ out/
 .settings
 .classpath
 .attach*
+**/*.class
+**/bin/*
 
 ### Configurations
 docker-compose.override.yml


Test patch:
Repository: kestra-io/kestra
Issue: Fix container-image tag displayed in logs
Labels: bug

### Expected Behavior

Should show `Image pulled [ubuntu:20.04]`

### Actual Behaviour

Currently shows: `Image pulled [ubuntu:20.04:20.04]`

### Steps To Reproduce

_No response_

### Environment Information

- Kestra Version: 0.5.2-SNAPSHOT
- Operating System (OS / Docker / Kubernetes): Docker


### Example flow

_No response_

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/core/src/main/java/io/kestra/core/tasks/scripts/runners/DockerScriptRunner.java b/core/src/main/java/io/kestra/core/tasks/scripts/runners/DockerScriptRunner.java
index 888aa59545..651aedaa59 100644
--- a/core/src/main/java/io/kestra/core/tasks/scripts/runners/DockerScriptRunner.java
+++ b/core/src/main/java/io/kestra/core/tasks/scripts/runners/DockerScriptRunner.java
@@ -239,11 +239,14 @@ public RunResult run(
                     (bool, throwable) -> throwable instanceof InternalServerErrorException ||
                         throwable.getCause() instanceof ConnectionClosedException,
                     () -> {
+                        String tag = !imageParse.tag.isEmpty() ? imageParse.tag : "latest";
+                        String repository = pull.getRepository().contains(":")
+                            ? pull.getRepository().split(":")[0] : pull.getRepository();
                         pull
-                            .withTag(!imageParse.tag.equals("") ? imageParse.tag : "latest")
+                            .withTag(tag)
                             .exec(new PullImageResultCallback())
                             .awaitCompletion();
-                        logger.debug("Image pulled [{}:{}]", pull.getRepository(), pull.getTag());
+                        logger.debug("Image pulled [{}:{}]", repository, tag);
                         return true;
                     }
                 );


Test patch: