[GRADLE-2863] Private method calls of DSL enhanced objects may not work correctly Created: 08/Aug/13  Updated: 24/Nov/13  Resolved: 24/Nov/13

Status: Resolved
Project: Gradle
Affects Version/s: 1.7
Fix Version/s: 1.8-rc-1

Type: Bug
Reporter: Luke Daley Assignee: Unassigned
Resolution: Fixed Votes: 0

Known Issue Of:


In certain circumstances, calling private methods inside DSL enhanced objects (typically either Task implementations or extensions) will produce strange results. This only affects classes implemented in Groovy.

There are two known issues:

1. Method arguments are not type coerced according to normal Groovy rules (e.g. GStrings automatically converted to strings)
2. Checked exceptions thrown by the called method will be wrapped in a GradleException (a runtime exception)

The workaround for this is to:

1. Factor the private method out of the decorated class
2. Ensure that the method is called with accurately typed parameters (i.e. all arguments are strongly typed and are assignment compatible with their associated parameter type)

#2 Can be said another way as: the method call should succeed according to Java semantics, not Groovy semantics.

Generated at Wed Jun 30 12:33:30 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.