Skip to content

Commit d82436e

Browse files
committed
8295071: Spec Clarification : ClassFileFormatVersion: System property java.class.version | Java class format version number
Reviewed-by: iris, alanb, rriggs
1 parent 571fbdc commit d82436e

File tree

2 files changed

+31
-21
lines changed

2 files changed

+31
-21
lines changed

src/java.base/share/classes/java/lang/System.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,10 @@ public static native void arraycopy(Object src, int srcPos,
753753
* <tr><th scope="row">{@systemProperty java.specification.name}</th>
754754
* <td>Java Runtime Environment specification name</td></tr>
755755
* <tr><th scope="row">{@systemProperty java.class.version}</th>
756-
* <td>Java class format version number</td></tr>
756+
* <td>{@linkplain java.lang.reflect.ClassFileFormatVersion#latest() Latest}
757+
* Java class file format version recognized by the Java runtime as {@code "MAJOR.MINOR"}
758+
* where {@link java.lang.reflect.ClassFileFormatVersion#major() MAJOR} and {@code MINOR}
759+
* are both formatted as decimal integers</td></tr>
757760
* <tr><th scope="row">{@systemProperty java.class.path}</th>
758761
* <td>Java class path (refer to
759762
* {@link ClassLoader#getSystemClassLoader()} for details)</td></tr>

src/java.base/share/classes/java/lang/reflect/ClassFileFormatVersion.java

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@
3636
* added to model future releases of the Java Virtual Machine
3737
* Specification.
3838
*
39+
* @apiNote
40+
* The complete version used in a class file includes a major version
41+
* and a minor version; this enum only models the major version. A
42+
* Java virtual machine implementation is required to support a range
43+
* of major versions; see the corresponding edition of the <cite>The
44+
* Java Virtual Machine Specification</cite> for details.
45+
*
3946
* @since 20
4047
* @see System#getProperties System property {@code java.class.version}
4148
* @see java.compiler/javax.lang.model.SourceVersion
@@ -64,7 +71,7 @@ public enum ClassFileFormatVersion {
6471
RELEASE_1(45),
6572

6673
/**
67-
* The version recognized by the Java 2 Platform, Standard Edition,
74+
* The version introduced by the Java 2 Platform, Standard Edition,
6875
* v 1.2.
6976
*
7077
* The format described in <cite>The Java Virtual Machine
@@ -74,19 +81,19 @@ public enum ClassFileFormatVersion {
7481
RELEASE_2(46),
7582

7683
/**
77-
* The version recognized by the Java 2 Platform, Standard Edition,
84+
* The version introduced by the Java 2 Platform, Standard Edition,
7885
* v 1.3.
7986
*/
8087
RELEASE_3(47),
8188

8289
/**
83-
* The version recognized by the Java 2 Platform, Standard Edition,
90+
* The version introduced by the Java 2 Platform, Standard Edition,
8491
* v 1.4.
8592
*/
8693
RELEASE_4(48),
8794

8895
/**
89-
* The version recognized by the Java 2 Platform, Standard
96+
* The version introduced by the Java 2 Platform, Standard
9097
* Edition 5.0.
9198
*
9299
* @see <a
@@ -100,7 +107,7 @@ public enum ClassFileFormatVersion {
100107
RELEASE_5(49),
101108

102109
/**
103-
* The version recognized by the Java Platform, Standard Edition
110+
* The version introduced by the Java Platform, Standard Edition
104111
* 6.
105112
*
106113
* @see <a
@@ -110,7 +117,7 @@ public enum ClassFileFormatVersion {
110117
RELEASE_6(50),
111118

112119
/**
113-
* The version recognized by the Java Platform, Standard Edition
120+
* The version introduced by the Java Platform, Standard Edition
114121
* 7.
115122
*
116123
* @see <a
@@ -120,7 +127,7 @@ public enum ClassFileFormatVersion {
120127
RELEASE_7(51),
121128

122129
/**
123-
* The version recognized by the Java Platform, Standard Edition
130+
* The version introduced by the Java Platform, Standard Edition
124131
* 8.
125132
*
126133
* @see <a
@@ -132,7 +139,7 @@ public enum ClassFileFormatVersion {
132139
RELEASE_8(52),
133140

134141
/**
135-
* The version recognized by the Java Platform, Standard Edition
142+
* The version introduced by the Java Platform, Standard Edition
136143
* 9.
137144
*
138145
* @see <a
@@ -144,7 +151,7 @@ public enum ClassFileFormatVersion {
144151
RELEASE_9(53),
145152

146153
/**
147-
* The version recognized by the Java Platform, Standard Edition
154+
* The version introduced by the Java Platform, Standard Edition
148155
* 10.
149156
*
150157
* @see <a
@@ -154,7 +161,7 @@ public enum ClassFileFormatVersion {
154161
RELEASE_10(54),
155162

156163
/**
157-
* The version recognized by the Java Platform, Standard Edition
164+
* The version introduced by the Java Platform, Standard Edition
158165
* 11.
159166
*
160167
* @see <a
@@ -166,7 +173,7 @@ public enum ClassFileFormatVersion {
166173
RELEASE_11(55),
167174

168175
/**
169-
* The version recognized by the Java Platform, Standard Edition
176+
* The version introduced by the Java Platform, Standard Edition
170177
* 12.
171178
*
172179
* @see <a
@@ -176,7 +183,7 @@ public enum ClassFileFormatVersion {
176183
RELEASE_12(56),
177184

178185
/**
179-
* The version recognized by the Java Platform, Standard Edition
186+
* The version introduced by the Java Platform, Standard Edition
180187
* 13.
181188
*
182189
* @see <a
@@ -186,7 +193,7 @@ public enum ClassFileFormatVersion {
186193
RELEASE_13(57),
187194

188195
/**
189-
* The version recognized by the Java Platform, Standard Edition
196+
* The version introduced by the Java Platform, Standard Edition
190197
* 14.
191198
*
192199
* @see <a
@@ -196,7 +203,7 @@ public enum ClassFileFormatVersion {
196203
RELEASE_14(58),
197204

198205
/**
199-
* The version recognized by the Java Platform, Standard Edition
206+
* The version introduced by the Java Platform, Standard Edition
200207
* 15.
201208
*
202209
* @see <a
@@ -208,7 +215,7 @@ public enum ClassFileFormatVersion {
208215
RELEASE_15(59),
209216

210217
/**
211-
* The version recognized by the Java Platform, Standard Edition
218+
* The version introduced by the Java Platform, Standard Edition
212219
* 16.
213220
*
214221
* @see <a
@@ -218,7 +225,7 @@ public enum ClassFileFormatVersion {
218225
RELEASE_16(60),
219226

220227
/**
221-
* The version recognized by the Java Platform, Standard Edition
228+
* The version introduced by the Java Platform, Standard Edition
222229
* 17.
223230
*
224231
* Additions in this release include sealed classes and
@@ -235,7 +242,7 @@ public enum ClassFileFormatVersion {
235242
RELEASE_17(61),
236243

237244
/**
238-
* The version recognized by the Java Platform, Standard Edition
245+
* The version introduced by the Java Platform, Standard Edition
239246
* 18.
240247
*
241248
* @see <a
@@ -245,7 +252,7 @@ public enum ClassFileFormatVersion {
245252
RELEASE_18(62),
246253

247254
/**
248-
* The version recognized by the Java Platform, Standard Edition
255+
* The version introduced by the Java Platform, Standard Edition
249256
* 19.
250257
*
251258
* @see <a
@@ -255,7 +262,7 @@ public enum ClassFileFormatVersion {
255262
RELEASE_19(63),
256263

257264
/**
258-
* The version recognized by the Java Platform, Standard Edition
265+
* The version introduced by the Java Platform, Standard Edition
259266
* 20.
260267
*
261268
* @see <a
@@ -265,7 +272,7 @@ public enum ClassFileFormatVersion {
265272
RELEASE_20(64),
266273

267274
/**
268-
* The version recognized by the Java Platform, Standard Edition
275+
* The version introduced by the Java Platform, Standard Edition
269276
* 21.
270277
*
271278
* @since 21

0 commit comments

Comments
 (0)