On Tue, 6 Sep 2022 21:36:36 GMT, John Neffenger <[email protected]> wrote:
>> test/langtools/jdk/javadoc/doclet/testIndexInherited/pkg1/ClassA.java line 1: >> >>> 1: /* >> >> It's not wrong to use separate files, as you have for `ClassA`, `ClassB` and >> `ClassC` but generally the prevailing style these days is to generate small >> test files (like these) from text blocks in the main test file. This makes >> it easier to see the sources all together, and avoids the overhead of the >> legal block. That being said, The amount of text after the legal block puts >> these in the gray area where either style is OK. > > I found it useful to have the actual files so that I could prove to myself > that this quirk in the Java language is real. I even added a `main` method to > `pkg2.ClassC` so that I could run it and see that `ClassC` really does have > runtime access to `methodA` with package access in `pkg1.ClassA`. > > I also found it useful to have the class files so that I could generate the > Javadoc API documentation and look at it myself outside of the test case. Yeah, there's a difference between what is best for an initial sandbox to play to investigate a feature, and the best form for a test. But I guess this comes down to a 50/50 style issue in this case, so OK. ------------- PR: https://git.openjdk.org/jdk/pull/10070
