Replicating the class lookup process

Mark Raynsford <[email protected]> Sun, 22 Oct 2017 18:40:21 +0000
Newsgroups gmane.comp.java.objectweb.asm
Organization io7m.com
Message-ID <[email protected]>
Hello.

I'm writing a small tool that analyzes Java 9 modules. I understand
from reading the ASM user guide that ASM doesn't know anything about
class loading, and that's fine. My program takes a single module as an
argument and analyzes the classes within it using the tree API. However,
classes within that module can obviously extend classes that are defined
outside of the module and therefore I need to be able to look up
external classes. Essentially, given an arbitrary class name, I need to
be able to return a ClassNode by finding it in one or more external
modules. This may include platform classes.

My actual question: Do I need to implement the whole lookup process
myself? It seems that in order to do so correctly, I'd need to
duplicate at least some of the semantics that the VM implements
(building a module graph, etc). It seems like it could also get a bit
platform-specific: If I need to look at platform classes, then I'd need
to be able to locate them on the user's system, and that could get
unpleasant very quickly.

-- 
Mark Raynsford | http://www.io7m.com
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEgWja4isV0+3HIsI9DxW30G+oDLgFAlns5hUACgkQDxW30G+o
DLhv0w/9FDxN5jBRhS4FFe+yXuFxH6lunyeMs4lj5xc8yzhZCd1cP6nbE3ZpUZHL
rJLP2sGs3qF24Q+hAv70GWhlok05XXEJh3PWArY1lBX/M2tuonOosvoIQgWCfrC0
YYBeuOkutj6YnjaDRtTRDlo0mA5j6lVvaFP/pd7pX62sx+lQilr3YD16KvkkRHte
vitnPFkp1tSjWv8V/iWMX5MvqoDfjdwZ3vVMVUq108/3kFjUsLlWfdvENSd5tu37
hCUVTwhKcvQbMScnbpUexslMbodW/1gEp03q+X7KfPdAn/wa/5WVDhNZg2Z1H5TZ
UiL/nbe4Tg+bsTrdPIIo7IxA/XxQtMjJmtV60hBkGvXY1NX5i5CKuVNXnOEYmE5/
+ThcNGdjm42Oh+F+65A3ddSrbX5yGEZm52jY8boqW+CIFPGA8wizlIl796L8CyoG
3bzvdMo2bMpe47YPCraM7DrwQZyMwLZ3X1Nxll20rD1LIjNJAOangeUD/LpM/+sC
gW5gr9RpS0o6NPQ2h77kEBFfGbTDGdJnC5T/8RyL+1SVoV4cNqBgiehc1jE2+ikC
wfD+9wxIINCcOK1sc25qQshSq8WqnhjO7U0w56hpMbKJxqn0WSShplxoaEpbX01g
mVhA3mxBjyAms4GA7T/ePJztecX8eH3YtrRasfmoY8pyvTAk5wA=
=B4b7
-----END PGP SIGNATURE-----