On 03/04/2020 12:46, Tom De Wolf wrote:
Hi,

I understand that for individual classes and non-java resources a patch should replace them. However for directories which are actually java packages this seems to be odd. Does this not make it impossible to add a new class to an existing package or replace only 1 class in a package but keep the rest? If only the package found in the patch is returned then only classes in that patch are found and not the classes in the original package.
Best to read the "Patching module content" section of JEP 261 [1] as it has the details. Hopefully it will be clear that you are add classes or resources to an existing package (the classes loaded from that location will be in the same run-time package as those located from the equivalent location in the original module).

Just on directories as resources. This is a very under-specific area and has always been implementation specific as to whether directories are located as resources, also whether they are synthesized when they don't exist (e.g. a JAR file might have directory entries stripped, zip -D, etc). Short comings in the specification of resources pre-date modules.

-Alan

[1] https://openjdk.java.net/jeps/261#Patching-module-content

Reply via email to