On Fri, 13 May 2022 21:51:32 GMT, Jonathan Gibbons <j...@openjdk.org> wrote:
> Please review a small fix to address use of snippets in source code in the > unnamed package. > > The core of the fix is to replace `packageName(pkg, utils)` (which returns > `"<Unnamed>"` for the unnamed package) with plain old > `pkg.getQualifiedName().toString()` (which returns an empty string for the > unnamed package.) > > There's some minor localized cleanup and rearrangement as well. > > The test verifies behavior without and then with a source path, since that is > the likely path of discovery by a user playing with the unnamed package. test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetUnnamedPackage.java line 84: > 82: checkExit(useSourcePath ? Exit.OK : Exit.ERROR); > 83: checkOutput(Output.OUT, !useSourcePath, > 84: "C.java:4: error: file not found on source path or > snippet path: S.java"); I must admit I don't understand the rules for snippet discovery with or without --source-path argument. Would the same behavior be expcected for code in a named package? ------------- PR: https://git.openjdk.java.net/jdk/pull/8708