Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions make/autoconf/basic_tools.m4
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ AC_DEFUN([BASIC_CHECK_MAKE_VERSION],
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
MAKE_EXPECTED_ENV='cygwin'
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys2"; then
MAKE_EXPECTED_ENV='msys'
MAKE_EXPECTED_ENV='cygwin|msys'
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl1" || test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl2"; then
if test "x$OPENJDK_BUILD_CPU" = "xaarch64"; then
MAKE_EXPECTED_ENV='aarch64-.*-linux-gnu'
Expand All @@ -159,7 +159,7 @@ AC_DEFUN([BASIC_CHECK_MAKE_VERSION],
AC_MSG_ERROR([Unknown Windows environment])
fi
MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'`
IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV`
IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP -E $MAKE_EXPECTED_ENV`
else
# Not relevant for non-Windows
IS_MAKE_CORRECT_ENV=true
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/z/zRelocate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ class ZRelocateWork : public StackObj {
const zaddress to_addr = _forwarding->insert(from_addr, allocated_addr, &cursor);
if (to_addr != allocated_addr) {
// Already relocated, undo allocation
_allocator->undo_alloc_object(to_page, allocated_addr, size);
_allocator->undo_alloc_object(to_page, to_addr, size);
increase_other_forwarded(size);
}

Expand Down
8 changes: 5 additions & 3 deletions src/hotspot/share/opto/ifnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,9 +669,11 @@ const TypeInt* IfNode::filtered_int_type(PhaseGVN* gvn, Node* val, Node* if_proj
BoolNode* bol = iff->in(1)->as_Bool();
if (bol->in(1) && bol->in(1)->is_Cmp()) {
const CmpNode* cmp = bol->in(1)->as_Cmp();
// Val is always the lhs of the comparision: val <test> cmp2
if (cmp->in(1) == val) {
assert(cmp->Opcode() == Op_CmpI, "signed comparison required");
// Val is always the lhs of the comparision: val CmpI cmp2
if (cmp->Opcode() == Op_CmpI && cmp->in(1) == val) {
// Only CmpI allowed, assumed by signed logic below.
// We could extend to CmpU in the future, and would
// have to implement unsigned range logic below.
const TypeInt* cmp2_t = gvn->type(cmp->in(2))->isa_int();
if (cmp2_t != nullptr) {
jint lo = cmp2_t->_lo;
Expand Down
11 changes: 10 additions & 1 deletion src/hotspot/share/opto/loopnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3892,7 +3892,16 @@ const TypeInt* CountedLoopConverter::filtered_type_from_dominators(Node* val, No
if (rtn_t == nullptr) {
rtn_t = if_t;
} else {
rtn_t = rtn_t->join(if_t)->is_int();
const Type* join_t = rtn_t->join(if_t);
if (!join_t->isa_int()) {
// We may have encountered multiple if conditions, that have no
// overlap, and produce an empty/top type. Returning nullptr
// is conservative, it means we do not constrain the type, which
// will just prevent further optimiziations.
assert(join_t->empty(), "top");
return nullptr;
}
rtn_t = join_t->is_int();
}
}
}
Expand Down
34 changes: 27 additions & 7 deletions src/java.base/share/classes/java/security/BinaryEncodable.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,35 @@
import java.security.spec.X509EncodedKeySpec;

import jdk.internal.javac.PreviewFeature;
import sun.security.internal.InternalBinaryEncodable;


/**
* This interface is implemented by security API classes that contain
* binary-encodable cryptographic material.
* This interface identifies the cryptographic objects that can be converted
* to and from binary data, and thereby encoded and decoded as PEM text.
*
* <p> The APIs for cryptographic objects such as public keys, private keys,
* certificates, and certificate revocation lists all provide the means to
* convert their instances to and from standardized binary representations.
* Other kinds of cryptographic objects, such as certificate requests, have
* no corresponding API but can still be expressed as standardized binary
* representations. The {@code BinaryEncodable} interface allows the
* {@link PEMEncoder} and {@link PEMDecoder} classes to operate uniformly on
* binary representations of key or certificate material.
*
* <p> The permitted subtype {@code PEM} is notable for supporting the encoding
* and decoding of PEM text that represents cryptographic objects for which no
* API exists. In future releases, other permitted subtypes may be added to
* support the encoding and decoding of such cryptographic objects.
*
* <p> This sealed interface may evolve. When using {@code switch}, always include a
* {@code default} case rather than relying on the classes specified in the
* {@code permits} clause to remain fixed. An exhaustive {@code switch} may
* result in a {@link MatchException}.
* <p> The list of permitted subtypes shown after {@code permits} is not
* exhaustive. This means if application code switches over a
* {@code BinaryEncodable} value, the {@code switch} cannot be made exhaustive
* simply by providing a {@code case} label for every permitted subtype shown
* in the list; there also must be a {@code default} or
* {@code case BinaryEncodable} label to handle additional subtypes. This
* allows the list of permitted subtypes to change over time without causing
* pre-existing switches to fail because of an unrecognized subtype.
*
* @see AsymmetricKey
* @see KeyPair
Expand All @@ -57,5 +77,5 @@
@PreviewFeature(feature = PreviewFeature.Feature.PEM_API)
public sealed interface BinaryEncodable permits AsymmetricKey, KeyPair,
PKCS8EncodedKeySpec, X509EncodedKeySpec, EncryptedPrivateKeyInfo,
X509Certificate, X509CRL, PEM {
X509Certificate, X509CRL, PEM, InternalBinaryEncodable {
}
25 changes: 14 additions & 11 deletions src/java.base/share/classes/java/security/PEMDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
* PEM is a textual encoding used to store and transfer cryptographic
* objects, such as asymmetric keys, certificates, and certificate revocation
* lists (CRLs). It is defined in RFC 1421 and RFC 7468. PEM consists of
* Base64-encoded content enclosed by a type-identifying header
* and footer.
* Base64-encoded content enclosed by a header and footer that identify the
* type of the content.
*
* <p>The {@link #decode(String)} and {@link #decode(InputStream)} methods
* <p> The {@link #decode(String)} and {@link #decode(InputStream)} methods
* return an instance of a class that matches the PEM type and implements
* {@link BinaryEncodable}, as follows:
* <ul>
Expand All @@ -70,11 +70,18 @@
* </ul>
*
* <p> If the PEM type has no corresponding class, {@code decode(String)} and
* {@code decode(InputStream)} will return a {@code PEM} object.
* {@code decode(InputStream)} return a {@code PEM} object.
*
* <p> If application code switches over the {@code BinaryEncodable} result of
* {@link #decode(String)} or {@link #decode(InputStream)}, the {@code switch} cannot
* be made exhaustive simply by providing a {@code case} label for every permitted
* subtype listed for {@code BinaryEncodable}; there also must be a {@code default}
* or {@code case BinaryEncodable} label to handle additional subtypes that
* might be added in the future.
*
* <p> The {@link #decode(String, Class)} and {@link #decode(InputStream, Class)}
* methods accept a class parameter specifying the desired {@code BinaryEncodable}
* type. These methods avoid the need for casting and are useful when multiple
* methods accept a parameter specifying the desired {@code BinaryEncodable}
* result. These methods avoid the need for casting and are useful when multiple
* representations are possible. For example, if the PEM contains both public and
* private keys, specifying {@code PrivateKey.class} returns only the private key.
* If {@code X509EncodedKeySpec.class} is provided, the public key encoding is
Expand Down Expand Up @@ -109,11 +116,6 @@
* for decryption, an {@link EncryptedPrivateKeyInfo} is returned.
* A {@code PEMDecoder} configured for decryption can also decode unencrypted PEM.
*
* <p> The {@code BinaryEncodable} interface may evolve. When using a decode method
* with {@code switch}, always include a {@code default} case rather than
* relying on the classes specified in the permits clause to remain fixed.
* An exhaustive {@code switch} may result in a {@link MatchException}.
*
* <p> This class is immutable and thread-safe.
*
* <p> Example: decode a private key:
Expand All @@ -136,6 +138,7 @@
* @see PEMEncoder
* @see PEM
* @see EncryptedPrivateKeyInfo
* @see BinaryEncodable
*
* @spec https://www.rfc-editor.org/info/rfc1421
* RFC 1421: Privacy Enhancement for Internet Electronic Mail
Expand Down
6 changes: 3 additions & 3 deletions src/java.base/share/classes/java/time/temporal/Temporal.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2026, 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 @@ -392,8 +392,8 @@ default Temporal minus(long amountToSubtract, TemporalUnit unit) {
* The second is to use {@link TemporalUnit#between(Temporal, Temporal)}:
* <pre>
* // these two lines are equivalent
* temporal = start.until(end, unit);
* temporal = unit.between(start, end);
* amount = start.until(end, unit);
* amount = unit.between(start, end);
* </pre>
* The choice should be made based on which makes the code more readable.
* <p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2026, 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 @@ -145,9 +145,9 @@ public interface TemporalAmount {
* <pre>
* // These two lines are equivalent, but the second approach is recommended
* dateTime = amount.addTo(dateTime);
* dateTime = dateTime.plus(adder);
* dateTime = dateTime.plus(amount);
* </pre>
* It is recommended to use the second approach, {@code plus(TemporalAmount)},
* It is recommended to use the second approach, {@code plus(amount)},
* as it is a lot clearer to read in code.
*
* @implSpec
Expand Down Expand Up @@ -189,7 +189,7 @@ public interface TemporalAmount {
* dateTime = amount.subtractFrom(dateTime);
* dateTime = dateTime.minus(amount);
* </pre>
* It is recommended to use the second approach, {@code minus(TemporalAmount)},
* It is recommended to use the second approach, {@code minus(amount)},
* as it is a lot clearer to read in code.
*
* @implSpec
Expand Down
26 changes: 13 additions & 13 deletions src/java.base/share/classes/java/time/temporal/TemporalField.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2026, 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 @@ -186,10 +186,10 @@ default String getDisplayName(Locale locale) {
* The second is to use {@link TemporalAccessor#isSupported(TemporalField)}:
* <pre>
* // these two lines are equivalent, but the second approach is recommended
* temporal = thisField.isSupportedBy(temporal);
* temporal = temporal.isSupported(thisField);
* supported = thisField.isSupportedBy(temporal);
* supported = temporal.isSupported(thisField);
* </pre>
* It is recommended to use the second approach, {@code isSupported(TemporalField)},
* It is recommended to use the second approach, {@code isSupported(thisField)},
* as it is a lot clearer to read in code.
* <p>
* Implementations should determine whether they are supported using the fields
Expand All @@ -216,10 +216,10 @@ default String getDisplayName(Locale locale) {
* The second is to use {@link TemporalAccessor#range(TemporalField)}:
* <pre>
* // these two lines are equivalent, but the second approach is recommended
* temporal = thisField.rangeRefinedBy(temporal);
* temporal = temporal.range(thisField);
* range = thisField.rangeRefinedBy(temporal);
* range = temporal.range(thisField);
* </pre>
* It is recommended to use the second approach, {@code range(TemporalField)},
* It is recommended to use the second approach, {@code range(thisField)},
* as it is a lot clearer to read in code.
* <p>
* Implementations should perform any queries or calculations using the fields
Expand All @@ -244,10 +244,10 @@ default String getDisplayName(Locale locale) {
* (or {@link TemporalAccessor#get(TemporalField)}):
* <pre>
* // these two lines are equivalent, but the second approach is recommended
* temporal = thisField.getFrom(temporal);
* temporal = temporal.getLong(thisField);
* value = thisField.getFrom(temporal);
* value = temporal.getLong(thisField);
* </pre>
* It is recommended to use the second approach, {@code getLong(TemporalField)},
* It is recommended to use the second approach, {@code getLong(thisField)},
* as it is a lot clearer to read in code.
* <p>
* Implementations should perform any queries or calculations using the fields
Expand Down Expand Up @@ -281,10 +281,10 @@ default String getDisplayName(Locale locale) {
* The second is to use {@link Temporal#with(TemporalField, long)}:
* <pre>
* // these two lines are equivalent, but the second approach is recommended
* temporal = thisField.adjustInto(temporal);
* temporal = temporal.with(thisField);
* temporal = thisField.adjustInto(temporal, newValue);
* temporal = temporal.with(thisField, newValue);
* </pre>
* It is recommended to use the second approach, {@code with(TemporalField)},
* It is recommended to use the second approach, {@code with(thisField, newValue)},
* as it is a lot clearer to read in code.
* <p>
* Implementations should perform any queries or calculations using the fields
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2026, 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 @@ -94,10 +94,10 @@
* The second is to use {@link TemporalAccessor#query(TemporalQuery)}:
* <pre>
* // these two lines are equivalent, but the second approach is recommended
* temporal = thisQuery.queryFrom(temporal);
* temporal = temporal.query(thisQuery);
* result = thisQuery.queryFrom(temporal);
* result = temporal.query(thisQuery);
* </pre>
* It is recommended to use the second approach, {@code query(TemporalQuery)},
* It is recommended to use the second approach, {@code query(thisQuery)},
* as it is a lot clearer to read in code.
* <p>
* The most common implementations are method references, such as
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2026, 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 @@ -81,10 +81,10 @@
* The second is to use {@link TemporalAccessor#query(TemporalQuery)}:
* <pre>
* // these two lines are equivalent, but the second approach is recommended
* temporal = thisQuery.queryFrom(temporal);
* temporal = temporal.query(thisQuery);
* result = thisQuery.queryFrom(temporal);
* result = temporal.query(thisQuery);
* </pre>
* It is recommended to use the second approach, {@code query(TemporalQuery)},
* It is recommended to use the second approach, {@code query(thisQuery)},
* as it is a lot clearer to read in code.
* <p>
* The most common implementations are method references, such as
Expand Down Expand Up @@ -115,10 +115,10 @@ public interface TemporalQuery<R> {
* The second is to use {@link TemporalAccessor#query(TemporalQuery)}:
* <pre>
* // these two lines are equivalent, but the second approach is recommended
* temporal = thisQuery.queryFrom(temporal);
* temporal = temporal.query(thisQuery);
* result = thisQuery.queryFrom(temporal);
* result = temporal.query(thisQuery);
* </pre>
* It is recommended to use the second approach, {@code query(TemporalQuery)},
* It is recommended to use the second approach, {@code query(thisQuery)},
* as it is a lot clearer to read in code.
*
* @implSpec
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2026, 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 @@ -203,10 +203,10 @@ default boolean isSupportedBy(Temporal temporal) {
* The second is to use {@link Temporal#plus(long, TemporalUnit)}:
* <pre>
* // these two lines are equivalent, but the second approach is recommended
* temporal = thisUnit.addTo(temporal);
* temporal = temporal.plus(thisUnit);
* temporal = thisUnit.addTo(temporal, amount);
* temporal = temporal.plus(amount, thisUnit);
* </pre>
* It is recommended to use the second approach, {@code plus(TemporalUnit)},
* It is recommended to use the second approach, {@code plus(amount, thisUnit)},
* as it is a lot clearer to read in code.
* <p>
* Implementations should perform any queries or calculations using the units
Expand Down
16 changes: 6 additions & 10 deletions src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -418,19 +418,15 @@ else if (((a = aux) == null || a.ex == null) &&
for (;;) {
if ((s = status) < 0)
break;
else if (interrupts < 0) {
s = ABNORMAL; // interrupted and not done
break;
}
else if (Thread.interrupted()) {
if (!ForkJoinPool.poolIsStopping(pool))
interrupts = interruptible ? -1 : 1;
else {
interrupts = 1; // re-assert if cleared
if (ForkJoinPool.poolIsStopping(pool)) {
try {
cancel(true);
} catch (Throwable ignore) {
}
} catch (Throwable ignore) { }
}
if ((interrupts = interruptible ? -1 : 1) < 0) {
s = ABNORMAL;
break;
}
}
else if (deadline != 0L) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2026, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, Alibaba Group Holding Limited. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -1110,6 +1110,9 @@ void setLocalsFromArg(String name, MethodTypeDesc methodDesc, boolean isStatic,
locals[localsSize++] = type;
}
}
if (locals != null && localsSize < locals.length) {
Arrays.fill(locals, localsSize, locals.length, Type.TOP_TYPE);
}
this.localsSize = localsSize;
}

Expand Down
Loading
Loading