If the following is entered in Eclipse / STS (with groovy):
interface iFaceWithAnIssue {
def thisIsFine(a,b,c)
def thisHasProblems(alpha='va')
}
The only line that complains is the one that tries to use the default value. I can not tell from the codehaus website if this is supported or not.
IDE Error:
Groovy:Cannot specify default value for method parameter
So this makes me think that this is not supported. Since there will be several implementations, I would like to use the interface here. I really don't need the default value in the interface, but there is an error trying to execute the interface contract if the implementation class then tries to set this argument by default. Is there any way?
source
share