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

Method getTypeClass

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

Returns the concrete class this classnode relates to. However, this method is inherently unsafe as it may return null depending on the compile phase you are using. AST transformations should never use this method directly, but rather obtain a new class node using #getPlainNodeReference(). @r

()

Source from the content-addressed store, hash-verified

1941 * @return the class this classnode relates to. May return null.
1942 */
1943 public Class getTypeClass() {
1944 if (clazz != null) return clazz;
1945 if (redirect != null) return redirect.getTypeClass();
1946
1947 ClassNode component = redirect().componentType;
1948 if (component != null && component.isResolved()) {
1949 return Array.newInstance(component.getTypeClass(), 0).getClass();
1950 }
1951 throw new GroovyBugError("ClassNode#getTypeClass for " + getName() + " called before the type class is set");
1952 }
1953
1954 /**
1955 * Determines whether this ClassNode represents an array type.

Callers 8

getDefaultOptionValueMethod · 0.45
tryMacroMethodMethod · 0.45
configureClassNodeMethod · 0.45
getTimeStampMethod · 0.45
isNonSealedMethod · 0.45

Calls 5

redirectMethod · 0.95
isResolvedMethod · 0.95
getNameMethod · 0.95
getClassMethod · 0.80
newInstanceMethod · 0.65

Tested by

no test coverage detected