You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2019/01/31 10:42:01 UTC
[jira] [Reopened] (GROOVY-8392) Groovy sometimes can not process
varargs correctly
[ https://issues.apache.org/jira/browse/GROOVY-8392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King reopened GROOVY-8392:
-------------------------------
> Groovy sometimes can not process varargs correctly
> --------------------------------------------------
>
> Key: GROOVY-8392
> URL: https://issues.apache.org/jira/browse/GROOVY-8392
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 1.8.6
> Environment: online
> Reporter: leizhiyuan
> Priority: Major
>
> we have a StringUtil class in java
> ```
> public static boolean areNotEmpty(String... values) {
> System.out.println(values);
> return true;
> }
> ```
> and in a groovy script
> we invoke like
> ```
> def str="S";
> StringUtil.areNotEmpty(str)
> ```
> But online enviroment, It occurs when application startup
> extraMessage=groovy.lang.MissingMethodException: No signature of method: static StringUtil.areNotEmpty() is applicable for argument types: (java.lang.String) values: [S]
> Possible solutions: areNotEmpty([Ljava.lang.String;), isNotEmpty(java.lang.String), trimToEmpty(java.lang.String), trimToEmpty(java.lang.String, java.lang.String)]
> but Not every application in other machine will occur.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)