daniellansun commented on code in PR #2845:
URL: https://github.com/apache/groovy/pull/2845#discussion_r3889409625
##########
src/main/java/org/codehaus/groovy/ast/ClassNode.java:
##########
@@ -2034,6 +2053,28 @@ public List<ClassNode> getOuterClasses() {
return result;
}
+ /**
+ * For a JLS 4.5 rare type {@code Outer<T>.Inner}, the parameterized
enclosing
+ * type. Distinct from {@link #getOuterClass()}, which is the enclosing
class
+ * of a nested class <em>declaration</em>.
+ *
+ * @return the parameterized enclosing type, or {@code null} if this is
not a rare type
+ * @since 6.0.0
+ */
+ public ClassNode getOuterClassType() {
+ return getNodeMetaData("outer.class");
+ }
+
+ /**
+ * Records the parameterized enclosing type of a JLS 4.5 rare type.
+ *
+ * @param outer the parameterized {@code Outer<T>} node; {@code null}
clears it
+ * @since 6.0.0
+ */
+ public void setOuterClassType(final ClassNode outer) {
+ putNodeMetaData("outer.class", outer);
Review Comment:
Agreed. `outerClassType` is now a real field on `ClassNode`, next to
`componentType`. Getter/setter only touch that field and do not write through
`redirect()`, matching `getGenericsTypes()` / `setGenericsTypes()`. A
leftover
`"outer.class"` metadata key is no longer read. `getPlainNodeReference()`
still
copies the field.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]