Currently in javac while reading manifest files and when creating an archive container we open the same jar file twice once in FSInfo class to read manifest attributes and again in JavacFileManager class which reduces the performance of javac. To resolve this we should be creating a cache of file systems after reading a jar file either in FSInfo or JavacFileManager classes.
I'm attaching a test case where the opening of a single jar file multiple times can be observed. I have given rt.jar file as the classpath to test this use case.