From 7b3c2dc5f45afc3646ff5cdc0f6efd68e0b70ea5 Mon Sep 17 00:00:00 2001 From: Pavel Rappo Date: Tue, 4 Jul 2023 19:03:09 +0000 Subject: [PATCH] 8311122: Fix typos in java.base Reviewed-by: darcy, naoto, mchung, iris, mli, mullan --- src/java.base/share/classes/java/lang/FdLibm.java | 10 +++++----- src/java.base/share/classes/java/lang/Float.java | 2 +- src/java.base/share/classes/java/lang/ScopedValue.java | 2 +- .../java/lang/invoke/GenerateJLIClassesHelper.java | 4 ++-- .../share/classes/java/lang/invoke/LambdaForm.java | 2 +- .../classes/java/lang/invoke/MethodHandleImpl.java | 4 ++-- .../share/classes/java/lang/invoke/MethodHandles.java | 2 +- .../java/lang/reflect/ClassFileFormatVersion.java | 2 +- .../share/classes/java/lang/reflect/Proxy.java | 2 +- src/java.base/share/classes/java/text/DigitList.java | 4 ++-- .../sun/security/provider/certpath/ResponderId.java | 4 ++-- .../share/classes/sun/security/util/ByteArrays.java | 4 ++-- .../share/classes/sun/text/CompactByteArray.java | 4 ++-- 13 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/java.base/share/classes/java/lang/FdLibm.java b/src/java.base/share/classes/java/lang/FdLibm.java index e435bb382b9..dd79ee82863 100644 --- a/src/java.base/share/classes/java/lang/FdLibm.java +++ b/src/java.base/share/classes/java/lang/FdLibm.java @@ -1696,7 +1696,7 @@ final class FdLibm { * This formula has one division fewer than the one above; however, * it requires more multiplications and additions. Also x must be * scaled in advance to avoid spurious overflow in evaluating the - * expression 3y*y+x. Hence it is not recommended uless division + * expression 3y*y+x. Hence it is not recommended unless division * is slow. If division is very slow, then one should use the * reciproot algorithm given in section B. * @@ -3156,7 +3156,7 @@ final class FdLibm { return h*StrictMath.exp(Math.abs(x)); } - // |x| in [log(maxdouble), overflowthresold] + // |x| in [log(maxdouble), overflowthreshold] lx = __LO(x); if (ix < 0x4086_33CE || ((ix == 0x4086_33ce) && @@ -3166,7 +3166,7 @@ final class FdLibm { return t * w; } - // |x| > overflowthresold, sinh(x) overflow + // |x| > overflowthreshold, sinh(x) overflow return x * shuge; } } @@ -3231,7 +3231,7 @@ final class FdLibm { return 0.5*StrictMath.exp(Math.abs(x)); } - // |x| in [log(maxdouble), overflowthresold] + // |x| in [log(maxdouble), overflowthreshold] lx = __LO(x); if (ix<0x4086_33CE || ((ix == 0x4086_33ce) && @@ -3241,7 +3241,7 @@ final class FdLibm { return t*w; } - // |x| > overflowthresold, cosh(x) overflow + // |x| > overflowthreshold, cosh(x) overflow return huge*huge; } } diff --git a/src/java.base/share/classes/java/lang/Float.java b/src/java.base/share/classes/java/lang/Float.java index b4e212434ae..7eb7cc58771 100644 --- a/src/java.base/share/classes/java/lang/Float.java +++ b/src/java.base/share/classes/java/lang/Float.java @@ -1162,7 +1162,7 @@ public final class Float extends Number } // No bits set in significand beyond the *first* exponent bit, - // not just the sigificand; quantity is added to the exponent + // not just the significand; quantity is added to the exponent // to implement a carry out from rounding the significand. assert (0xf800 & signif_bits) == 0x0; diff --git a/src/java.base/share/classes/java/lang/ScopedValue.java b/src/java.base/share/classes/java/lang/ScopedValue.java index 58083b9680c..9aab6669a7c 100644 --- a/src/java.base/share/classes/java/lang/ScopedValue.java +++ b/src/java.base/share/classes/java/lang/ScopedValue.java @@ -531,7 +531,7 @@ public final class ScopedValue { /** * Creates a new {@code Carrier} with a single mapping of a {@code ScopedValue} - * key to a value. The {@code Carrier} can be used to accumlate mappings so + * key to a value. The {@code Carrier} can be used to accumulate mappings so * that an operation can be executed with all scoped values in the mapping bound to * values. The following example runs an operation with {@code k1} bound (or rebound) * to {@code v1}, and {@code k2} bound (or rebound) to {@code v2}. diff --git a/src/java.base/share/classes/java/lang/invoke/GenerateJLIClassesHelper.java b/src/java.base/share/classes/java/lang/invoke/GenerateJLIClassesHelper.java index 297f55dd2bf..ca652d8d29d 100644 --- a/src/java.base/share/classes/java/lang/invoke/GenerateJLIClassesHelper.java +++ b/src/java.base/share/classes/java/lang/invoke/GenerateJLIClassesHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -48,7 +48,7 @@ import static java.lang.invoke.LambdaForm.Kind.*; * generate classes ahead of time. */ class GenerateJLIClassesHelper { - // Map from DirectMethodHandle method type name to index to LambdForms + // Map from DirectMethodHandle method type name to index to LambdaForms static final Map DMH_METHOD_TYPE_MAP = Map.of( DIRECT_INVOKE_VIRTUAL.methodName, LF_INVVIRTUAL, diff --git a/src/java.base/share/classes/java/lang/invoke/LambdaForm.java b/src/java.base/share/classes/java/lang/invoke/LambdaForm.java index 66e8f548be4..8b75d7510fe 100644 --- a/src/java.base/share/classes/java/lang/invoke/LambdaForm.java +++ b/src/java.base/share/classes/java/lang/invoke/LambdaForm.java @@ -332,7 +332,7 @@ class LambdaForm { this.isCompiled = false; } - // root factory pre/post processing and calls simple cosntructor + // root factory pre/post processing and calls simple constructor private static LambdaForm create(int arity, Name[] names, int result, boolean forceInline, MethodHandle customized, Kind kind) { names = names.clone(); assert(namesOK(arity, names)); diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java b/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java index 346859c7e4d..add74c48996 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java @@ -1124,7 +1124,7 @@ abstract class MethodHandleImpl { * Method::invoke on a caller-sensitive method will call * MethodAccessorImpl::invoke(Object, Object[]) through reflect_invoke_V * target.csm(args) - * NativeMethodAccesssorImpl::invoke(target, args) + * NativeMethodAccessorImpl::invoke(target, args) * MethodAccessImpl::invoke(target, args) * InjectedInvoker::reflect_invoke_V(vamh, target, args); * method::invoke(target, args) @@ -1683,7 +1683,7 @@ abstract class MethodHandleImpl { * @param tloop the return type of the loop. * @param targs types of the arguments to be passed to the loop. * @param init sanitized array of initializers for loop-local variables. - * @param step sanitited array of loop bodies. + * @param step sanitized array of loop bodies. * @param pred sanitized array of predicates. * @param fini sanitized array of loop finalizers. * diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java index 69c27583290..ee3da58e2dd 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java @@ -3843,7 +3843,7 @@ return mh1; /** * Perform steps 1 and 2b access checks - * for ensureInitialzed, findClass or accessClass. + * for ensureInitialized, findClass or accessClass. */ void checkSecurityManager(Class refc) { if (allowedModes == TRUSTED) return; diff --git a/src/java.base/share/classes/java/lang/reflect/ClassFileFormatVersion.java b/src/java.base/share/classes/java/lang/reflect/ClassFileFormatVersion.java index eba662dec34..ae1c48226ef 100644 --- a/src/java.base/share/classes/java/lang/reflect/ClassFileFormatVersion.java +++ b/src/java.base/share/classes/java/lang/reflect/ClassFileFormatVersion.java @@ -383,7 +383,7 @@ public enum ClassFileFormatVersion { public static ClassFileFormatVersion fromMajor(int major) { if (major < 45 // RELEASE_0.major() || major > latest().major()) { - throw new IllegalArgumentException("Out of range major class file vesion " + throw new IllegalArgumentException("Out of range major class file version " + major); } // RELEASE_0 and RELEASE_1 both have a major version of 45; diff --git a/src/java.base/share/classes/java/lang/reflect/Proxy.java b/src/java.base/share/classes/java/lang/reflect/Proxy.java index 209a0392235..a638c6ef537 100644 --- a/src/java.base/share/classes/java/lang/reflect/Proxy.java +++ b/src/java.base/share/classes/java/lang/reflect/Proxy.java @@ -1268,7 +1268,7 @@ public class Proxy implements java.io.Serializable { // the method's declaring class is left unvisited. continue; } - // visit all superinteraces of one proxy interface to find if + // visit all superinterfaces of one proxy interface to find if // this proxy interface inherits the method directly or indirectly visited.add(c); for (Class superIntf : c.getInterfaces()) { diff --git a/src/java.base/share/classes/java/text/DigitList.java b/src/java.base/share/classes/java/text/DigitList.java index eed257e5ec6..e574cafe0a6 100644 --- a/src/java.base/share/classes/java/text/DigitList.java +++ b/src/java.base/share/classes/java/text/DigitList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2023, 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 @@ -92,7 +92,7 @@ final class DigitList implements Cloneable { * f is a value 0.1 <= f < 1 arrived at by placing the digits in Digits to * the right of the decimal. * - * DigitList is normalized, so if it is non-zero, figits[0] is non-zero. We + * DigitList is normalized, so if it is non-zero, digits[0] is non-zero. We * don't allow denormalized numbers because our exponent is effectively of * unlimited magnitude. The count value contains the number of significant * digits present in digits[]. diff --git a/src/java.base/share/classes/sun/security/provider/certpath/ResponderId.java b/src/java.base/share/classes/sun/security/provider/certpath/ResponderId.java index 3c2323f6c28..09c9dc7d3c9 100644 --- a/src/java.base/share/classes/sun/security/provider/certpath/ResponderId.java +++ b/src/java.base/share/classes/sun/security/provider/certpath/ResponderId.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ -222,7 +222,7 @@ public final class ResponderId { * * @param obj the object to be compared against * - * @return true if the specified object is equal to this {@code Responderid} + * @return true if the specified object is equal to this {@code ResponderId} */ @Override public boolean equals(Object obj) { diff --git a/src/java.base/share/classes/sun/security/util/ByteArrays.java b/src/java.base/share/classes/sun/security/util/ByteArrays.java index 1457489f4bf..f0822ff4633 100644 --- a/src/java.base/share/classes/sun/security/util/ByteArrays.java +++ b/src/java.base/share/classes/sun/security/util/ByteArrays.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -26,7 +26,7 @@ package sun.security.util; /** - * A time-instance comparison of two byte arrays. + * A time-constant comparison of two byte arrays. */ public class ByteArrays { // See the MessageDigest.isEqual(byte[] digesta, byte[] digestb) diff --git a/src/java.base/share/classes/sun/text/CompactByteArray.java b/src/java.base/share/classes/sun/text/CompactByteArray.java index ea71c46198c..b4aa0237d16 100644 --- a/src/java.base/share/classes/sun/text/CompactByteArray.java +++ b/src/java.base/share/classes/sun/text/CompactByteArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2023, 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 @@ -293,7 +293,7 @@ public final class CompactByteArray implements Cloneable { if (elementAt((char)i) != other.elementAt((char)i)) return false; } - return true; // we made it through the guantlet. + return true; // we made it through the gauntlet. } /**