Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8274075: Fix miscellaneous typos in java.base #5610

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -899,7 +899,7 @@ public void println() {
}

/**
* Prints a boolean and then terminate the line. This method behaves as
* Prints a boolean and then terminates the line. This method behaves as
* though it invokes {@link #print(boolean)} and then
* {@link #println()}.
*
@@ -917,7 +917,7 @@ public void println(boolean x) {
}

/**
* Prints a character and then terminate the line. This method behaves as
* Prints a character and then terminates the line. This method behaves as
* though it invokes {@link #print(char)} and then
* {@link #println()}.
*
@@ -935,7 +935,7 @@ public void println(char x) {
}

/**
* Prints an integer and then terminate the line. This method behaves as
* Prints an integer and then terminates the line. This method behaves as
* though it invokes {@link #print(int)} and then
* {@link #println()}.
*
@@ -953,7 +953,7 @@ public void println(int x) {
}

/**
* Prints a long and then terminate the line. This method behaves as
* Prints a long and then terminates the line. This method behaves as
* though it invokes {@link #print(long)} and then
* {@link #println()}.
*
@@ -971,7 +971,7 @@ public void println(long x) {
}

/**
* Prints a float and then terminate the line. This method behaves as
* Prints a float and then terminates the line. This method behaves as
* though it invokes {@link #print(float)} and then
* {@link #println()}.
*
@@ -989,7 +989,7 @@ public void println(float x) {
}

/**
* Prints a double and then terminate the line. This method behaves as
* Prints a double and then terminates the line. This method behaves as
* though it invokes {@link #print(double)} and then
* {@link #println()}.
*
@@ -1007,7 +1007,7 @@ public void println(double x) {
}

/**
* Prints an array of characters and then terminate the line. This method
* Prints an array of characters and then terminates the line. This method
* behaves as though it invokes {@link #print(char[])} and
* then {@link #println()}.
*
@@ -1025,7 +1025,7 @@ public void println(char[] x) {
}

/**
* Prints a String and then terminate the line. This method behaves as
* Prints a String and then terminates the line. This method behaves as
* though it invokes {@link #print(String)} and then
* {@link #println()}.
*
@@ -1043,7 +1043,7 @@ public void println(String x) {
}

/**
* Prints an Object and then terminate the line. This method calls
* Prints an Object and then terminates the line. This method calls
* at first String.valueOf(x) to get the printed object's string value,
* then behaves as
* though it invokes {@link #print(String)} and then
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2021, 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
@@ -30,7 +30,7 @@
* write operation. Thrown during a read operation when one of the
* ObjectStreamExceptions was thrown during a write operation. The
* exception that terminated the write can be found in the detail
* field. The stream is reset to it's initial state and all references
* field. The stream is reset to its initial state and all references
* to objects already deserialized are discarded.
*
* @since 1.1
@@ -65,7 +65,7 @@
* it is generally unrelated to the abstraction provided by the upper layer.
* Further, doing so would tie the API of the upper layer to the details of
* its implementation, assuming the lower layer's exception was a checked
* exception. Throwing a "wrapped exception" (i.e., an exception containing a
* exception. Throwing a "wrapping exception" (i.e., an exception containing a
Copy link
Member

@bplb bplb Sep 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure that this should be "wrapping" and not "wrapped?" See also for example java.security.cert.CertPathValidatorException.

Copy link
Contributor

@LanceAndersen LanceAndersen Sep 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does seem a bit strange to say "Throwing a wrapping...."

Copy link
Member Author

@pavelrappo pavelrappo Sep 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have two exceptions A and B, such that B is the cause of A, then A is the wrapping exception (the one that wraps or the wrapper) and B is the wrapped exception (the one that is being wrapped or the wrappee).

I noticed that the sentence was conflicting: it started with the "wrapped" exception, but then in the "i.e." commentary in parentheses proceeded with the wrappee exception. To resolve that conflict, I proposed to rephrase the first part of that sentence. FWIW, my original suggestion elsewhere was to use "wrapper".

Copy link
Member

@bplb bplb Sep 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Subjectively, "wrapping exception" would seem to be an exception in the process of wrapping something.

Copy link
Member Author

@pavelrappo pavelrappo Sep 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would "wrappER" be better?

Copy link
Member Author

@pavelrappo pavelrappo Sep 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can either revert this part of the change or rephrase it. Mind you, rephrasing might prove tricky because of non-local changes it might introduce. There's one more occurrence of "wrapped exception" in this file:

* Note the presence of lines containing the characters {@code "..."}.
* These lines indicate that the remainder of the stack trace for this
* exception matches the indicated number of frames from the bottom of the
* stack trace of the exception that was caused by this exception (the
* "enclosing" exception). This shorthand can greatly reduce the length
* of the output in the common case where a wrapped exception is thrown
* from same method as the "causative exception" is caught. The above

Copy link
Member

@bplb bplb Sep 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of "common case where a wrapped exception is thrown from same method" could one write "common case where an enclosing exception is thrown from the same method"?

Copy link
Member

@dholmes-ora dholmes-ora Sep 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we don't throw the "wrapped exception" we throw the exception that wraps it. The "wrapped exception" is the original cause. The wording as presented now is correct in that regard. You could also say "Throwing a wrapper exception (i.e. one that has a cause)" - I think both are grammatically correct.

The later text "where a wrapped exception is thrown from the same method" is again incorrect because the wrapped exception (the cause) is not what gets thrown. But I find that whole sentence rather jarring anyway - I'm not certain exactly what it means.

Copy link
Member Author

@pavelrappo pavelrappo Sep 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm inclined to revert this change on Throwable.java:68, because of the lack of consensus. It clearly is not a simple typo.

Copy link
Member Author

@pavelrappo pavelrappo Sep 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted in 57b71c5.

* cause) allows the upper layer to communicate the details of the failure to
* its caller without incurring either of these shortcomings. It preserves
* the flexibility to change the implementation of the upper layer without
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2021, 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
@@ -55,7 +55,7 @@ private static native Class<?> findFromArchive(Class<?> caller,
/**
* Registers the lambdaProxyClass into CDS archive.
* The VM will store the lambdaProxyClass into a hash table
* using the first six argumennts as the key.
* using the first six arguments as the key.
*
* CDS only archives lambda proxy class if it's not serializable
* and no marker interfaces and no additional bridges, and if it is
@@ -4421,7 +4421,7 @@ public static VarHandle arrayElementVarHandle(Class<?> arrayClass) throws Illega
* <p>
* Misaligned access, and therefore atomicity guarantees, may be determined
* for {@code byte[]} arrays without operating on a specific array. Given
* an {@code index}, {@code T} and it's corresponding boxed type,
* an {@code index}, {@code T} and its corresponding boxed type,
* {@code T_BOX}, misalignment may be determined as follows:
* <pre>{@code
* int sizeOfT = T_BOX.BYTES; // size in bytes of T
@@ -4508,7 +4508,7 @@ public static VarHandle byteArrayViewVarHandle(Class<?> viewArrayClass,
* <p>
* Misaligned access, and therefore atomicity guarantees, may be determined
* for a {@code ByteBuffer}, {@code bb} (direct or otherwise), an
* {@code index}, {@code T} and it's corresponding boxed type,
* {@code index}, {@code T} and its corresponding boxed type,
* {@code T_BOX}, as follows:
* <pre>{@code
* int sizeOfT = T_BOX.BYTES; // size in bytes of T
@@ -53,13 +53,13 @@
*
* <p>
* When the root spliterator is first split a mapped byte buffer will be created
* over the file for it's size that was observed when the stream was created.
* over the file for its size that was observed when the stream was created.
* Thus a mapped byte buffer is only required for parallel stream execution.
* Sub-spliterators will share that mapped byte buffer. Splitting will use the
* mapped byte buffer to find the closest line feed characters(s) to the left or
* right of the mid-point of covered range of bytes of the file. If a line feed
* is found then the spliterator is split with returned spliterator containing
* the identified line feed characters(s) at the end of it's covered range of
* the identified line feed characters(s) at the end of its covered range of
* bytes.
*
* <p>
@@ -809,7 +809,7 @@ public static void setProperty(String key, String datum) {
* setProperty() was either "package.access" or
* "package.definition", we need to signal to the SecurityManager
* class that the value has just changed, and that it should
* invalidate it's local cache values.
* invalidate its local cache values.
*/
private static void invalidateSMCache(String key) {

@@ -581,8 +581,8 @@ final <P_IN> Node<E_OUT> evaluate(Spliterator<P_IN> spliterator,

/**
* Get the output shape of the pipeline. If the pipeline is the head,
* then it's output shape corresponds to the shape of the source.
* Otherwise, it's output shape corresponds to the output shape of the
* then its output shape corresponds to the shape of the source.
* Otherwise, its output shape corresponds to the output shape of the
* associated operation.
*
* @return the output shape