|
64 | 64 | * Values should be annotated with the feature's {@code JEP}. |
65 | 65 | */ |
66 | 66 | public enum Feature { |
67 | | - // while building the interim javac, the ClassReader will produce a warning when loading a class |
68 | | - // keeping the constant of a feature that has been integrated or dropped, serves the purpose of muting such warnings. |
| 67 | + // The JDK build process involves creating an interim javac which is then |
| 68 | + // used to compile the rest of the JDK. The jdk.internal.javac.PreviewFeature |
| 69 | + // annotation from the current sources is used when compiling interim javac. |
| 70 | + // That's because the javac APIs of the current sources may be annotated with |
| 71 | + // this annotation and they may be using the enum constants of the current sources. |
| 72 | + // Furthermore, when compiling interim javac, the class files from the bootstrap JDK get |
| 73 | + // used and those may also contain the PreviewFeature annotation. However, they may be |
| 74 | + // using the enum constants of the bootstrap JDK's PreviewFeature annotation. |
| 75 | + // If javac sees an annotation with an unknown enum constant, it produces a warning, |
| 76 | + // and that in turn fails the build. |
| 77 | + // So, in the current sources, we need to preserve the PreviewFeature enum constants |
| 78 | + // for as long as the interim javac build needs it. As a result, we retain PreviewFeature |
| 79 | + // enum constants for preview features that are present in the bootstrap JDK. |
| 80 | + // Older constants can be removed. |
| 81 | + // |
| 82 | + // For example, Class-File API became final in JDK 24. As soon as JDK 23 was dropped as |
| 83 | + // the bootstrap JDK, the CLASSFILE_API enum constant became eligible for removal. |
69 | 84 |
|
70 | 85 | //--- |
71 | | - IMPLICIT_CLASSES, //to be removed when boot JDK is 25 |
72 | | - SCOPED_VALUES, |
73 | 86 | @JEP(number=505, title="Structured Concurrency", status="Fifth Preview") |
74 | 87 | STRUCTURED_CONCURRENCY, |
75 | | - CLASSFILE_API, |
76 | | - STREAM_GATHERERS, |
77 | | - MODULE_IMPORTS, //remove when the boot JDK is JDK 25 |
78 | | - KEY_DERIVATION, //remove when the boot JDK is JDK 25 |
79 | 88 | @JEP(number = 502, title = "Stable Values", status = "Preview") |
80 | 89 | STABLE_VALUES, |
81 | 90 | @JEP(number=470, title="PEM Encodings of Cryptographic Objects", status="Preview") |
|
0 commit comments