Adds a MethodNode to this ClassNode. The method is added to the internal methods list and registered by name in the methods map for fast lookup. The method's declaring class is set to this node's redirect target. This method does not check for duplicates. @param node the MethodNode
(MethodNode node)
| 854 | * @see MethodNode |
| 855 | */ |
| 856 | public void addMethod(MethodNode node) { |
| 857 | ClassNode r = redirect(); |
| 858 | node.setDeclaringClass(r); |
| 859 | if (r.methodsList.isEmpty()) { |
| 860 | r.methodsList = new ArrayList<>(4); |
| 861 | } |
| 862 | r.methodsList.add(node); |
| 863 | r.methods.put(node.getName(), node); |
| 864 | } |
| 865 | |
| 866 | /** |
| 867 | * Creates and adds a {@link MethodNode} to this ClassNode with the specified properties, |