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
()
| 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. |
no test coverage detected