You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have Eclipse Luna (Service Release 1a (4.4.1)) with following plugins installed:
Groovy-Eclipse Feature
Groovy Compiler 2.0 Feature 2.9.1.xx-201412191752-e44
Grails IDE 3.6.3.201411271013-RELEASE
I have a simple class:
class Utilities
{
public static boolean hasValue(List list){
return !(list == null || list.isEmpty());
}
}
Another simple class:
class Test2 {
static main(def args)
{
def var1 = [2]
if(Utilities.hasValue((List)var1) //here one bracket is less but still compiler does not give any error
{
println "hello"
}
}
}
It is only when I run Test2, it gives me following exception:
No signature of method: static Utilities.hasValue() is applicable for argument types: (java.util.ArrayList, Test2$_main_closure1)
Also when I add another if() to Test2, then it gives not much sensing error description:
For some reason, the compiler isn't picking up that the parenthesis are mismatched in your source (the line ... if(Utilities.hasValue(... is missing a closing paren. Without the paren, it's possible the code block for the if is being interpreted as a closure ... and the extra if throws enough additional code into the mix that syntax errors are finally recognized. Strange that it initially passed code validation (after running it, I removed the paren that I had added, and eclipse properly identified a syntax error in the code).
I have Eclipse Luna (Service Release 1a (4.4.1)) with following plugins installed:
Groovy-Eclipse Feature
Groovy Compiler 2.0 Feature 2.9.1.xx-201412191752-e44
Grails IDE 3.6.3.201411271013-RELEASE
I have a simple class:
Another simple class:
It is only when I run Test2, it gives me following exception:
Also when I add another
if()
toTest2
, then it gives not much sensing error description:I tried same in Groovy/Grails Tool Suite (which is also eclipse based) by GoPivotal v 3.3.0.RELEASE. It also gives same error.
The text was updated successfully, but these errors were encountered: