RFR: 8321182: SourceExample.SOURCE_14 comment should refer to 'switch expressions' instead of 'text blocks'

Eirik Bjorsnos duke at openjdk.org
Fri Dec 1 15:39:13 UTC 2023


The `Versions` test has a comment referring to 'text blocks' when the feature introduced in Java 14 was actually 'switch expressions'. This looks like a simple copy/paste mistake.

This PR fixes the comment. While touching the code, I also took the liberty to do the following improvements:

- Fixed a typo in `requirements' in a code comment
- Removed some unused imports
- Reduced duplication of `JavaCompiler` option conversion by introducing a separate method `javaCompilerOptions`. (Used the 'extract method' refactoring in IntelliJ IDEA which replaced 3 duplicates)

If the last fix is considered gratuitous, let me know and I can simplify the PR.

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

Commit messages:
 - Correctly refer to SOURCE_14 feature as 'switch expressions'. Extract method javaCompilerOptions. Fix 'requirements' typo.

Changes: https://git.openjdk.org/jdk/pull/16924/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16924&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8321182
  Stats: 51 lines in 1 file changed: 19 ins; 28 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/16924.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16924/head:pull/16924

PR: https://git.openjdk.org/jdk/pull/16924


More information about the compiler-dev mailing list