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

Method addMixin

src/main/java/org/codehaus/groovy/ast/ClassNode.java:698–714  ·  view source on GitHub ↗
(MixinNode node)

Source from the content-addressed store, hash-verified

696 }
697
698 public void addMixin(MixinNode node) {
699 // let's check if it already uses a mixin
700 MixinNode[] mixins = getMixins();
701 boolean skip = false;
702 for (MixinNode existing : mixins) {
703 if (node.equals(existing)) {
704 skip = true;
705 break;
706 }
707 }
708 if (!skip) {
709 MixinNode[] newMixins = new MixinNode[mixins.length + 1];
710 System.arraycopy(mixins, 0, newMixins, 0, mixins.length);
711 newMixins[mixins.length] = node;
712 setMixins(newMixins);
713 }
714 }
715
716 /**
717 * Adds a {@link FieldNode} to this ClassNode. The field is added to the end of the field list

Callers

nothing calls this directly

Calls 4

getMixinsMethod · 0.95
setMixinsMethod · 0.95
arraycopyMethod · 0.80
equalsMethod · 0.65

Tested by

no test coverage detected