asm issueshttps://gitlab.ow2.org/asm/asm/-/issues2023-12-20T13:59:35Zhttps://gitlab.ow2.org/asm/asm/-/issues/318010reset() methods for the Tree API2023-12-20T13:59:35ZAura Leereset() methods for the Tree APICurrently, when 'xyz.accept(cn)' is called twice for a ClassNode, everything will be duplicated inside that ClassNode.
A 'reset()' method in each Node of the Tree API would be a neat feature to have, in order to overwrite all current i...Currently, when 'xyz.accept(cn)' is called twice for a ClassNode, everything will be duplicated inside that ClassNode.
A 'reset()' method in each Node of the Tree API would be a neat feature to have, in order to overwrite all current information of a Node with new information (using accept), without the need of recreating the node and replacing all existing Node references.
For ClassNode it would look like something like this:
```java
public void reset() {
this.methods.clear();
this.fields.clear();
this.version = 0;
this.access = 0;
this.name = null;
this.signature = null;
this.superName = null;
this.interfaces = new ArrayList<>();
this.sourceFile = null;
this.sourceDebug = null;
this.module = null;
this.outerClass = null;
this.outerMethod = null;
this.outerMethodDesc = null;
this.visibleAnnotations = null;
this.invisibleAnnotations = null;
this.visibleTypeAnnotations = null;
this.invisibleTypeAnnotations = null;
this.attrs = null;
this.innerClasses = new ArrayList<>();
this.nestHostClass = null;
this.nestMembers = null;
this.permittedSubclasses = null;
this.recordComponents = null;
}
```
Currently, I have my own implementation of ClassNode with the specified reset() method, but when ASM is updated, I would have to add new fields to this method.