@return the ClassNode of the super class of this type
()
| 530 | * @return the {@code ClassNode} of the super class of this type |
| 531 | */ |
| 532 | public ClassNode getSuperClass() { |
| 533 | if (!lazyInitDone && !isResolved()) { |
| 534 | throw new GroovyBugError("ClassNode#getSuperClass for " + getName() + " called before class resolving"); |
| 535 | } |
| 536 | var sc = redirect().getUnresolvedSuperClass(); |
| 537 | if (sc != null) { |
| 538 | sc = sc.redirect(); |
| 539 | if (isPrimaryClassNode() && (sc.isInterface() || isTrait(sc))) |
| 540 | sc = ClassHelper.OBJECT_TYPE; // GROOVY-8272, GROOVY-11299 |
| 541 | } |
| 542 | return sc; |
| 543 | } |
| 544 | |
| 545 | /** |
| 546 | * Sets the super class of this {@link ClassNode}. If this ClassNode has a redirect, |