Skip to content

Commit

Permalink
Improve 'enablePreview' option description
Browse files Browse the repository at this point in the history
Code review feedback, thanks to @rfscholte. This parameter has its
gotchas, so I think for AspectJ Maven users it is better to pull it into
the API and document it better than actual CLI compilers do than to let
users play with it via the generic 'additionalCompilerArgs' option and
then answer lots of related StackOverflow and GitHub questions without
even being able to point to the documentation ("we told you so").
  • Loading branch information
kriegaex committed Jun 8, 2021
1 parent 4d4e99c commit 2cb9d40
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,13 @@ public abstract class AbstractAjcCompiler extends AbstractAjcMojo {
@Parameter
protected List<String> additionalCompilerArgs = new ArrayList<>();

/**
* Activates compiler preview features (e.g. sealed classes in Java 16) when used with a suitable JDK version
/**
* Activates compiler preview features (e.g. sealed classes in Java 16) when used with a suitable JDK version.
* <p>
* <b>Please note:</b> You cannot run code compiled with preview features on any other JDK than the one used for
* compilation. For example, records compiled with preview on JDK 15 cannot be used on JDK 16 without recompilation.
* This is a JVM limitation unrelated to AspectJ. Also, e.g. sealed classes are preview-1 on JDK 15 and preview-2 on
* JDK 16. You still need to recompile, no matter what.
*
* @since 1.13
*/
Expand Down

0 comments on commit 2cb9d40

Please sign in to comment.