RFR: 8332226: "Invalid package name:" from source launcher [v2]

Alan Bateman alanb at openjdk.org
Mon May 20 15:08:11 UTC 2024


On Fri, 17 May 2024 09:19:14 GMT, Christian Stein <cstein at openjdk.org> wrote:

>> Please review this change excluding directory paths with invalid elements when computing the packages of a module in source-launch mode.
>> 
>> Note that this inital iteration of the change only fixes the in-memory computation of package names - the behaviour of the associated module reader implementation is untouched for the time being. This introduces a difference in the set of resources being readable at runtime. For example, see the modified test case: the new and invalid `.bar` directory doesn't show up in the contents of the module - but it is reported by the module reader's `list()` method.
>> 
>> Note additionally, that above's behaviour is also observed for compiled and exploded modules. Meaning, that with this change being applied, the source mode and compiled mode of the launcher are in line.
>
> Christian Stein has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Copy `ModulePath`'s exploded directories logic

src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/ProgramDescriptor.java line 47:

> 45: 
> 46: import javax.lang.model.SourceVersion;
> 47: import jdk.internal.module.Checks;

I'm trying to page in the build steps for jdk.compiler.interim. It this compiled with the boot JDK or the newly built JDK or both? I'm just wondering if this dependency on the internal class will be problematic or not, also wondering if it would be better for toPackageName test with SourceVersion.isIdentifier(name) instead.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19245#discussion_r1606902800


More information about the compiler-dev mailing list