Sets this instance as a proxy for the given ClassNode, enabling deferred class resolution. After calling this method, most operations on this ClassNode are forwarded to the target ClassNode. Redirect is only allowed for non-primary ClassNodes (see #isPrimaryClassNode()). If the targe
(ClassNode node)
| 309 | * @throws GroovyBugError if this is a primary ClassNode, as redirects are only for proxy nodes |
| 310 | */ |
| 311 | public void setRedirect(ClassNode node) { |
| 312 | if (isPrimaryNode) throw new GroovyBugError("tried to set a redirect for a primary ClassNode (" + getName() + "->" + node.getName() + ")."); |
| 313 | if (node != null && !isGenericsPlaceHolder()) node = node.redirect(); |
| 314 | if (node == this) return; |
| 315 | redirect = node; |
| 316 | } |
| 317 | |
| 318 | /** |
| 319 | * Determines whether this ClassNode is a primary node or redirects to one. |
no test coverage detected