[jdk17u-dev] RFR: 8314975: JavadocTester should set source path if not specified [v2]
Goetz Lindenmaier
goetz at openjdk.org
Thu Feb 20 13:17:54 UTC 2025
On Thu, 6 Feb 2025 13:59:00 GMT, Goetz Lindenmaier <goetz at openjdk.org> wrote:
>> I backport this for parity with 17.0.16-oracle.
>>
>> Add-on:
>>
>> Our nightly testing found that TestCopyFiles.java is failing with this patch.
>> This concerns only the subtest testDocFilesInPackagesSource7UsingClassPath().
>>
>> This test is removed in later jdks by [JDK-8173605](https://bugs.openjdk.org/browse/JDK-8173605): Remove support for source and target 1.7 option in javac.
>>
>> The test sets "-source 7" for the test run. It tests that -classpath can
>> be given to javadoc instead of -sourcepath. This feature still exists in higher jdks,
>> I verified that the test is passing if either using "-source 8/9" or removing this flag (and undoing the edits of this change).
>>
>> The edits of this change affect that -sourcepath is added to the javadoc command line, but the
>> path used (testSrc) does not point to the proper sources. Thus the test fails.
>>
>> I see several ways to repair this:
>> * add proper -sourcepath to the test. This contradicts the purpose of this test, but makes it pass. See second commit.
>> * remove the test altogether as it is the case in later jdks.
>> * somehow implement a special case to avoid that JavadocTester adds -sourcepath to this test.
>>
>> A somewhat bigger fix would be to add "-classpath" to the check for sourcepath in JavadocTester and add the testDocFilesInPackagesSource7UsingClassPath back again, but remove the -source setting from that test. I guess this should be done in head and backported to 24, 21 and 17.
>
> Goetz Lindenmaier has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix TestCopyFiles.java
Thanks for the review!
-------------
PR Comment: https://git.openjdk.org/jdk17u-dev/pull/3266#issuecomment-2671464003
More information about the jdk-updates-dev
mailing list