Skip to content

Commit

Permalink
Merge tag 'jdk-24+1' into labsjdk/automation-6-7-2024-8479
Browse files Browse the repository at this point in the history
Added tag jdk-24+1 for changeset d8af589
  • Loading branch information
marwan-hallaoui committed Jun 10, 2024
2 parents f35673a + d8af589 commit e41e8e5
Show file tree
Hide file tree
Showing 55 changed files with 2,200 additions and 125 deletions.
2 changes: 1 addition & 1 deletion .jcheck/conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
project=jdk
jbs=JDK
version=23
version=24

[checks]
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
Expand Down
10 changes: 5 additions & 5 deletions make/conf/version-numbers.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
# Default version, product, and vendor information to use,
# unless overridden by configure

DEFAULT_VERSION_FEATURE=23
DEFAULT_VERSION_FEATURE=24
DEFAULT_VERSION_INTERIM=0
DEFAULT_VERSION_UPDATE=0
DEFAULT_VERSION_PATCH=0
DEFAULT_VERSION_EXTRA1=0
DEFAULT_VERSION_EXTRA2=0
DEFAULT_VERSION_EXTRA3=0
DEFAULT_VERSION_DATE=2024-09-17
DEFAULT_VERSION_CLASSFILE_MAJOR=67 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
DEFAULT_VERSION_DATE=2025-03-18
DEFAULT_VERSION_CLASSFILE_MAJOR=68 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
DEFAULT_VERSION_CLASSFILE_MINOR=0
DEFAULT_VERSION_DOCS_API_SINCE=11
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="22 23"
DEFAULT_JDK_SOURCE_TARGET_VERSION=23
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="22 23 24"
DEFAULT_JDK_SOURCE_TARGET_VERSION=24
DEFAULT_PROMOTED_VERSION_PRE=ea
2 changes: 2 additions & 0 deletions src/hotspot/share/classfile/classFileParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@

#define JAVA_23_VERSION 67

#define JAVA_24_VERSION 68

void ClassFileParser::set_class_bad_constant_seen(short bad_constant) {
assert((bad_constant == JVM_CONSTANT_Module ||
bad_constant == JVM_CONSTANT_Package) && _major_version >= JAVA_9_VERSION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1481,6 +1481,12 @@ default List<VerifyError> verify(Path path) throws IOException {
*/
int JAVA_23_VERSION = 67;

/**
* The class major version of JAVA_24.
* @since 24
*/
int JAVA_24_VERSION = 68;

/**
* A minor version number indicating a class uses preview features
* of a Java SE version since 12, for major versions {@value
Expand All @@ -1492,7 +1498,7 @@ default List<VerifyError> verify(Path path) throws IOException {
* {@return the latest major Java version}
*/
static int latestMajorVersion() {
return JAVA_23_VERSION;
return JAVA_24_VERSION;
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -306,6 +306,18 @@ public enum ClassFileFormatVersion {
* <cite>The Java Virtual Machine Specification, Java SE 23 Edition</cite></a>
*/
RELEASE_23(67),

/**
* The version introduced by the Java Platform, Standard Edition
* 24.
*
* @since 24
*
* @see <a
* href="https://docs.oracle.com/javase/specs/jvms/se24/html/index.html">
* <cite>The Java Virtual Machine Specification, Java SE 24 Edition</cite></a>
*/
RELEASE_24(68),
; // Reduce code churn when appending new constants

// Note to maintainers: when adding constants for newer releases,
Expand All @@ -321,7 +333,7 @@ private ClassFileFormatVersion(int major) {
* {@return the latest class file format version}
*/
public static ClassFileFormatVersion latest() {
return RELEASE_23;
return RELEASE_24;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1736,7 +1736,7 @@ public Number parse(String text, ParsePosition pos) {
// If parse integer only is true and the parsing is broken at
// decimal point, then pass/ignore all digits and move pointer
// at the start of suffix, to process the suffix part
if (isParseIntegerOnly()
if (isParseIntegerOnly() && position < text.length()
&& text.charAt(position) == symbols.getDecimalSeparator()) {
position++; // Pass decimal character
for (; position < text.length(); ++position) {
Expand Down
31 changes: 1 addition & 30 deletions src/java.base/share/classes/java/util/zip/Deflater.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,36 +57,7 @@
* The following code fragment demonstrates a trivial compression
* and decompression of a string using {@code Deflater} and
* {@code Inflater}.
*
* <blockquote><pre>
* try {
* // Encode a String into bytes
* String inputString = "blahblahblah";
* byte[] input = inputString.getBytes("UTF-8");
*
* // Compress the bytes
* byte[] output = new byte[100];
* Deflater compresser = new Deflater();
* compresser.setInput(input);
* compresser.finish();
* int compressedDataLength = compresser.deflate(output);
* compresser.end();
*
* // Decompress the bytes
* Inflater decompresser = new Inflater();
* decompresser.setInput(output, 0, compressedDataLength);
* byte[] result = new byte[100];
* int resultLength = decompresser.inflate(result);
* decompresser.end();
*
* // Decode the bytes into a String
* String outputString = new String(result, 0, resultLength, "UTF-8");
* } catch (java.io.UnsupportedEncodingException ex) {
* // handle
* } catch (java.util.zip.DataFormatException ex) {
* // handle
* }
* </pre></blockquote>
* {@snippet id="compdecomp" lang="java" class="Snippets" region="DeflaterInflaterExample"}
*
* @apiNote
* To release resources used by this {@code Deflater}, the {@link #end()} method
Expand Down
30 changes: 1 addition & 29 deletions src/java.base/share/classes/java/util/zip/Inflater.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,35 +56,7 @@
* The following code fragment demonstrates a trivial compression
* and decompression of a string using {@code Deflater} and
* {@code Inflater}.
*
* <blockquote><pre>
* try {
* // Encode a String into bytes
* String inputString = "blahblahblah\u20AC\u20AC";
* byte[] input = inputString.getBytes("UTF-8");
*
* // Compress the bytes
* byte[] output = new byte[100];
* Deflater compresser = new Deflater();
* compresser.setInput(input);
* compresser.finish();
* int compressedDataLength = compresser.deflate(output);
*
* // Decompress the bytes
* Inflater decompresser = new Inflater();
* decompresser.setInput(output, 0, compressedDataLength);
* byte[] result = new byte[100];
* int resultLength = decompresser.inflate(result);
* decompresser.end();
*
* // Decode the bytes into a String
* String outputString = new String(result, 0, resultLength, "UTF-8");
* } catch (java.io.UnsupportedEncodingException ex) {
* // handle
* } catch (java.util.zip.DataFormatException ex) {
* // handle
* }
* </pre></blockquote>
* {@snippet id="compdecomp" lang="java" class="Snippets" region="DeflaterInflaterExample"}
*
* @apiNote
* To release resources used by this {@code Inflater}, the {@link #end()} method
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/*
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.util.zip;

import java.io.ByteArrayOutputStream;
import java.nio.charset.StandardCharsets;

class Snippets {

void deflaterInflaterExample() {
// @start region="DeflaterInflaterExample"

// Encode a String into bytes
String inputString = "blahblahblah\u20AC\u20AC";
byte[] input = inputString.getBytes(StandardCharsets.UTF_8);

// Compress the bytes
ByteArrayOutputStream compressedBaos = new ByteArrayOutputStream();
Deflater compressor = new Deflater();
try {
compressor.setInput(input);
// Let the compressor know that the complete input
// has been made available
compressor.finish();
// Keep compressing the input till the compressor
// is finished compressing
while (!compressor.finished()) {
// Use some reasonable size for the temporary buffer
// based on the data being compressed
byte[] tmpBuffer = new byte[100];
int numCompressed = compressor.deflate(tmpBuffer);
// Copy over the compressed bytes from the temporary
// buffer into the final byte array
compressedBaos.write(tmpBuffer, 0, numCompressed);
}
} finally {
// Release the resources held by the compressor
compressor.end();
}

// Decompress the bytes
Inflater decompressor = new Inflater();
ByteArrayOutputStream decompressedBaos = new ByteArrayOutputStream();
try {
byte[] compressed = compressedBaos.toByteArray();
decompressor.setInput(compressed, 0, compressed.length);
while (!decompressor.finished()) {
// Use some reasonable size for the temporary buffer,
// based on the data being decompressed; in this example,
// we use a small buffer size
byte[] tmpBuffer = new byte[100];
int numDecompressed = 0;
try {
numDecompressed = decompressor.inflate(tmpBuffer);
} catch (DataFormatException dfe) {
// Handle the exception suitably, in this example
// we just rethrow it
throw new RuntimeException(dfe);
}
// Copy over the decompressed bytes from the temporary
// buffer into the final byte array
decompressedBaos.write(tmpBuffer, 0, numDecompressed);
}
} finally {
// Release the resources held by the decompressor
decompressor.end();
}
// Decode the bytes into a String
String outputString = decompressedBaos.toString(StandardCharsets.UTF_8);

// @end
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public ClassReader(
this.b = classFileBuffer;
// Check the class' major_version. This field is after the magic and minor_version fields, which
// use 4 and 2 bytes respectively.
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V23) {
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V24) {
throw new IllegalArgumentException(
"Unsupported class file major version " + readShort(classFileOffset + 6));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ public interface Opcodes {
int V21 = 0 << 16 | 65;
int V22 = 0 << 16 | 66;
int V23 = 0 << 16 | 67;
int V24 = 0 << 16 | 68;

/**
* Version flag indicating that the class is using 'preview' features.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -427,6 +427,18 @@ public enum SourceVersion {
* <cite>The Java Language Specification, Java SE 23 Edition</cite></a>
*/
RELEASE_23,

/**
* The version introduced by the Java Platform, Standard Edition
* 24.
*
* @since 24
*
* @see <a
* href="https://docs.oracle.com/javase/specs/jls/se24/html/index.html">
* <cite>The Java Language Specification, Java SE 24 Edition</cite></a>
*/
RELEASE_24,
; // Reduce code churn when appending new constants

// Note that when adding constants for newer releases, the
Expand All @@ -436,7 +448,7 @@ public enum SourceVersion {
* {@return the latest source version that can be modeled}
*/
public static SourceVersion latest() {
return RELEASE_23;
return RELEASE_24;
}

private static final SourceVersion latestSupported = getLatestSupported();
Expand All @@ -451,7 +463,7 @@ public static SourceVersion latest() {
private static SourceVersion getLatestSupported() {
int intVersion = Runtime.version().feature();
return (intVersion >= 11) ?
valueOf("RELEASE_" + Math.min(23, intVersion)):
valueOf("RELEASE_" + Math.min(24, intVersion)):
RELEASE_10;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* @see AbstractAnnotationValueVisitor9
* @since 14
*/
@SupportedSourceVersion(RELEASE_23)
@SupportedSourceVersion(RELEASE_24)
public abstract class AbstractAnnotationValueVisitor14<R, P> extends AbstractAnnotationValueVisitor9<R, P> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
* @see AbstractAnnotationValueVisitor14
* @since 23
*/
@SupportedSourceVersion(RELEASE_23)
@SupportedSourceVersion(RELEASE_24)
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
public abstract class AbstractAnnotationValueVisitorPreview<R, P> extends AbstractAnnotationValueVisitor14<R, P> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* @see AbstractElementVisitor9
* @since 16
*/
@SupportedSourceVersion(RELEASE_23)
@SupportedSourceVersion(RELEASE_24)
public abstract class AbstractElementVisitor14<R, P> extends AbstractElementVisitor9<R, P> {
/**
* Constructor for concrete subclasses to call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
* @see AbstractElementVisitor14
* @since 23
*/
@SupportedSourceVersion(RELEASE_23)
@SupportedSourceVersion(RELEASE_24)
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
public abstract class AbstractElementVisitorPreview<R, P> extends AbstractElementVisitor14<R, P> {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* @see AbstractTypeVisitor9
* @since 14
*/
@SupportedSourceVersion(RELEASE_23)
@SupportedSourceVersion(RELEASE_24)
public abstract class AbstractTypeVisitor14<R, P> extends AbstractTypeVisitor9<R, P> {
/**
* Constructor for concrete subclasses to call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
* @see AbstractTypeVisitor14
* @since 23
*/
@SupportedSourceVersion(RELEASE_23)
@SupportedSourceVersion(RELEASE_24)
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
public abstract class AbstractTypeVisitorPreview<R, P> extends AbstractTypeVisitor14<R, P> {
/**
Expand Down
Loading

0 comments on commit e41e8e5

Please sign in to comment.