Skip to content

Add a ClassDump utility to compare Java classes in unit tests.

Eric Bruneton requested to merge add-class-dump-tool-for-unit-tests into master

Currently the conformance tests use ASM to make assertions about itself (via the ClassReader and TraceClassVisitor classes, used to compare classes before and after some transformation). This circular dependency makes some bugs impossible to detect (for instance, bugs where ClassReader silently ignores some parts of a class).

This new class will be used to replace ClassReader+TraceClassVisitor as a mean of comparing classes at a slightly higher level than bytes (to abstract away non-essential differences such as the order of the elements in the constant pool, in attributes, etc). This new class is much simpler than ClassReader and much closer to the Java Virtual Machine Specification, in order to get a high confidence in its correctness (which is important since it will serve as a basis to check the correctness of ASM).

Unit tests for this new class will be added in later commits (this one is already quite large). Likewise, the existing ASM tests will be converted to use this new class in later commits. I tried to use long, explicit and meaningful names, with extensive comments, but please make comments if some things are not clear or are missing.

Merge request reports