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