RFR: 7902847: Class directory of a test case should be always used to compile a library [v9]

Roger Riggs rriggs at openjdk.org
Thu Apr 17 22:51:53 UTC 2025


On Thu, 17 Apr 2025 22:10:07 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:

>> I was expecting this text in the tag-spec to describe both behavior(s) controlled by `shareLibraries`.
>> And mention the property and clearly define the behavior of each case. 
>> 
>> That does not seem to be intended.  Instead only the changed behavior is documented and the property will not be documented. I understood the feature to control the destination directory for compiled classes but from this description it controls the source path, not the destination.
>> 
>> Since the behavior is being changed somewhat incompatibly, the text should clearly describe the new behavior and call out the differences and how to get the previous behavior if needed.
>> 
>> It would be clearer the property and its behaviors were documented in `Locations.getLibLcn` .
>> The name of the property should more clearly indicate it is for compatibility and the behavior when it is set.
>> 
>> The words "might" and "may" are red flags in any specification.
>
> The property controls only to where compile put compiled classes for `@build` tag. There are no changes related to source paths.  It remains completely the same and change shouldn't break any test.
> 
> The `might` in this part
> 
> A test that relies upon library classes might contain appropriate
> <code>@build</code> directives to explicitly compile classes.
> This might be useful when a test depends on library classes during runtime only.
> 
> just describes when `@build` tag still is useful useful. It might be not evident that testlibrary classes are not compiled if javac can't understand that they are used. 
> Also, redundant `@build` is not an error, but not useful at all. 
> 
> Does it looks better?
> 
> 
> A test that relies upon library classes that  are not implicitly resolved by during compilation should have appropriate
> <code>@build</code> directives to explicitly compile required classes.
> This is required when a test depends on library classes during runtime only.

The only text below that described a change mentions "sourcepath" and does not mention the directories the files are compiled into.

I'm not sure what is being described below except to dispel the idea that @build is necessary.

I don't have better words at the moment but would probably mention classes that were referenced using Reflection or explicitly loaded.  But being direct about when @build is necessary will be clearer.

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

PR Review Comment: https://git.openjdk.org/jtreg/pull/256#discussion_r2049730815


More information about the jtreg-dev mailing list