Christopher Smith created GROOVY-8032:
-----------------------------------------
Summary: nested classes on interfaces are not static
Key: GROOVY-8032
URL: https://issues.apache.org/jira/browse/GROOVY-8032
Project: Groovy
Issue Type: Bug
Components: class generator
Affects Versions: 2.4.7
Reporter: Christopher Smith
Priority: Minor
According to the JLS, "A member type declaration in an interface is implicitly
{{static}} and {{public}}", and there does not seem to be any reason for Groovy
to support non-static nested classes on interfaces. However, classes not
explicitly marked {{static}} do not have the static flag set. This appears to
be a simple bug in the class generator, as the generated constructor does not
attempt to store an outer reference or otherwise behave as an inner class. It
does, however, break reflective code (Jackson) that gets very confused when
looking for an eligible constructor.
{code}
interface Example {
class Response {
int code
}
}
{code}
Expected result: {{Example$Response}} has the static modifier flag set.
Actual result: It does not.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)