{"action":"closed","issue":{"url":"https://api.github.com/repos/cbeust/testng/issues/920","labels_url":"https://api.github.com/repos/cbeust/testng/issues/920/labels{/name}","comments_url":"https://api.github.com/repos/cbeust/testng/issues/920/comments","events_url":"https://api.github.com/repos/cbeust/testng/issues/920/events","html_url":"https://github.com/cbeust/testng/issues/920","id":123241993,"number":920,"title":"Execute test with fixed parameter and varargs result in IllegalArgumentException (All test data are parsed as array to all parameter)","user":{"login":"aquadrehz","id":3850078,"avatar_url":"https://avatars.githubusercontent.com/u/3850078?v=3","gravatar_id":"","url":"https://api.github.com/users/aquadrehz","html_url":"https://github.com/aquadrehz","followers_url":"https://api.github.com/users/aquadrehz/followers","following_url":"https://api.github.com/users/aquadrehz/following{/other_user}","gists_url":"https://api.github.com/users/aquadrehz/gists{/gist_id}","starred_url":"https://api.github.com/users/aquadrehz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aquadrehz/subscriptions","organizations_url":"https://api.github.com/users/aquadrehz/orgs","repos_url":"https://api.github.com/users/aquadrehz/repos","events_url":"https://api.github.com/users/aquadrehz/events{/privacy}","received_events_url":"https://api.github.com/users/aquadrehz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cbeust/testng/labels/data-provider","name":"data-provider","color":"009800"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-21T09:41:08Z","updated_at":"2016-01-04T21:04:37Z","closed_at":"2016-01-04T21:04:37Z","body":"Execute test with fixed parameter and varargs result in IllegalArgumentException (All test data are parsed as array to all parameter)\r\nI've create test method with fixed amount of parameter varargs. and execute as following\r\n - Java application (via Eclipse)\r\n - TestNG (via Eclipse plug-in)\r\n\r\nThe TestNG execution found IllegalArgumentException.\r\nI found all test data are parsed as array to all parameter.\r\n\r\nI suggest it result should be the same so this should be fixed.\r\n\r\n```java\r\npackage test;\r\n\r\nimport org.testng.annotations.DataProvider;\r\nimport org.testng.annotations.Test;\r\n\r\npublic class testClass001 {\r\n\tpublic static void main(String[] args) {\r\n\t\ttest(\"001\", \"002\", \"003\", \"004\"); \r\n\t\t// Execute as Java application.\r\n\t\t// The Length is 1\r\n\t\t// The Length is 3\r\n\t}\r\n\t\r\n\t@DataProvider(name = \"testData\")\r\n    public static Object[][] testDataProvider() {\r\n        return new Object[][] {new String[]{\"001\",\"002\"},new String[]{\"001\",\"002\",\"003\", \"004\", \"005\"}};\r\n\t\t// Execute as Java application.\r\n\t\t// FAILED: test(\"[Ljava.lang.String;@7946e1f4\", [Ljava.lang.String;@7946e1f4) java.lang.IllegalArgumentException: argument type mismatch\r\n\t\t// FAILED: test(\"[Ljava.lang.String;@3c09711b\", [Ljava.lang.String;@3c09711b) java.lang.IllegalArgumentException: argument type mismatch\r\n    }\r\n\r\n    @Test(dataProvider = \"testData\")\r\n    public static void test(String str001, String... str002) {\r\n    \tSystem.out.println(\"The Length is 1\");\r\n        System.out.println(\"The Length is \"+str002.length);\r\n\r\n    }\r\n}\r\n\r\n\r\n\r\n```\r\n"}}