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

Method visitMethods

src/main/java/org/codehaus/groovy/ast/ClassNode.java:1822–1841  ·  view source on GitHub ↗
(GroovyClassVisitor visitor)

Source from the content-addressed store, hash-verified

1820 }
1821
1822 private void visitMethods(GroovyClassVisitor visitor) {
1823 // create snapshot of the method list to avoid ConcurrentModificationException
1824 List<MethodNode> methodList = new ArrayList<>(getMethods());
1825 for (MethodNode mn : methodList) {
1826 visitor.visitMethod(mn);
1827 }
1828
1829 // visit the method nodes added while iterating,
1830 // e.g. synthetic method for constructor reference
1831 final List<MethodNode> newMethodList = getMethods();
1832 if (newMethodList.size() > methodList.size()) { // if the newly added method nodes found, visit them
1833 List<MethodNode> changedMethodList = new ArrayList<>(newMethodList);
1834 boolean changed = changedMethodList.removeAll(methodList);
1835 if (changed) {
1836 for (MethodNode mn : changedMethodList) {
1837 visitor.visitMethod(mn);
1838 }
1839 }
1840 }
1841 }
1842
1843 //--------------------------------------------------------------------------
1844

Callers 1

visitContentsMethod · 0.95

Calls 4

getMethodsMethod · 0.95
visitMethodMethod · 0.65
sizeMethod · 0.65
removeAllMethod · 0.45

Tested by

no test coverage detected