MCPcopy Index your code
hub / github.com/apache/groovy / setRedirect

Method setRedirect

src/main/java/org/codehaus/groovy/ast/ClassNode.java:311–316  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 15

makePlaceholderMethod · 0.95
configureWildcardTypeMethod · 0.95
makeClassNodeMethod · 0.95
resolveGenericsHeaderMethod · 0.95
resolveGenericsTypeMethod · 0.95
resolveTypeMethod · 0.95
addClassMethod · 0.95
makeWithoutCachingMethod · 0.95
getPlainNodeReferenceMethod · 0.95
addMethodGenericsMethod · 0.95
createWildcardMethod · 0.95

Calls 4

getNameMethod · 0.95
isGenericsPlaceHolderMethod · 0.95
getNameMethod · 0.65
redirectMethod · 0.45

Tested by

no test coverage detected