multiple copies of test file FileUtils.java in 8u tree

Andrew Hughes gnu.andrew at redhat.com
Wed Sep 28 16:50:36 UTC 2022


On 10:50 Wed 21 Sep     , Jonathan Dowland wrote:
> Whilst working on a backport, I discovered the following two files in
> the 8u source tree
> 
>      ./jdk/test/lib/testlibrary/jdk/testlibrary/FileUtils.java
>      ./jdk/test/lib/jdk/test/lib/util/FileUtils.java
> 
> There is one copy of this in upstream jdk.
> 
> It moved from test/lib/testlibrary/jdk/testlibrary/FileUtils.java to
> test/lib/jdk/test/lib/util/FileUtils.java in the JDK10 era with
> 
>      8180887: move FileUtils to top level testlibrary
> 
> The newer-path copy in 8u was introduced with
> 
>      df7e0904339 8223147: JFR Backport
> 
> Should we move to one copy in the 8u tree?
> 
> Do we choose the old or new path? From the POV of further backports, I'd
> guess the newer path is likely to be more common. In my specific case
> (backporting 8231111) the patches use the newer path (which is trivial
> to change of course) but the code also uses methods that are only
> present in 8u's copy at the new path and not the old one.
> 
> FileUtils.java is just one such file, I think there are likely more.
> 
> 
> 
> Thanks,
> 
> -- 
> 👱🏻 Jonathan Dowland <jdowland at redhat.com>
> Senior Software Engineer, OpenJDK, Red Hat
> 

Yes, I'm aware of a few cases of this. It seems the JFR backport just
dumped all the test infrastructure it needed under test/lib/jdk
rather than adapting to existing 8u paths and files.

Going forward, I'd like to unify them and also move all tests to the
top-level as in later JDKs. Unlike with the source code structure,
which could affect the end product, tests are just for developers
and retaining the old hotspot/test, jdk/test etc. gains us nothing
but just creates problems, particularly when JDK tests need to reuse
utility code that is in the HotSpot tests and vice versa.

In the meantime, I'd stick to using the 8u (lib/testlibrary) versions.
As demonstrated in your follow-up e-mail, some of the ones imported
for the JFR backport don't even seem to work.

Thanks,
-- 
Andrew :)
Pronouns: he / him or they / them
Senior Free Java Software Engineer
OpenJDK Package Owner
Red Hat, Inc. (http://www.redhat.com)

PGP Key: ed25519/0xCFDA0F9B35964222 (hkp://keys.gnupg.net)
Fingerprint = 5132 579D D154 0ED2 3E04  C5A0 CFDA 0F9B 3596 4222
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/jdk8u-dev/attachments/20220928/96bf7197/signature.asc>


More information about the jdk8u-dev mailing list