Code (Pre-)Review for JEP 280: Indify String Concat

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Thu Nov 26 11:45:09 UTC 2015



On 26/11/15 11:40, Maurizio Cimadamore wrote:
> * The code for initializing options in Gen is what we would normally 
> model with an enum. I.e. you need something like:
>
> enum StringConcatMode {
>    INLINE,
>    INDY_PLAIN,
>    INDY_CONSTANTS;
> }
>
> And then put some logic inside the enum class to parse the option and 
> to return the right enum constant. The code will get better as you can 
> model two constants (allowIndyStringConcat and 
> indyStringConcatConstants) with a single enum value.
Forgot - we have examples of this pattern:

http://hg.openjdk.java.net/jdk9/jdk9/langtools/file/8356d7a909a2/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java#l125

Maurizio


More information about the compiler-dev mailing list