8234335: Remove line break in class declaration in java.base
Summary: Remove line break in class declarations where applicable
Reviewed-by: rriggs, lancea
--- a/src/java.base/share/classes/java/io/BufferedInputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/io/BufferedInputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -49,8 +49,7 @@
* @author Arthur van Hoff
* @since 1.0
*/
-public
-class BufferedInputStream extends FilterInputStream {
+public class BufferedInputStream extends FilterInputStream {
private static int DEFAULT_BUFFER_SIZE = 8192;
--- a/src/java.base/share/classes/java/io/CharArrayWriter.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/io/CharArrayWriter.java Thu Nov 21 09:10:21 2019 +0000
@@ -39,8 +39,7 @@
* @author Herb Jellinek
* @since 1.1
*/
-public
-class CharArrayWriter extends Writer {
+public class CharArrayWriter extends Writer {
/**
* The buffer where data is stored.
*/
--- a/src/java.base/share/classes/java/io/DataInput.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/io/DataInput.java Thu Nov 21 09:10:21 2019 +0000
@@ -154,8 +154,7 @@
* @see java.io.DataOutput
* @since 1.0
*/
-public
-interface DataInput {
+public interface DataInput {
/**
* Reads some bytes from an input
* stream and stores them into the buffer
--- a/src/java.base/share/classes/java/io/DataInputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/io/DataInputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -39,8 +39,7 @@
* @see java.io.DataOutputStream
* @since 1.0
*/
-public
-class DataInputStream extends FilterInputStream implements DataInput {
+public class DataInputStream extends FilterInputStream implements DataInput {
/**
* Creates a DataInputStream that uses the specified
--- a/src/java.base/share/classes/java/io/DataOutput.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/io/DataOutput.java Thu Nov 21 09:10:21 2019 +0000
@@ -46,8 +46,7 @@
* @see java.io.DataOutputStream
* @since 1.0
*/
-public
-interface DataOutput {
+public interface DataOutput {
/**
* Writes to the output stream the eight
* low-order bits of the argument {@code b}.
--- a/src/java.base/share/classes/java/io/DataOutputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/io/DataOutputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -34,8 +34,7 @@
* @see java.io.DataInputStream
* @since 1.0
*/
-public
-class DataOutputStream extends FilterOutputStream implements DataOutput {
+public class DataOutputStream extends FilterOutputStream implements DataOutput {
/**
* The number of bytes written to the data output stream so far.
* If this counter overflows, it will be wrapped to Integer.MAX_VALUE.
--- a/src/java.base/share/classes/java/io/EOFException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/io/EOFException.java Thu Nov 21 09:10:21 2019 +0000
@@ -38,8 +38,7 @@
* @see java.io.IOException
* @since 1.0
*/
-public
-class EOFException extends IOException {
+public class EOFException extends IOException {
@java.io.Serial
private static final long serialVersionUID = 6433858223774886977L;
--- a/src/java.base/share/classes/java/io/FileInputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/io/FileInputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -61,8 +61,7 @@
* @see java.nio.file.Files#newInputStream
* @since 1.0
*/
-public
-class FileInputStream extends InputStream
+public class FileInputStream extends InputStream
{
/* File Descriptor - handle to the open file */
private final FileDescriptor fd;
--- a/src/java.base/share/classes/java/io/FileOutputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/io/FileOutputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -66,8 +66,7 @@
* @see java.nio.file.Files#newOutputStream
* @since 1.0
*/
-public
-class FileOutputStream extends OutputStream
+public class FileOutputStream extends OutputStream
{
/**
* Access to FileDescriptor internals.
--- a/src/java.base/share/classes/java/io/FilterInputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/io/FilterInputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -42,8 +42,7 @@
* @author Jonathan Payne
* @since 1.0
*/
-public
-class FilterInputStream extends InputStream {
+public class FilterInputStream extends InputStream {
/**
* The input stream to be filtered.
*/
--- a/src/java.base/share/classes/java/io/IOException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/io/IOException.java Thu Nov 21 09:10:21 2019 +0000
@@ -35,8 +35,7 @@
* @see java.io.OutputStream
* @since 1.0
*/
-public
-class IOException extends Exception {
+public class IOException extends Exception {
@java.io.Serial
static final long serialVersionUID = 7818375828146090155L;
--- a/src/java.base/share/classes/java/io/InterruptedIOException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/io/InterruptedIOException.java Thu Nov 21 09:10:21 2019 +0000
@@ -39,8 +39,7 @@
* @see java.lang.Thread#interrupt()
* @since 1.0
*/
-public
-class InterruptedIOException extends IOException {
+public class InterruptedIOException extends IOException {
@java.io.Serial
private static final long serialVersionUID = 4020568460727500567L;
--- a/src/java.base/share/classes/java/io/LineNumberInputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/io/LineNumberInputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -47,8 +47,7 @@
* include a class for counting line numbers.
*/
@Deprecated
-public
-class LineNumberInputStream extends FilterInputStream {
+public class LineNumberInputStream extends FilterInputStream {
int pushBack = -1;
int lineNumber;
int markLineNumber;
--- a/src/java.base/share/classes/java/io/PipedOutputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/io/PipedOutputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -43,8 +43,7 @@
* @see java.io.PipedInputStream
* @since 1.0
*/
-public
-class PipedOutputStream extends OutputStream {
+public class PipedOutputStream extends OutputStream {
/* REMIND: identification of the read and write sides needs to be
more sophisticated. Either using thread groups (but what about
--- a/src/java.base/share/classes/java/io/PushbackInputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/io/PushbackInputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -49,8 +49,7 @@
* @author Jonathan Payne
* @since 1.0
*/
-public
-class PushbackInputStream extends FilterInputStream {
+public class PushbackInputStream extends FilterInputStream {
/**
* The pushback buffer.
* @since 1.1
--- a/src/java.base/share/classes/java/io/SequenceInputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/io/SequenceInputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -42,8 +42,7 @@
* @author Author van Hoff
* @since 1.0
*/
-public
-class SequenceInputStream extends InputStream {
+public class SequenceInputStream extends InputStream {
Enumeration<? extends InputStream> e;
InputStream in;
--- a/src/java.base/share/classes/java/io/StringBufferInputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/io/StringBufferInputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -43,8 +43,7 @@
* string is via the {@code StringReader} class.
*/
@Deprecated
-public
-class StringBufferInputStream extends InputStream {
+public class StringBufferInputStream extends InputStream {
/**
* The string from which bytes are read.
*/
--- a/src/java.base/share/classes/java/io/UTFDataFormatException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/io/UTFDataFormatException.java Thu Nov 21 09:10:21 2019 +0000
@@ -42,8 +42,7 @@
* @see java.io.IOException
* @since 1.0
*/
-public
-class UTFDataFormatException extends IOException {
+public class UTFDataFormatException extends IOException {
@java.io.Serial
private static final long serialVersionUID = 420743449228280612L;
--- a/src/java.base/share/classes/java/lang/AbstractMethodError.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/AbstractMethodError.java Thu Nov 21 09:10:21 2019 +0000
@@ -35,8 +35,7 @@
* @author unascribed
* @since 1.0
*/
-public
-class AbstractMethodError extends IncompatibleClassChangeError {
+public class AbstractMethodError extends IncompatibleClassChangeError {
@java.io.Serial
private static final long serialVersionUID = -1654391082989018462L;
--- a/src/java.base/share/classes/java/lang/ArrayStoreException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/ArrayStoreException.java Thu Nov 21 09:10:21 2019 +0000
@@ -37,8 +37,7 @@
* @author unascribed
* @since 1.0
*/
-public
-class ArrayStoreException extends RuntimeException {
+public class ArrayStoreException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = -4522193890499838241L;
--- a/src/java.base/share/classes/java/lang/ClassCastException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/ClassCastException.java Thu Nov 21 09:10:21 2019 +0000
@@ -37,8 +37,7 @@
* @author unascribed
* @since 1.0
*/
-public
-class ClassCastException extends RuntimeException {
+public class ClassCastException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = -9223365651070458532L;
--- a/src/java.base/share/classes/java/lang/ClassFormatError.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/ClassFormatError.java Thu Nov 21 09:10:21 2019 +0000
@@ -33,8 +33,7 @@
* @author unascribed
* @since 1.0
*/
-public
-class ClassFormatError extends LinkageError {
+public class ClassFormatError extends LinkageError {
@java.io.Serial
private static final long serialVersionUID = -8420114879011949195L;
--- a/src/java.base/share/classes/java/lang/CloneNotSupportedException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/CloneNotSupportedException.java Thu Nov 21 09:10:21 2019 +0000
@@ -41,8 +41,7 @@
* @since 1.0
*/
-public
-class CloneNotSupportedException extends Exception {
+public class CloneNotSupportedException extends Exception {
@java.io.Serial
private static final long serialVersionUID = 5195511250079656443L;
--- a/src/java.base/share/classes/java/lang/IllegalArgumentException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/IllegalArgumentException.java Thu Nov 21 09:10:21 2019 +0000
@@ -32,8 +32,7 @@
* @author unascribed
* @since 1.0
*/
-public
-class IllegalArgumentException extends RuntimeException {
+public class IllegalArgumentException extends RuntimeException {
/**
* Constructs an {@code IllegalArgumentException} with no
* detail message.
--- a/src/java.base/share/classes/java/lang/IllegalMonitorStateException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/IllegalMonitorStateException.java Thu Nov 21 09:10:21 2019 +0000
@@ -38,8 +38,7 @@
* @see java.lang.Object#wait(long, int)
* @since 1.0
*/
-public
-class IllegalMonitorStateException extends RuntimeException {
+public class IllegalMonitorStateException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = 3713306369498869069L;
--- a/src/java.base/share/classes/java/lang/IllegalStateException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/IllegalStateException.java Thu Nov 21 09:10:21 2019 +0000
@@ -34,8 +34,7 @@
* @author Jonni Kanerva
* @since 1.1
*/
-public
-class IllegalStateException extends RuntimeException {
+public class IllegalStateException extends RuntimeException {
/**
* Constructs an IllegalStateException with no detail message.
* A detail message is a String that describes this particular exception.
--- a/src/java.base/share/classes/java/lang/IncompatibleClassChangeError.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/IncompatibleClassChangeError.java Thu Nov 21 09:10:21 2019 +0000
@@ -33,8 +33,7 @@
* @author unascribed
* @since 1.0
*/
-public
-class IncompatibleClassChangeError extends LinkageError {
+public class IncompatibleClassChangeError extends LinkageError {
@java.io.Serial
private static final long serialVersionUID = -4914975503642802119L;
--- a/src/java.base/share/classes/java/lang/InstantiationError.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/InstantiationError.java Thu Nov 21 09:10:21 2019 +0000
@@ -38,8 +38,7 @@
*/
-public
-class InstantiationError extends IncompatibleClassChangeError {
+public class InstantiationError extends IncompatibleClassChangeError {
@java.io.Serial
private static final long serialVersionUID = -4885810657349421204L;
--- a/src/java.base/share/classes/java/lang/InstantiationException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/InstantiationException.java Thu Nov 21 09:10:21 2019 +0000
@@ -42,8 +42,7 @@
* @see java.lang.Class#newInstance()
* @since 1.0
*/
-public
-class InstantiationException extends ReflectiveOperationException {
+public class InstantiationException extends ReflectiveOperationException {
@java.io.Serial
private static final long serialVersionUID = -8441929162975509110L;
--- a/src/java.base/share/classes/java/lang/InterruptedException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/InterruptedException.java Thu Nov 21 09:10:21 2019 +0000
@@ -46,8 +46,7 @@
* @see java.lang.Thread#interrupted()
* @since 1.0
*/
-public
-class InterruptedException extends Exception {
+public class InterruptedException extends Exception {
@java.io.Serial
private static final long serialVersionUID = 6700697376100628473L;
--- a/src/java.base/share/classes/java/lang/LinkageError.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/LinkageError.java Thu Nov 21 09:10:21 2019 +0000
@@ -34,8 +34,7 @@
* @author Frank Yellin
* @since 1.0
*/
-public
-class LinkageError extends Error {
+public class LinkageError extends Error {
@java.io.Serial
private static final long serialVersionUID = 3579600108157160122L;
--- a/src/java.base/share/classes/java/lang/NegativeArraySizeException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/NegativeArraySizeException.java Thu Nov 21 09:10:21 2019 +0000
@@ -31,8 +31,7 @@
* @author unascribed
* @since 1.0
*/
-public
-class NegativeArraySizeException extends RuntimeException {
+public class NegativeArraySizeException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = -8960118058596991861L;
--- a/src/java.base/share/classes/java/lang/NoClassDefFoundError.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/NoClassDefFoundError.java Thu Nov 21 09:10:21 2019 +0000
@@ -38,8 +38,7 @@
* @author unascribed
* @since 1.0
*/
-public
-class NoClassDefFoundError extends LinkageError {
+public class NoClassDefFoundError extends LinkageError {
@java.io.Serial
private static final long serialVersionUID = 9095859863287012458L;
--- a/src/java.base/share/classes/java/lang/NoSuchFieldError.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/NoSuchFieldError.java Thu Nov 21 09:10:21 2019 +0000
@@ -36,8 +36,7 @@
* @author unascribed
* @since 1.0
*/
-public
-class NoSuchFieldError extends IncompatibleClassChangeError {
+public class NoSuchFieldError extends IncompatibleClassChangeError {
@java.io.Serial
private static final long serialVersionUID = -3456430195886129035L;
--- a/src/java.base/share/classes/java/lang/NoSuchMethodError.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/NoSuchMethodError.java Thu Nov 21 09:10:21 2019 +0000
@@ -37,8 +37,7 @@
* @author unascribed
* @since 1.0
*/
-public
-class NoSuchMethodError extends IncompatibleClassChangeError {
+public class NoSuchMethodError extends IncompatibleClassChangeError {
@java.io.Serial
private static final long serialVersionUID = -3765521442372831335L;
--- a/src/java.base/share/classes/java/lang/NoSuchMethodException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/NoSuchMethodException.java Thu Nov 21 09:10:21 2019 +0000
@@ -31,8 +31,7 @@
* @author unascribed
* @since 1.0
*/
-public
-class NoSuchMethodException extends ReflectiveOperationException {
+public class NoSuchMethodException extends ReflectiveOperationException {
@java.io.Serial
private static final long serialVersionUID = 5034388446362600923L;
--- a/src/java.base/share/classes/java/lang/NullPointerException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/NullPointerException.java Thu Nov 21 09:10:21 2019 +0000
@@ -49,8 +49,7 @@
* @author unascribed
* @since 1.0
*/
-public
-class NullPointerException extends RuntimeException {
+public class NullPointerException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = 5162710183389028792L;
--- a/src/java.base/share/classes/java/lang/NumberFormatException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/NumberFormatException.java Thu Nov 21 09:10:21 2019 +0000
@@ -34,8 +34,7 @@
* @see java.lang.Integer#parseInt(String)
* @since 1.0
*/
-public
-class NumberFormatException extends IllegalArgumentException {
+public class NumberFormatException extends IllegalArgumentException {
@java.io.Serial
static final long serialVersionUID = -2848938806368998894L;
--- a/src/java.base/share/classes/java/lang/StackOverflowError.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/StackOverflowError.java Thu Nov 21 09:10:21 2019 +0000
@@ -32,8 +32,7 @@
* @author unascribed
* @since 1.0
*/
-public
-class StackOverflowError extends VirtualMachineError {
+public class StackOverflowError extends VirtualMachineError {
@java.io.Serial
private static final long serialVersionUID = 8609175038441759607L;
--- a/src/java.base/share/classes/java/lang/Thread.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/Thread.java Thu Nov 21 09:10:21 2019 +0000
@@ -140,8 +140,7 @@
* @see #stop()
* @since 1.0
*/
-public
-class Thread implements Runnable {
+public class Thread implements Runnable {
/* Make sure registerNatives is the first thing <clinit> does. */
private static native void registerNatives();
static {
--- a/src/java.base/share/classes/java/lang/ThreadGroup.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/ThreadGroup.java Thu Nov 21 09:10:21 2019 +0000
@@ -52,8 +52,7 @@
* and working off of that snapshot, rather than holding the thread group locked
* while we work on the children.
*/
-public
-class ThreadGroup implements Thread.UncaughtExceptionHandler {
+public class ThreadGroup implements Thread.UncaughtExceptionHandler {
private final ThreadGroup parent;
String name;
int maxPriority;
--- a/src/java.base/share/classes/java/lang/UnknownError.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/UnknownError.java Thu Nov 21 09:10:21 2019 +0000
@@ -32,8 +32,7 @@
* @author unascribed
* @since 1.0
*/
-public
-class UnknownError extends VirtualMachineError {
+public class UnknownError extends VirtualMachineError {
@java.io.Serial
private static final long serialVersionUID = 2524784860676771849L;
--- a/src/java.base/share/classes/java/lang/UnsatisfiedLinkError.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/UnsatisfiedLinkError.java Thu Nov 21 09:10:21 2019 +0000
@@ -33,8 +33,7 @@
* @see java.lang.Runtime
* @since 1.0
*/
-public
-class UnsatisfiedLinkError extends LinkageError {
+public class UnsatisfiedLinkError extends LinkageError {
@java.io.Serial
private static final long serialVersionUID = -4019343241616879428L;
--- a/src/java.base/share/classes/java/lang/UnsupportedClassVersionError.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/UnsupportedClassVersionError.java Thu Nov 21 09:10:21 2019 +0000
@@ -32,8 +32,7 @@
*
* @since 1.2
*/
-public
-class UnsupportedClassVersionError extends ClassFormatError {
+public class UnsupportedClassVersionError extends ClassFormatError {
@java.io.Serial
private static final long serialVersionUID = -7123279212883497373L;
--- a/src/java.base/share/classes/java/lang/VerifyError.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/VerifyError.java Thu Nov 21 09:10:21 2019 +0000
@@ -33,8 +33,7 @@
* @author unascribed
* @since 1.0
*/
-public
-class VerifyError extends LinkageError {
+public class VerifyError extends LinkageError {
@java.io.Serial
private static final long serialVersionUID = 7001962396098498785L;
--- a/src/java.base/share/classes/java/lang/invoke/AbstractConstantGroup.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/invoke/AbstractConstantGroup.java Thu Nov 21 09:10:21 2019 +0000
@@ -316,8 +316,7 @@
}
/** Skeleton implementation of BootstrapCallInfo. */
- static
- class BSCIWithCache<T> extends WithCache implements BootstrapCallInfo<T> {
+ static class BSCIWithCache<T> extends WithCache implements BootstrapCallInfo<T> {
private final MethodHandle bsm;
private final String name;
private final T type;
--- a/src/java.base/share/classes/java/lang/invoke/BootstrapMethodInvoker.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/invoke/BootstrapMethodInvoker.java Thu Nov 21 09:10:21 2019 +0000
@@ -460,8 +460,8 @@
}
}
- /*non-public*/ static final
- class PushAdapter {
+ /*non-public*/
+ static final class PushAdapter {
// skeleton for push-mode BSM which wraps a pull-mode BSM:
static Object pushToBootstrapMethod(MethodHandle pullModeBSM,
MethodHandles.Lookup lookup, String name, Object type,
@@ -487,8 +487,8 @@
}
}
- /*non-public*/ static final
- class PullAdapter {
+ /*non-public*/
+ static final class PullAdapter {
// skeleton for pull-mode BSM which wraps a push-mode BSM:
static Object pullFromBootstrapMethod(MethodHandle pushModeBSM,
MethodHandles.Lookup lookup,
--- a/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java Thu Nov 21 09:10:21 2019 +0000
@@ -48,9 +48,11 @@
*
* All bound arguments are encapsulated in dedicated species.
*/
-/*non-public*/ abstract class BoundMethodHandle extends MethodHandle {
+/*non-public*/
+abstract class BoundMethodHandle extends MethodHandle {
- /*non-public*/ BoundMethodHandle(MethodType type, LambdaForm form) {
+ /*non-public*/
+ BoundMethodHandle(MethodType type, LambdaForm form) {
super(type, form);
assert(speciesData() == speciesDataFor(form));
}
@@ -141,9 +143,11 @@
* Return the {@link BoundMethodHandle.SpeciesData} instance representing this BMH species. All subclasses must provide a
* static field containing this value, and they must accordingly implement this method.
*/
- /*non-public*/ abstract BoundMethodHandle.SpeciesData speciesData();
+ /*non-public*/
+ abstract BoundMethodHandle.SpeciesData speciesData();
- /*non-public*/ static BoundMethodHandle.SpeciesData speciesDataFor(LambdaForm form) {
+ /*non-public*/
+ static BoundMethodHandle.SpeciesData speciesDataFor(LambdaForm form) {
Object c = form.names[0].constraint;
if (c instanceof SpeciesData) {
return (SpeciesData) c;
@@ -155,7 +159,8 @@
/**
* Return the number of fields in this BMH. Equivalent to speciesData().fieldCount().
*/
- /*non-public*/ final int fieldCount() { return speciesData().fieldCount(); }
+ /*non-public*/
+ final int fieldCount() { return speciesData().fieldCount(); }
@Override
Object internalProperties() {
@@ -175,7 +180,8 @@
return sb.append("\n]").toString();
}
- /*non-public*/ final Object arg(int i) {
+ /*non-public*/
+ final Object arg(int i) {
try {
Class<?> fieldType = speciesData().fieldTypes().get(i);
switch (BasicType.basicType(fieldType)) {
@@ -195,12 +201,18 @@
// cloning API
//
- /*non-public*/ abstract BoundMethodHandle copyWith(MethodType mt, LambdaForm lf);
- /*non-public*/ abstract BoundMethodHandle copyWithExtendL(MethodType mt, LambdaForm lf, Object narg);
- /*non-public*/ abstract BoundMethodHandle copyWithExtendI(MethodType mt, LambdaForm lf, int narg);
- /*non-public*/ abstract BoundMethodHandle copyWithExtendJ(MethodType mt, LambdaForm lf, long narg);
- /*non-public*/ abstract BoundMethodHandle copyWithExtendF(MethodType mt, LambdaForm lf, float narg);
- /*non-public*/ abstract BoundMethodHandle copyWithExtendD(MethodType mt, LambdaForm lf, double narg);
+ /*non-public*/
+ abstract BoundMethodHandle copyWith(MethodType mt, LambdaForm lf);
+ /*non-public*/
+ abstract BoundMethodHandle copyWithExtendL(MethodType mt, LambdaForm lf, Object narg);
+ /*non-public*/
+ abstract BoundMethodHandle copyWithExtendI(MethodType mt, LambdaForm lf, int narg);
+ /*non-public*/
+ abstract BoundMethodHandle copyWithExtendJ(MethodType mt, LambdaForm lf, long narg);
+ /*non-public*/
+ abstract BoundMethodHandle copyWithExtendF(MethodType mt, LambdaForm lf, float narg);
+ /*non-public*/
+ abstract BoundMethodHandle copyWithExtendD(MethodType mt, LambdaForm lf, double narg);
//
// concrete BMH classes required to close bootstrap loops
@@ -217,21 +229,26 @@
}
@Override
- /*non-public*/ SpeciesData speciesData() {
+ /*non-public*/
+ SpeciesData speciesData() {
return BMH_SPECIES;
}
- /*non-public*/ static @Stable SpeciesData BMH_SPECIES;
+ /*non-public*/
+ static @Stable SpeciesData BMH_SPECIES;
- /*non-public*/ static BoundMethodHandle make(MethodType mt, LambdaForm lf, Object argL0) {
+ /*non-public*/
+ static BoundMethodHandle make(MethodType mt, LambdaForm lf, Object argL0) {
return new Species_L(mt, lf, argL0);
}
@Override
- /*non-public*/ final BoundMethodHandle copyWith(MethodType mt, LambdaForm lf) {
+ /*non-public*/
+ final BoundMethodHandle copyWith(MethodType mt, LambdaForm lf) {
return new Species_L(mt, lf, argL0);
}
@Override
- /*non-public*/ final BoundMethodHandle copyWithExtendL(MethodType mt, LambdaForm lf, Object narg) {
+ /*non-public*/
+ final BoundMethodHandle copyWithExtendL(MethodType mt, LambdaForm lf, Object narg) {
try {
return (BoundMethodHandle) BMH_SPECIES.extendWith(L_TYPE_NUM).factory().invokeBasic(mt, lf, argL0, narg);
} catch (Throwable ex) {
@@ -239,7 +256,8 @@
}
}
@Override
- /*non-public*/ final BoundMethodHandle copyWithExtendI(MethodType mt, LambdaForm lf, int narg) {
+ /*non-public*/
+ final BoundMethodHandle copyWithExtendI(MethodType mt, LambdaForm lf, int narg) {
try {
return (BoundMethodHandle) BMH_SPECIES.extendWith(I_TYPE_NUM).factory().invokeBasic(mt, lf, argL0, narg);
} catch (Throwable ex) {
@@ -247,7 +265,8 @@
}
}
@Override
- /*non-public*/ final BoundMethodHandle copyWithExtendJ(MethodType mt, LambdaForm lf, long narg) {
+ /*non-public*/
+ final BoundMethodHandle copyWithExtendJ(MethodType mt, LambdaForm lf, long narg) {
try {
return (BoundMethodHandle) BMH_SPECIES.extendWith(J_TYPE_NUM).factory().invokeBasic(mt, lf, argL0, narg);
} catch (Throwable ex) {
@@ -255,7 +274,8 @@
}
}
@Override
- /*non-public*/ final BoundMethodHandle copyWithExtendF(MethodType mt, LambdaForm lf, float narg) {
+ /*non-public*/
+ final BoundMethodHandle copyWithExtendF(MethodType mt, LambdaForm lf, float narg) {
try {
return (BoundMethodHandle) BMH_SPECIES.extendWith(F_TYPE_NUM).factory().invokeBasic(mt, lf, argL0, narg);
} catch (Throwable ex) {
@@ -263,7 +283,8 @@
}
}
@Override
- /*non-public*/ final BoundMethodHandle copyWithExtendD(MethodType mt, LambdaForm lf, double narg) {
+ /*non-public*/
+ final BoundMethodHandle copyWithExtendD(MethodType mt, LambdaForm lf, double narg) {
try {
return (BoundMethodHandle) BMH_SPECIES.extendWith(D_TYPE_NUM).factory().invokeBasic(mt, lf, argL0, narg);
} catch (Throwable ex) {
@@ -277,7 +298,8 @@
//
/*non-public*/
- static final class SpeciesData extends ClassSpecializer<BoundMethodHandle, String, SpeciesData>.SpeciesData {
+ static final class SpeciesData
+ extends ClassSpecializer<BoundMethodHandle, String, SpeciesData>.SpeciesData {
// This array is filled in lazily, as new species come into being over time.
@Stable final private SpeciesData[] extensions = new SpeciesData[ARG_TYPE_LIMIT];
@@ -346,7 +368,8 @@
return true;
}
- /*non-public*/ SpeciesData extendWith(byte typeNum) {
+ /*non-public*/
+ SpeciesData extendWith(byte typeNum) {
SpeciesData sd = extensions[typeNum];
if (sd != null) return sd;
sd = SPECIALIZER.findSpecies(key() + BasicType.basicType(typeNum).basicTypeChar());
@@ -363,7 +386,8 @@
}
/*non-public*/
- static final class Specializer extends ClassSpecializer<BoundMethodHandle, String, SpeciesData> {
+ static final class Specializer
+ extends ClassSpecializer<BoundMethodHandle, String, SpeciesData> {
private static final MemberName SPECIES_DATA_ACCESSOR;
--- a/src/java.base/share/classes/java/lang/invoke/CallSite.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/invoke/CallSite.java Thu Nov 21 09:10:21 2019 +0000
@@ -217,7 +217,8 @@
*/
public abstract MethodHandle dynamicInvoker();
- /*non-public*/ MethodHandle makeDynamicInvoker() {
+ /*non-public*/
+ MethodHandle makeDynamicInvoker() {
MethodHandle getTarget = getTargetHandle().bindArgumentL(0, this);
MethodHandle invoker = MethodHandles.exactInvoker(this.type());
return MethodHandles.foldArguments(invoker, getTarget);
--- a/src/java.base/share/classes/java/lang/invoke/ClassSpecializer.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/invoke/ClassSpecializer.java Thu Nov 21 09:10:21 2019 +0000
@@ -544,31 +544,33 @@
* has a shape like the following:
*
* <pre>
- * class TopClass { ... private static
- * final class Species_LLI extends TopClass {
- * final Object argL0;
- * final Object argL1;
- * final int argI2;
- * private Species_LLI(CT ctarg, ..., Object argL0, Object argL1, int argI2) {
- * super(ctarg, ...);
- * this.argL0 = argL0;
- * this.argL1 = argL1;
- * this.argI2 = argI2;
- * }
- * final SpeciesData speciesData() { return BMH_SPECIES; }
- * @Stable static SpeciesData BMH_SPECIES; // injected afterwards
- * static TopClass make(CT ctarg, ..., Object argL0, Object argL1, int argI2) {
- * return new Species_LLI(ctarg, ..., argL0, argL1, argI2);
- * }
- * final TopClass copyWith(CT ctarg, ...) {
- * return new Species_LLI(ctarg, ..., argL0, argL1, argI2);
- * }
- * // two transforms, for the sake of illustration:
- * final TopClass copyWithExtendL(CT ctarg, ..., Object narg) {
- * return BMH_SPECIES.transform(L_TYPE).invokeBasic(ctarg, ..., argL0, argL1, argI2, narg);
- * }
- * final TopClass copyWithExtendI(CT ctarg, ..., int narg) {
- * return BMH_SPECIES.transform(I_TYPE).invokeBasic(ctarg, ..., argL0, argL1, argI2, narg);
+ * class TopClass {
+ * ...
+ * private static final class Species_LLI extends TopClass {
+ * final Object argL0;
+ * final Object argL1;
+ * final int argI2;
+ * private Species_LLI(CT ctarg, ..., Object argL0, Object argL1, int argI2) {
+ * super(ctarg, ...);
+ * this.argL0 = argL0;
+ * this.argL1 = argL1;
+ * this.argI2 = argI2;
+ * }
+ * final SpeciesData speciesData() { return BMH_SPECIES; }
+ * @Stable static SpeciesData BMH_SPECIES; // injected afterwards
+ * static TopClass make(CT ctarg, ..., Object argL0, Object argL1, int argI2) {
+ * return new Species_LLI(ctarg, ..., argL0, argL1, argI2);
+ * }
+ * final TopClass copyWith(CT ctarg, ...) {
+ * return new Species_LLI(ctarg, ..., argL0, argL1, argI2);
+ * }
+ * // two transforms, for the sake of illustration:
+ * final TopClass copyWithExtendL(CT ctarg, ..., Object narg) {
+ * return BMH_SPECIES.transform(L_TYPE).invokeBasic(ctarg, ..., argL0, argL1, argI2, narg);
+ * }
+ * final TopClass copyWithExtendI(CT ctarg, ..., int narg) {
+ * return BMH_SPECIES.transform(I_TYPE).invokeBasic(ctarg, ..., argL0, argL1, argI2, narg);
+ * }
* }
* }
* </pre>
@@ -624,7 +626,8 @@
}
private static final int ACC_PPP = ACC_PUBLIC | ACC_PRIVATE | ACC_PROTECTED;
- /*non-public*/ byte[] generateConcreteSpeciesCodeFile(String className0, ClassSpecializer<T,K,S>.SpeciesData speciesData) {
+ /*non-public*/
+ byte[] generateConcreteSpeciesCodeFile(String className0, ClassSpecializer<T,K,S>.SpeciesData speciesData) {
final String className = classBCName(className0);
final String superClassName = classBCName(speciesData.deriveSuperClass());
--- a/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java Thu Nov 21 09:10:21 2019 +0000
@@ -306,21 +306,23 @@
/** Static wrapper for DirectMethodHandle.internalMemberName. */
@ForceInline
- /*non-public*/ static Object internalMemberName(Object mh) {
+ /*non-public*/
+ static Object internalMemberName(Object mh) {
return ((DirectMethodHandle)mh).member;
}
/** Static wrapper for DirectMethodHandle.internalMemberName.
* This one also forces initialization.
*/
- /*non-public*/ static Object internalMemberNameEnsureInit(Object mh) {
+ /*non-public*/
+ static Object internalMemberNameEnsureInit(Object mh) {
DirectMethodHandle dmh = (DirectMethodHandle)mh;
dmh.ensureInitialized();
return dmh.member;
}
- /*non-public*/ static
- boolean shouldBeInitialized(MemberName member) {
+ /*non-public*/
+ static boolean shouldBeInitialized(MemberName member) {
switch (member.getReferenceKind()) {
case REF_invokeStatic:
case REF_getStatic:
@@ -396,7 +398,8 @@
return true;
}
- /*non-public*/ static void ensureInitialized(Object mh) {
+ /*non-public*/
+ static void ensureInitialized(Object mh) {
((DirectMethodHandle)mh).ensureInitialized();
}
@@ -472,12 +475,14 @@
}
}
- /*non-public*/ static Object constructorMethod(Object mh) {
+ /*non-public*/
+ static Object constructorMethod(Object mh) {
Constructor dmh = (Constructor)mh;
return dmh.initMethod;
}
- /*non-public*/ static Object allocateInstance(Object mh) throws InstantiationException {
+ /*non-public*/
+ static Object allocateInstance(Object mh) throws InstantiationException {
Constructor dmh = (Constructor)mh;
return UNSAFE.allocateInstance(dmh.instanceClass);
}
@@ -503,14 +508,16 @@
}
@ForceInline
- /*non-public*/ static long fieldOffset(Object accessorObj) {
+ /*non-public*/
+ static long fieldOffset(Object accessorObj) {
// Note: We return a long because that is what Unsafe.getObject likes.
// We store a plain int because it is more compact.
return ((Accessor)accessorObj).fieldOffset;
}
@ForceInline
- /*non-public*/ static Object checkBase(Object obj) {
+ /*non-public*/
+ static Object checkBase(Object obj) {
// Note that the object's class has already been verified,
// since the parameter type of the Accessor method handle
// is either member.getDeclaringClass or a subclass.
@@ -545,22 +552,26 @@
}
@ForceInline
- /*non-public*/ static Object nullCheck(Object obj) {
+ /*non-public*/
+ static Object nullCheck(Object obj) {
return Objects.requireNonNull(obj);
}
@ForceInline
- /*non-public*/ static Object staticBase(Object accessorObj) {
+ /*non-public*/
+ static Object staticBase(Object accessorObj) {
return ((StaticAccessor)accessorObj).staticBase;
}
@ForceInline
- /*non-public*/ static long staticOffset(Object accessorObj) {
+ /*non-public*/
+ static long staticOffset(Object accessorObj) {
return ((StaticAccessor)accessorObj).staticOffset;
}
@ForceInline
- /*non-public*/ static Object checkCast(Object mh, Object obj) {
+ /*non-public*/
+ static Object checkCast(Object mh, Object obj) {
return ((DirectMethodHandle) mh).checkCast(obj);
}
--- a/src/java.base/share/classes/java/lang/invoke/InfoFromMemberName.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/invoke/InfoFromMemberName.java Thu Nov 21 09:10:21 2019 +0000
@@ -35,8 +35,7 @@
* Auxiliary to MethodHandleInfo, wants to nest in MethodHandleInfo but must be non-public.
*/
/*non-public*/
-final
-class InfoFromMemberName implements MethodHandleInfo {
+final class InfoFromMemberName implements MethodHandleInfo {
private final MemberName member;
private final int referenceKind;
--- a/src/java.base/share/classes/java/lang/invoke/Invokers.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/invoke/Invokers.java Thu Nov 21 09:10:21 2019 +0000
@@ -58,25 +58,29 @@
/** Compute and cache information common to all collecting adapters
* that implement members of the erasure-family of the given erased type.
*/
- /*non-public*/ Invokers(MethodType targetType) {
+ /*non-public*/
+ Invokers(MethodType targetType) {
this.targetType = targetType;
}
- /*non-public*/ MethodHandle exactInvoker() {
+ /*non-public*/
+ MethodHandle exactInvoker() {
MethodHandle invoker = cachedInvoker(INV_EXACT);
if (invoker != null) return invoker;
invoker = makeExactOrGeneralInvoker(true);
return setCachedInvoker(INV_EXACT, invoker);
}
- /*non-public*/ MethodHandle genericInvoker() {
+ /*non-public*/
+ MethodHandle genericInvoker() {
MethodHandle invoker = cachedInvoker(INV_GENERIC);
if (invoker != null) return invoker;
invoker = makeExactOrGeneralInvoker(false);
return setCachedInvoker(INV_GENERIC, invoker);
}
- /*non-public*/ MethodHandle basicInvoker() {
+ /*non-public*/
+ MethodHandle basicInvoker() {
MethodHandle invoker = cachedInvoker(INV_BASIC);
if (invoker != null) return invoker;
MethodType basicType = targetType.basicType();
@@ -94,12 +98,14 @@
return setCachedInvoker(INV_BASIC, invoker);
}
- /*non-public*/ MethodHandle varHandleMethodInvoker(VarHandle.AccessMode ak) {
+ /*non-public*/
+ MethodHandle varHandleMethodInvoker(VarHandle.AccessMode ak) {
// TODO cache invoker
return makeVarHandleMethodInvoker(ak, false);
}
- /*non-public*/ MethodHandle varHandleMethodExactInvoker(VarHandle.AccessMode ak) {
+ /*non-public*/
+ MethodHandle varHandleMethodExactInvoker(VarHandle.AccessMode ak) {
// TODO cache invoker
return makeVarHandleMethodInvoker(ak, true);
}
@@ -153,7 +159,8 @@
}
// This next one is called from LambdaForm.NamedFunction.<init>.
- /*non-public*/ static MemberName invokeBasicMethod(MethodType basicType) {
+ /*non-public*/
+ static MemberName invokeBasicMethod(MethodType basicType) {
assert(basicType == basicType.basicType());
try {
//Lookup.findVirtual(MethodHandle.class, name, type);
@@ -190,7 +197,8 @@
* @param leadingArgCount the number of unchanged (non-spread) arguments
* @return {@code invoker.invokeExact(mh, uarg*, C[]{sarg*}) := (RT)mh.invoke(uarg*, sarg*)}
*/
- /*non-public*/ MethodHandle spreadInvoker(int leadingArgCount) {
+ /*non-public*/
+ MethodHandle spreadInvoker(int leadingArgCount) {
int spreadArgCount = targetType.parameterCount() - leadingArgCount;
MethodType postSpreadType = targetType;
Class<?> argArrayType = impliedRestargType(postSpreadType, leadingArgCount);
@@ -445,9 +453,9 @@
return lform;
}
- /*non-public*/ static
@ForceInline
- MethodHandle checkVarHandleGenericType(VarHandle handle, VarHandle.AccessDescriptor ad) {
+ /*non-public*/
+ static MethodHandle checkVarHandleGenericType(VarHandle handle, VarHandle.AccessDescriptor ad) {
// Test for exact match on invoker types
// TODO match with erased types and add cast of return value to lambda form
MethodHandle mh = handle.getMethodHandle(ad.mode);
@@ -459,9 +467,9 @@
}
}
- /*non-public*/ static
@ForceInline
- MethodHandle checkVarHandleExactType(VarHandle handle, VarHandle.AccessDescriptor ad) {
+ /*non-public*/
+ static MethodHandle checkVarHandleExactType(VarHandle handle, VarHandle.AccessDescriptor ad) {
MethodHandle mh = handle.getMethodHandle(ad.mode);
MethodType mt = mh.type();
if (mt != ad.symbolicMethodTypeInvoker) {
@@ -470,16 +478,16 @@
return mh;
}
- /*non-public*/ static
- WrongMethodTypeException newWrongMethodTypeException(MethodType actual, MethodType expected) {
+ /*non-public*/
+ static WrongMethodTypeException newWrongMethodTypeException(MethodType actual, MethodType expected) {
// FIXME: merge with JVM logic for throwing WMTE
return new WrongMethodTypeException("expected "+expected+" but found "+actual);
}
/** Static definition of MethodHandle.invokeExact checking code. */
- /*non-public*/ static
@ForceInline
- void checkExactType(MethodHandle mh, MethodType expected) {
+ /*non-public*/
+ static void checkExactType(MethodHandle mh, MethodType expected) {
MethodType actual = mh.type();
if (actual != expected)
throw newWrongMethodTypeException(expected, actual);
@@ -489,9 +497,9 @@
* Directly returns the type-adjusted MH to invoke, as follows:
* {@code (R)MH.invoke(a*) => MH.asType(TYPEOF(a*:R)).invokeBasic(a*)}
*/
- /*non-public*/ static
@ForceInline
- MethodHandle checkGenericType(MethodHandle mh, MethodType expected) {
+ /*non-public*/
+ static MethodHandle checkGenericType(MethodHandle mh, MethodType expected) {
return mh.asType(expected);
/* Maybe add more paths here. Possible optimizations:
* for (R)MH.invoke(a*),
@@ -559,24 +567,24 @@
}
/** Static definition of MethodHandle.invokeGeneric checking code. */
- /*non-public*/ static
@ForceInline
- MethodHandle getCallSiteTarget(CallSite site) {
+ /*non-public*/
+ static MethodHandle getCallSiteTarget(CallSite site) {
return site.getTarget();
}
- /*non-public*/ static
@ForceInline
- void checkCustomized(MethodHandle mh) {
+ /*non-public*/
+ static void checkCustomized(MethodHandle mh) {
if (MethodHandleImpl.isCompileConstant(mh)) return;
if (mh.form.customized == null) {
maybeCustomize(mh);
}
}
- /*non-public*/ static
@DontInline
- void maybeCustomize(MethodHandle mh) {
+ /*non-public*/
+ static void maybeCustomize(MethodHandle mh) {
byte count = mh.customizationCount;
if (count >= CUSTOMIZE_THRESHOLD) {
mh.customize();
--- a/src/java.base/share/classes/java/lang/invoke/MemberName.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/invoke/MemberName.java Thu Nov 21 09:10:21 2019 +0000
@@ -70,12 +70,14 @@
* and those seven fields omit much of the information in Method.
* @author jrose
*/
-/*non-public*/ final class ResolvedMethodName {
+/*non-public*/
+final class ResolvedMethodName {
//@Injected JVM_Method* vmtarget;
//@Injected Class<?> vmholder;
};
-/*non-public*/ final class MemberName implements Member, Cloneable {
+/*non-public*/
+final class MemberName implements Member, Cloneable {
private Class<?> clazz; // class in which the member is defined
private String name; // may be null if not yet materialized
private Object type; // may be null if not yet materialized
@@ -310,7 +312,9 @@
return true;
return false;
}
- /*non-public*/ boolean referenceKindIsConsistentWith(int originalRefKind) {
+
+ /*non-public*/
+ boolean referenceKindIsConsistentWith(int originalRefKind) {
int refKind = getReferenceKind();
if (refKind == originalRefKind) return true;
switch (originalRefKind) {
@@ -977,13 +981,15 @@
}
/** Actually making a query requires an access check. */
- /*non-public*/ static Factory getFactory() {
+ /*non-public*/
+ static Factory getFactory() {
return Factory.INSTANCE;
}
/** A factory type for resolving member names with the help of the VM.
* TBD: Define access-safe public constructors for this factory.
*/
- /*non-public*/ static class Factory {
+ /*non-public*/
+ static class Factory {
private Factory() { } // singleton pattern
static Factory INSTANCE = new Factory();
@@ -1098,9 +1104,8 @@
* If lookup fails or access is not permitted, a {@linkplain ReflectiveOperationException} is thrown.
* Otherwise a fresh copy of the given member is returned, with modifier bits filled in.
*/
- public
- <NoSuchMemberException extends ReflectiveOperationException>
- MemberName resolveOrFail(byte refKind, MemberName m, Class<?> lookupClass,
+ public <NoSuchMemberException extends ReflectiveOperationException>
+ MemberName resolveOrFail(byte refKind, MemberName m, Class<?> lookupClass,
Class<NoSuchMemberException> nsmClass)
throws IllegalAccessException, NoSuchMemberException {
MemberName result = resolve(refKind, m, lookupClass, false);
@@ -1116,8 +1121,7 @@
* If lookup fails or access is not permitted, return null.
* Otherwise a fresh copy of the given member is returned, with modifier bits filled in.
*/
- public
- MemberName resolveOrNull(byte refKind, MemberName m, Class<?> lookupClass) {
+ public MemberName resolveOrNull(byte refKind, MemberName m, Class<?> lookupClass) {
MemberName result = resolve(refKind, m, lookupClass, true);
if (result != null && result.isResolved())
return result;
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandle.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandle.java Thu Nov 21 09:10:21 2019 +0000
@@ -448,11 +448,14 @@
@interface PolymorphicSignature { }
private final MethodType type;
- /*private*/ final LambdaForm form;
+ /*private*/
+ final LambdaForm form;
// form is not private so that invokers can easily fetch it
- /*private*/ MethodHandle asTypeCache;
+ /*private*/
+ MethodHandle asTypeCache;
// asTypeCache is not private so that invokers can easily fetch it
- /*non-public*/ byte customizationCount;
+ /*non-public*/
+ byte customizationCount;
// customizationCount should be accessible from invokers
/**
@@ -470,7 +473,8 @@
* the {@code java.lang.invoke} package.
*/
// @param type type (permanently assigned) of the new method handle
- /*non-public*/ MethodHandle(MethodType type, LambdaForm form) {
+ /*non-public*/
+ MethodHandle(MethodType type, LambdaForm form) {
this.type = Objects.requireNonNull(type);
this.form = Objects.requireNonNull(form).uncustomize();
@@ -553,7 +557,8 @@
* @return the signature-polymorphic result, statically represented using {@code Object}
*/
@HotSpotIntrinsicCandidate
- /*non-public*/ final native @PolymorphicSignature Object invokeBasic(Object... args) throws Throwable;
+ /*non-public*/
+ final native @PolymorphicSignature Object invokeBasic(Object... args) throws Throwable;
/**
* Private method for trusted invocation of a MemberName of kind {@code REF_invokeVirtual}.
@@ -563,7 +568,8 @@
* @return the signature-polymorphic result, statically represented using {@code Object}
*/
@HotSpotIntrinsicCandidate
- /*non-public*/ static native @PolymorphicSignature Object linkToVirtual(Object... args) throws Throwable;
+ /*non-public*/
+ static native @PolymorphicSignature Object linkToVirtual(Object... args) throws Throwable;
/**
* Private method for trusted invocation of a MemberName of kind {@code REF_invokeStatic}.
@@ -573,7 +579,8 @@
* @return the signature-polymorphic result, statically represented using {@code Object}
*/
@HotSpotIntrinsicCandidate
- /*non-public*/ static native @PolymorphicSignature Object linkToStatic(Object... args) throws Throwable;
+ /*non-public*/
+ static native @PolymorphicSignature Object linkToStatic(Object... args) throws Throwable;
/**
* Private method for trusted invocation of a MemberName of kind {@code REF_invokeSpecial}.
@@ -583,7 +590,8 @@
* @return the signature-polymorphic result, statically represented using {@code Object}
*/
@HotSpotIntrinsicCandidate
- /*non-public*/ static native @PolymorphicSignature Object linkToSpecial(Object... args) throws Throwable;
+ /*non-public*/
+ static native @PolymorphicSignature Object linkToSpecial(Object... args) throws Throwable;
/**
* Private method for trusted invocation of a MemberName of kind {@code REF_invokeInterface}.
@@ -593,7 +601,8 @@
* @return the signature-polymorphic result, statically represented using {@code Object}
*/
@HotSpotIntrinsicCandidate
- /*non-public*/ static native @PolymorphicSignature Object linkToInterface(Object... args) throws Throwable;
+ /*non-public*/
+ static native @PolymorphicSignature Object linkToInterface(Object... args) throws Throwable;
/**
* Performs a variable arity invocation, passing the arguments in the given array
@@ -865,7 +874,8 @@
}
/** Override this to change asType behavior. */
- /*non-public*/ MethodHandle asTypeUncached(MethodType newType) {
+ /*non-public*/
+ MethodHandle asTypeUncached(MethodType newType) {
if (!type.isConvertibleTo(newType))
throw new WrongMethodTypeException("cannot convert "+this+" to "+newType);
return asTypeCache = MethodHandleImpl.makePairwiseConvert(this, newType, true);
@@ -1242,7 +1252,8 @@
* See if {@code asCollector} can be validly called with the given arguments.
* Return false if the last parameter is not an exact match to arrayType.
*/
- /*non-public*/ boolean asCollectorChecks(Class<?> arrayType, int pos, int arrayLength) {
+ /*non-public*/
+ boolean asCollectorChecks(Class<?> arrayType, int pos, int arrayLength) {
spreadArrayChecks(arrayType, arrayLength);
int nargs = type().parameterCount();
if (pos < 0 || pos >= nargs) {
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java Thu Nov 21 09:10:21 2019 +0000
@@ -59,7 +59,8 @@
* Trusted implementation code for MethodHandle.
* @author jrose
*/
-/*non-public*/ abstract class MethodHandleImpl {
+/*non-public*/
+abstract class MethodHandleImpl {
/// Factory methods to create method handles:
@@ -683,8 +684,7 @@
}
@Hidden
- static
- MethodHandle selectAlternative(boolean testResult, MethodHandle target, MethodHandle fallback) {
+ static MethodHandle selectAlternative(boolean testResult, MethodHandle target, MethodHandle fallback) {
if (testResult) {
return target;
} else {
@@ -695,8 +695,7 @@
// Intrinsified by C2. Counters are used during parsing to calculate branch frequencies.
@Hidden
@jdk.internal.HotSpotIntrinsicCandidate
- static
- boolean profileBoolean(boolean result, int[] counters) {
+ static boolean profileBoolean(boolean result, int[] counters) {
// Profile is int[2] where [0] and [1] correspond to false and true occurrences respectively.
int idx = result ? 1 : 0;
try {
@@ -711,13 +710,11 @@
// Intrinsified by C2. Returns true if obj is a compile-time constant.
@Hidden
@jdk.internal.HotSpotIntrinsicCandidate
- static
- boolean isCompileConstant(Object obj) {
+ static boolean isCompileConstant(Object obj) {
return false;
}
- static
- MethodHandle makeGuardWithTest(MethodHandle test,
+ static MethodHandle makeGuardWithTest(MethodHandle test,
MethodHandle target,
MethodHandle fallback) {
MethodType type = target.type();
@@ -744,8 +741,7 @@
}
- static
- MethodHandle profile(MethodHandle target) {
+ static MethodHandle profile(MethodHandle target) {
if (DONT_INLINE_THRESHOLD >= 0) {
return makeBlockInliningWrapper(target);
} else {
@@ -757,8 +753,7 @@
* Block inlining during JIT-compilation of a target method handle if it hasn't been invoked enough times.
* Corresponding LambdaForm has @DontInline when compiled into bytecode.
*/
- static
- MethodHandle makeBlockInliningWrapper(MethodHandle target) {
+ static MethodHandle makeBlockInliningWrapper(MethodHandle target) {
LambdaForm lform;
if (DONT_INLINE_THRESHOLD > 0) {
lform = Makers.PRODUCE_BLOCK_INLINING_FORM.apply(target);
@@ -895,8 +890,7 @@
}
}
- static
- LambdaForm makeGuardWithTestForm(MethodType basicType) {
+ static LambdaForm makeGuardWithTestForm(MethodType basicType) {
LambdaForm lform = basicType.form().cachedLambdaForm(MethodTypeForm.LF_GWT);
if (lform != null) return lform;
final int THIS_MH = 0; // the BMH_LLL
@@ -1026,8 +1020,7 @@
return basicType.form().setCachedLambdaForm(MethodTypeForm.LF_GWC, lform);
}
- static
- MethodHandle makeGuardWithCatch(MethodHandle target,
+ static MethodHandle makeGuardWithCatch(MethodHandle target,
Class<? extends Throwable> exType,
MethodHandle catcher) {
MethodType type = target.type();
@@ -1078,8 +1071,7 @@
return newArray;
}
- static
- MethodHandle throwException(MethodType type) {
+ static MethodHandle throwException(MethodType type) {
assert(Throwable.class.isAssignableFrom(type.parameterType(0)));
int arity = type.parameterCount();
if (arity > 1) {
@@ -1137,8 +1129,7 @@
* is sensitive to its caller. A small number of system methods
* are in this category, including Class.forName and Method.invoke.
*/
- static
- MethodHandle bindCaller(MethodHandle mh, Class<?> hostClass) {
+ static MethodHandle bindCaller(MethodHandle mh, Class<?> hostClass) {
return BindCaller.bindCaller(mh, hostClass);
}
@@ -1147,8 +1138,7 @@
private static class BindCaller {
private static MethodType INVOKER_MT = MethodType.methodType(Object.class, MethodHandle.class, Object[].class);
- static
- MethodHandle bindCaller(MethodHandle mh, Class<?> hostClass) {
+ static MethodHandle bindCaller(MethodHandle mh, Class<?> hostClass) {
// Code in the boot layer should now be careful while creating method handles or
// functional interface instances created from method references to @CallerSensitive methods,
// it needs to be ensured the handles or interface instances are kept safe and are not passed
@@ -1665,7 +1655,8 @@
return getConstantHandle(MH_copyAsPrimitiveArray).bindTo(Wrapper.forPrimitiveType(elemType));
}
- /*non-public*/ static void assertSame(Object mh1, Object mh2) {
+ /*non-public*/
+ static void assertSame(Object mh1, Object mh2) {
if (mh1 != mh2) {
String msg = String.format("mh1 != mh2: mh1 = %s (form: %s); mh2 = %s (form: %s)",
mh1, ((MethodHandle)mh1).form,
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandleInfo.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleInfo.java Thu Nov 21 09:10:21 2019 +0000
@@ -127,8 +127,7 @@
* </table>
* @since 1.8
*/
-public
-interface MethodHandleInfo {
+public interface MethodHandleInfo {
/**
* A direct method handle reference kind,
* as defined in the <a href="MethodHandleInfo.html#refkinds">table above</a>.
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java Thu Nov 21 09:10:21 2019 +0000
@@ -152,8 +152,7 @@
// generated adapter classes.
//
@CallerSensitive
- public static
- <T> T asInterfaceInstance(final Class<T> intfc, final MethodHandle target) {
+ public static <T> T asInterfaceInstance(final Class<T> intfc, final MethodHandle target) {
if (!intfc.isInterface() || !Modifier.isPublic(intfc.getModifiers()))
throw newIllegalArgumentException("not a public interface", intfc.getName());
final MethodHandle mh;
@@ -235,8 +234,7 @@
* @param x any reference
* @return true if the reference is not null and points to an object produced by {@code asInterfaceInstance}
*/
- public static
- boolean isWrapperInstance(Object x) {
+ public static boolean isWrapperInstance(Object x) {
return x instanceof WrapperInstance;
}
@@ -258,8 +256,7 @@
* @return a method handle implementing the unique method
* @throws IllegalArgumentException if the reference x is not to a wrapper instance
*/
- public static
- MethodHandle wrapperInstanceTarget(Object x) {
+ public static MethodHandle wrapperInstanceTarget(Object x) {
return asWrapperInstance(x).getWrapperInstanceTarget();
}
@@ -271,13 +268,11 @@
* @return the single-method interface type for which the wrapper was created
* @throws IllegalArgumentException if the reference x is not to a wrapper instance
*/
- public static
- Class<?> wrapperInstanceType(Object x) {
+ public static Class<?> wrapperInstanceType(Object x) {
return asWrapperInstance(x).getWrapperInstanceType();
}
- private static
- boolean isObjectMethod(Method m) {
+ private static boolean isObjectMethod(Method m) {
switch (m.getName()) {
case "toString":
return (m.getReturnType() == String.class
@@ -293,8 +288,7 @@
return false;
}
- private static
- Object callObjectMethod(Object self, Method m, Object[] args) {
+ private static Object callObjectMethod(Object self, Method m, Object[] args) {
assert(isObjectMethod(m)) : m;
switch (m.getName()) {
case "toString":
@@ -307,8 +301,7 @@
return null;
}
- private static
- Method[] getSingleNameMethods(Class<?> intfc) {
+ private static Method[] getSingleNameMethods(Class<?> intfc) {
ArrayList<Method> methods = new ArrayList<>();
String uniqueName = null;
for (Method m : intfc.getMethods()) {
@@ -325,13 +318,11 @@
return methods.toArray(new Method[methods.size()]);
}
- private static
- boolean isDefaultMethod(Method m) {
+ private static boolean isDefaultMethod(Method m) {
return !Modifier.isAbstract(m.getModifiers());
}
- private static
- boolean hasDefaultMethods(Class<?> intfc) {
+ private static boolean hasDefaultMethods(Class<?> intfc) {
for (Method m : intfc.getMethods()) {
if (!isObjectMethod(m) &&
!Modifier.isAbstract(m.getModifiers())) {
@@ -341,8 +332,7 @@
return false;
}
- private static
- Object callDefaultMethod(ConcurrentHashMap<Method, MethodHandle> defaultMethodMap,
+ private static Object callDefaultMethod(ConcurrentHashMap<Method, MethodHandle> defaultMethodMap,
Object self, Class<?> intfc, Method m, Object[] args) throws Throwable {
assert(isDefaultMethod(m) && !isObjectMethod(m)) : m;
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java Thu Nov 21 09:10:21 2019 +0000
@@ -36,7 +36,8 @@
* Usage: {@code import static java.lang.invoke.MethodHandleStatics.*}
* @author John Rose, JSR 292 EG
*/
-/*non-public*/ class MethodHandleStatics {
+/*non-public*/
+class MethodHandleStatics {
private MethodHandleStatics() { } // do not instantiate
@@ -95,7 +96,8 @@
/** Tell if any of the debugging switches are turned on.
* If this is the case, it is reasonable to perform extra checks or save extra information.
*/
- /*non-public*/ static boolean debugEnabled() {
+ /*non-public*/
+ static boolean debugEnabled() {
return (DEBUG_METHOD_HANDLE_NAMES |
DUMP_CLASS_FILES |
TRACE_INTERPRETER |
@@ -104,32 +106,41 @@
}
// handy shared exception makers (they simplify the common case code)
- /*non-public*/ static InternalError newInternalError(String message) {
+ /*non-public*/
+ static InternalError newInternalError(String message) {
return new InternalError(message);
}
- /*non-public*/ static InternalError newInternalError(String message, Exception cause) {
+ /*non-public*/
+ static InternalError newInternalError(String message, Exception cause) {
return new InternalError(message, cause);
}
- /*non-public*/ static InternalError newInternalError(Exception cause) {
+ /*non-public*/
+ static InternalError newInternalError(Exception cause) {
return new InternalError(cause);
}
- /*non-public*/ static RuntimeException newIllegalStateException(String message) {
+ /*non-public*/
+ static RuntimeException newIllegalStateException(String message) {
return new IllegalStateException(message);
}
- /*non-public*/ static RuntimeException newIllegalStateException(String message, Object obj) {
+ /*non-public*/
+ static RuntimeException newIllegalStateException(String message, Object obj) {
return new IllegalStateException(message(message, obj));
}
- /*non-public*/ static RuntimeException newIllegalArgumentException(String message) {
+ /*non-public*/
+ static RuntimeException newIllegalArgumentException(String message) {
return new IllegalArgumentException(message);
}
- /*non-public*/ static RuntimeException newIllegalArgumentException(String message, Object obj) {
+ /*non-public*/
+ static RuntimeException newIllegalArgumentException(String message, Object obj) {
return new IllegalArgumentException(message(message, obj));
}
- /*non-public*/ static RuntimeException newIllegalArgumentException(String message, Object obj, Object obj2) {
+ /*non-public*/
+ static RuntimeException newIllegalArgumentException(String message, Object obj, Object obj2) {
return new IllegalArgumentException(message(message, obj, obj2));
}
/** Propagate unchecked exceptions and errors, but wrap anything checked and throw that instead. */
- /*non-public*/ static Error uncaughtException(Throwable ex) {
+ /*non-public*/
+ static Error uncaughtException(Throwable ex) {
if (ex instanceof Error) throw (Error) ex;
if (ex instanceof RuntimeException) throw (RuntimeException) ex;
throw new InternalError("uncaught exception", ex);
@@ -142,11 +153,13 @@
if (obj != null || obj2 != null) message = message + ": " + obj + ", " + obj2;
return message;
}
- /*non-public*/ static void rangeCheck2(int start, int end, int size) {
+ /*non-public*/
+ static void rangeCheck2(int start, int end, int size) {
if (0 > start || start > end || end > size)
throw new IndexOutOfBoundsException(start+".."+end);
}
- /*non-public*/ static int rangeCheck1(int index, int size) {
+ /*non-public*/
+ static int rangeCheck1(int index, int size) {
if (0 > index || index >= size)
throw new IndexOutOfBoundsException(index);
return index;
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java Thu Nov 21 09:10:21 2019 +0000
@@ -280,8 +280,7 @@
* @throws ClassCastException if the member is not of the expected type
* @since 1.8
*/
- public static <T extends Member> T
- reflectAs(Class<T> expected, MethodHandle target) {
+ public static <T extends Member> T reflectAs(Class<T> expected, MethodHandle target) {
SecurityManager smgr = System.getSecurityManager();
if (smgr != null) smgr.checkPermission(ACCESS_PERMISSION);
Lookup lookup = Lookup.IMPL_LOOKUP; // use maximally privileged lookup
@@ -1764,8 +1763,7 @@
* <a href="MethodHandles.Lookup.html#secmgr">refuses access</a>
* @throws NullPointerException if any argument is null
*/
- public
- MethodHandle findStatic(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
+ public MethodHandle findStatic(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
MemberName method = resolveOrFail(REF_invokeStatic, refc, name, type);
return getDirectMethod(REF_invokeStatic, refc, method, findBoundCallerClass(method));
}
@@ -3177,7 +3175,8 @@
/** Hook called from the JVM (via MethodHandleNatives) to link MH constants:
*/
/*non-public*/
- MethodHandle linkMethodHandleConstant(byte refKind, Class<?> defc, String name, Object type) throws ReflectiveOperationException {
+ MethodHandle linkMethodHandleConstant(byte refKind, Class<?> defc, String name, Object type)
+ throws ReflectiveOperationException {
if (!(type instanceof Class || type instanceof MethodType))
throw new InternalError("unresolved MemberName");
MemberName member = new MemberName(refKind, defc, name, type);
@@ -3213,8 +3212,7 @@
}
return mh;
}
- private
- boolean canBeCached(byte refKind, Class<?> defc, MemberName member) {
+ private boolean canBeCached(byte refKind, Class<?> defc, MemberName member) {
if (refKind == REF_invokeSpecial) {
return false;
}
@@ -3248,8 +3246,7 @@
}
return true;
}
- private
- MethodHandle getDirectMethodForConstant(byte refKind, Class<?> defc, MemberName member)
+ private MethodHandle getDirectMethodForConstant(byte refKind, Class<?> defc, MemberName member)
throws ReflectiveOperationException {
if (MethodHandleNatives.refKindIsField(refKind)) {
return getDirectFieldNoSecurityManager(refKind, defc, member);
@@ -3282,8 +3279,7 @@
* @jvms 6.5 {@code anewarray} Instruction
* @since 9
*/
- public static
- MethodHandle arrayConstructor(Class<?> arrayClass) throws IllegalArgumentException {
+ public static MethodHandle arrayConstructor(Class<?> arrayClass) throws IllegalArgumentException {
if (!arrayClass.isArray()) {
throw newIllegalArgumentException("not an array class: " + arrayClass.getName());
}
@@ -3308,8 +3304,7 @@
* @jvms 6.5 {@code arraylength} Instruction
* @since 9
*/
- public static
- MethodHandle arrayLength(Class<?> arrayClass) throws IllegalArgumentException {
+ public static MethodHandle arrayLength(Class<?> arrayClass) throws IllegalArgumentException {
return MethodHandleImpl.makeArrayElementAccessor(arrayClass, MethodHandleImpl.ArrayAccess.LENGTH);
}
@@ -3333,8 +3328,7 @@
* @throws IllegalArgumentException if arrayClass is not an array type
* @jvms 6.5 {@code aaload} Instruction
*/
- public static
- MethodHandle arrayElementGetter(Class<?> arrayClass) throws IllegalArgumentException {
+ public static MethodHandle arrayElementGetter(Class<?> arrayClass) throws IllegalArgumentException {
return MethodHandleImpl.makeArrayElementAccessor(arrayClass, MethodHandleImpl.ArrayAccess.GET);
}
@@ -3358,8 +3352,7 @@
* @throws IllegalArgumentException if arrayClass is not an array type
* @jvms 6.5 {@code aastore} Instruction
*/
- public static
- MethodHandle arrayElementSetter(Class<?> arrayClass) throws IllegalArgumentException {
+ public static MethodHandle arrayElementSetter(Class<?> arrayClass) throws IllegalArgumentException {
return MethodHandleImpl.makeArrayElementAccessor(arrayClass, MethodHandleImpl.ArrayAccess.SET);
}
@@ -3423,8 +3416,7 @@
* @throws IllegalArgumentException if arrayClass is not an array type
* @since 9
*/
- public static
- VarHandle arrayElementVarHandle(Class<?> arrayClass) throws IllegalArgumentException {
+ public static VarHandle arrayElementVarHandle(Class<?> arrayClass) throws IllegalArgumentException {
return VarHandles.makeArrayElementHandle(arrayClass);
}
@@ -3504,8 +3496,7 @@
* viewArrayClass is not supported as a variable type
* @since 9
*/
- public static
- VarHandle byteArrayViewVarHandle(Class<?> viewArrayClass,
+ public static VarHandle byteArrayViewVarHandle(Class<?> viewArrayClass,
ByteOrder byteOrder) throws IllegalArgumentException {
Objects.requireNonNull(byteOrder);
return VarHandles.byteArrayViewHandle(viewArrayClass,
@@ -3592,8 +3583,7 @@
* viewArrayClass is not supported as a variable type
* @since 9
*/
- public static
- VarHandle byteBufferViewVarHandle(Class<?> viewArrayClass,
+ public static VarHandle byteBufferViewVarHandle(Class<?> viewArrayClass,
ByteOrder byteOrder) throws IllegalArgumentException {
Objects.requireNonNull(byteOrder);
return VarHandles.makeByteBufferViewHandle(viewArrayClass,
@@ -3649,8 +3639,7 @@
* or if the resulting method handle's type would have
* <a href="MethodHandle.html#maxarity">too many parameters</a>
*/
- public static
- MethodHandle spreadInvoker(MethodType type, int leadingArgCount) {
+ public static MethodHandle spreadInvoker(MethodType type, int leadingArgCount) {
if (leadingArgCount < 0 || leadingArgCount > type.parameterCount())
throw newIllegalArgumentException("bad argument count", leadingArgCount);
type = type.asSpreaderType(Object[].class, leadingArgCount, type.parameterCount() - leadingArgCount);
@@ -3692,8 +3681,7 @@
* @throws IllegalArgumentException if the resulting method handle's type would have
* <a href="MethodHandle.html#maxarity">too many parameters</a>
*/
- public static
- MethodHandle exactInvoker(MethodType type) {
+ public static MethodHandle exactInvoker(MethodType type) {
return type.invokers().exactInvoker();
}
@@ -3731,8 +3719,7 @@
* @throws IllegalArgumentException if the resulting method handle's type would have
* <a href="MethodHandle.html#maxarity">too many parameters</a>
*/
- public static
- MethodHandle invoker(MethodType type) {
+ public static MethodHandle invoker(MethodType type) {
return type.invokers().genericInvoker();
}
@@ -3750,8 +3737,7 @@
* any VarHandle whose access mode type is of the given type.
* @since 9
*/
- static public
- MethodHandle varHandleExactInvoker(VarHandle.AccessMode accessMode, MethodType type) {
+ public static MethodHandle varHandleExactInvoker(VarHandle.AccessMode accessMode, MethodType type) {
return type.invokers().varHandleMethodExactInvoker(accessMode);
}
@@ -3779,13 +3765,12 @@
* type.
* @since 9
*/
- static public
- MethodHandle varHandleInvoker(VarHandle.AccessMode accessMode, MethodType type) {
+ public static MethodHandle varHandleInvoker(VarHandle.AccessMode accessMode, MethodType type) {
return type.invokers().varHandleMethodInvoker(accessMode);
}
- static /*non-public*/
- MethodHandle basicInvoker(MethodType type) {
+ /*non-public*/
+ static MethodHandle basicInvoker(MethodType type) {
return type.invokers().basicInvoker();
}
@@ -3835,8 +3820,7 @@
* @throws WrongMethodTypeException if the conversion cannot be made
* @see MethodHandle#asType
*/
- public static
- MethodHandle explicitCastArguments(MethodHandle target, MethodType newType) {
+ public static MethodHandle explicitCastArguments(MethodHandle target, MethodType newType) {
explicitCastArgumentsChecks(target, newType);
// use the asTypeCache when possible:
MethodType oldType = target.type();
@@ -3915,8 +3899,7 @@
* or if two corresponding parameter types in
* {@code target.type()} and {@code newType} are not identical,
*/
- public static
- MethodHandle permuteArguments(MethodHandle target, MethodType newType, int... reorder) {
+ public static MethodHandle permuteArguments(MethodHandle target, MethodType newType, int... reorder) {
reorder = reorder.clone(); // get a private copy
MethodType oldType = target.type();
permuteArgumentChecks(reorder, newType, oldType);
@@ -4075,8 +4058,7 @@
* @throws ClassCastException if the value cannot be converted to the required return type
* @throws IllegalArgumentException if the given type is {@code void.class}
*/
- public static
- MethodHandle constant(Class<?> type, Object value) {
+ public static MethodHandle constant(Class<?> type, Object value) {
if (type.isPrimitive()) {
if (type == void.class)
throw newIllegalArgumentException("void type");
@@ -4099,8 +4081,7 @@
* @throws NullPointerException if the argument is null
* @throws IllegalArgumentException if the given type is {@code void.class}
*/
- public static
- MethodHandle identity(Class<?> type) {
+ public static MethodHandle identity(Class<?> type) {
Wrapper btw = (type.isPrimitive() ? Wrapper.forPrimitiveType(type) : Wrapper.OBJECT);
int pos = btw.ordinal();
MethodHandle ident = IDENTITY_MHS[pos];
@@ -4230,8 +4211,7 @@
* type.
* @see MethodHandle#bindTo
*/
- public static
- MethodHandle insertArguments(MethodHandle target, int pos, Object... values) {
+ public static MethodHandle insertArguments(MethodHandle target, int pos, Object... values) {
int insCount = values.length;
Class<?>[] ptypes = insertArgumentsChecks(target, insCount, pos);
if (insCount == 0) return target;
@@ -4316,8 +4296,7 @@
* or if {@code pos} is negative or greater than the arity of the target,
* or if the new method handle's type would have too many parameters
*/
- public static
- MethodHandle dropArguments(MethodHandle target, int pos, List<Class<?>> valueTypes) {
+ public static MethodHandle dropArguments(MethodHandle target, int pos, List<Class<?>> valueTypes) {
return dropArguments0(target, pos, copyTypes(valueTypes.toArray()));
}
@@ -4325,8 +4304,7 @@
return Arrays.asList(Arrays.copyOf(array, array.length, Class[].class));
}
- private static
- MethodHandle dropArguments0(MethodHandle target, int pos, List<Class<?>> valueTypes) {
+ private static MethodHandle dropArguments0(MethodHandle target, int pos, List<Class<?>> valueTypes) {
MethodType oldType = target.type(); // get NPE
int dropped = dropArgumentChecks(oldType, pos, valueTypes);
MethodType newType = oldType.insertParameterTypes(pos, valueTypes);
@@ -4399,8 +4377,7 @@
* or if the new method handle's type would have
* <a href="MethodHandle.html#maxarity">too many parameters</a>
*/
- public static
- MethodHandle dropArguments(MethodHandle target, int pos, Class<?>... valueTypes) {
+ public static MethodHandle dropArguments(MethodHandle target, int pos, Class<?>... valueTypes) {
return dropArguments0(target, pos, copyTypes(valueTypes));
}
@@ -4506,8 +4483,7 @@
* {@code pos}.
* @since 9
*/
- public static
- MethodHandle dropArgumentsToMatch(MethodHandle target, int skip, List<Class<?>> newTypes, int pos) {
+ public static MethodHandle dropArgumentsToMatch(MethodHandle target, int skip, List<Class<?>> newTypes, int pos) {
Objects.requireNonNull(target);
Objects.requireNonNull(newTypes);
return dropArgumentsToMatch(target, skip, newTypes, pos, false);
@@ -4590,8 +4566,7 @@
* or if the resulting method handle's type would have
* <a href="MethodHandle.html#maxarity">too many parameters</a>
*/
- public static
- MethodHandle filterArguments(MethodHandle target, int pos, MethodHandle... filters) {
+ public static MethodHandle filterArguments(MethodHandle target, int pos, MethodHandle... filters) {
// In method types arguments start at index 0, while the LF
// editor have the MH receiver at position 0 - adjust appropriately.
final int MH_RECEIVER_OFFSET = 1;
@@ -4649,8 +4624,8 @@
return result.copyWithExtendL(newType, lform, filter);
}
- /*non-public*/ static
- MethodHandle filterArgument(MethodHandle target, int pos, MethodHandle filter) {
+ /*non-public*/
+ static MethodHandle filterArgument(MethodHandle target, int pos, MethodHandle filter) {
filterArgumentChecks(target, pos, filter);
MethodType targetType = target.type();
MethodType filterType = filter.type();
@@ -4796,8 +4771,7 @@
* @see MethodHandles#filterArguments
* @see MethodHandles#filterReturnValue
*/
- public static
- MethodHandle collectArguments(MethodHandle target, int pos, MethodHandle filter) {
+ public static MethodHandle collectArguments(MethodHandle target, int pos, MethodHandle filter) {
MethodType newType = collectArgumentsChecks(target, pos, filter);
MethodType collectorType = filter.type();
BoundMethodHandle result = target.rebind();
@@ -4890,8 +4864,7 @@
* @throws IllegalArgumentException if the argument list of {@code filter}
* does not match the return type of target as described above
*/
- public static
- MethodHandle filterReturnValue(MethodHandle target, MethodHandle filter) {
+ public static MethodHandle filterReturnValue(MethodHandle target, MethodHandle filter) {
MethodType targetType = target.type();
MethodType filterType = filter.type();
filterReturnValueChecks(targetType, filterType);
@@ -4999,8 +4972,7 @@
* (skipping one matching the {@code combiner}'s return type)
* are not identical with the argument types of {@code combiner}
*/
- public static
- MethodHandle foldArguments(MethodHandle target, MethodHandle combiner) {
+ public static MethodHandle foldArguments(MethodHandle target, MethodHandle combiner) {
return foldArguments(target, 0, combiner);
}
@@ -5127,7 +5099,8 @@
* (2) the {@code N} argument types at positions {@code argPositions[1...N]} of the target signature are
* not identical with the argument types of {@code combiner}.
*/
- /*non-public*/ static MethodHandle filterArgumentsWithCombiner(MethodHandle target, int position, MethodHandle combiner, int ... argPositions) {
+ /*non-public*/
+ static MethodHandle filterArgumentsWithCombiner(MethodHandle target, int position, MethodHandle combiner, int ... argPositions) {
return argumentsWithCombiner(true, target, position, combiner, argPositions);
}
@@ -5149,7 +5122,8 @@
* (skipping {@code position} where the {@code combiner}'s return will be folded in) are not identical
* with the argument types of {@code combiner}.
*/
- /*non-public*/ static MethodHandle foldArgumentsWithCombiner(MethodHandle target, int position, MethodHandle combiner, int ... argPositions) {
+ /*non-public*/
+ static MethodHandle foldArgumentsWithCombiner(MethodHandle target, int position, MethodHandle combiner, int ... argPositions) {
return argumentsWithCombiner(false, target, position, combiner, argPositions);
}
@@ -5236,8 +5210,7 @@
* or if all three method types do not match (with the return
* type of {@code test} changed to match that of the target).
*/
- public static
- MethodHandle guardWithTest(MethodHandle test,
+ public static MethodHandle guardWithTest(MethodHandle test,
MethodHandle target,
MethodHandle fallback) {
MethodType gtype = test.type();
@@ -5309,8 +5282,7 @@
* corresponding parameters
* @see MethodHandles#tryFinally(MethodHandle, MethodHandle)
*/
- public static
- MethodHandle catchException(MethodHandle target,
+ public static MethodHandle catchException(MethodHandle target,
Class<? extends Throwable> exType,
MethodHandle handler) {
MethodType ttype = target.type();
@@ -5341,8 +5313,7 @@
* @return method handle which can throw the given exceptions
* @throws NullPointerException if either argument is null
*/
- public static
- MethodHandle throwException(Class<?> returnType, Class<? extends Throwable> exType) {
+ public static MethodHandle throwException(Class<?> returnType, Class<? extends Throwable> exType) {
if (!Throwable.class.isAssignableFrom(exType))
throw new ClassCastException(exType.getName());
return MethodHandleImpl.throwException(methodType(returnType, exType));
@@ -6650,7 +6621,8 @@
return iterableType; // help the caller a bit
}
- /*non-public*/ static MethodHandle swapArguments(MethodHandle mh, int i, int j) {
+ /*non-public*/
+ static MethodHandle swapArguments(MethodHandle mh, int i, int j) {
// there should be a better way to uncross my wires
int arity = mh.type().parameterCount();
int[] order = new int[arity];
--- a/src/java.base/share/classes/java/lang/invoke/MethodType.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/invoke/MethodType.java Thu Nov 21 09:10:21 2019 +0000
@@ -142,7 +142,8 @@
* {@code staticMethod(arg1, arg2, ..., arg255)} or
* {@code x.virtualMethod(arg1, arg2, ..., arg254)}.
*/
- /*non-public*/ static final int MAX_JVM_ARITY = 255; // this is mandated by the JVM spec.
+ /*non-public*/
+ static final int MAX_JVM_ARITY = 255; // this is mandated by the JVM spec.
/** This number is the maximum arity of a method handle, 254.
* It is derived from the absolute JVM-imposed arity by subtracting one,
@@ -152,7 +153,8 @@
* {@code mh.invoke(arg1, arg2, ..., arg254)}.
*/
// Issue: Should we allow MH.invokeWithArguments to go to the full 255?
- /*non-public*/ static final int MAX_MH_ARITY = MAX_JVM_ARITY-1; // deduct one for mh receiver
+ /*non-public*/
+ static final int MAX_MH_ARITY = MAX_JVM_ARITY-1; // deduct one for mh receiver
/** This number is the maximum arity of a method handle invoker, 253.
* It is derived from the absolute JVM-imposed arity by subtracting two,
@@ -162,7 +164,8 @@
* The longest possible invocation will look like
* {@code invokermh.invoke(targetmh, arg1, arg2, ..., arg253)}.
*/
- /*non-public*/ static final int MAX_MH_INVOKER_ARITY = MAX_MH_ARITY-1; // deduct one more for invoker
+ /*non-public*/
+ static final int MAX_MH_INVOKER_ARITY = MAX_MH_ARITY-1; // deduct one more for invoker
private static void checkRtype(Class<?> rtype) {
Objects.requireNonNull(rtype);
@@ -210,8 +213,7 @@
* @throws NullPointerException if {@code rtype} or {@code ptypes} or any element of {@code ptypes} is null
* @throws IllegalArgumentException if any element of {@code ptypes} is {@code void.class}
*/
- public static
- MethodType methodType(Class<?> rtype, Class<?>[] ptypes) {
+ public static MethodType methodType(Class<?> rtype, Class<?>[] ptypes) {
return makeImpl(rtype, ptypes, false);
}
@@ -224,8 +226,7 @@
* @throws NullPointerException if {@code rtype} or {@code ptypes} or any element of {@code ptypes} is null
* @throws IllegalArgumentException if any element of {@code ptypes} is {@code void.class}
*/
- public static
- MethodType methodType(Class<?> rtype, List<Class<?>> ptypes) {
+ public static MethodType methodType(Class<?> rtype, List<Class<?>> ptypes) {
boolean notrust = false; // random List impl. could return evil ptypes array
return makeImpl(rtype, listToArray(ptypes), notrust);
}
@@ -247,8 +248,7 @@
* @throws NullPointerException if {@code rtype} or {@code ptype0} or {@code ptypes} or any element of {@code ptypes} is null
* @throws IllegalArgumentException if {@code ptype0} or {@code ptypes} or any element of {@code ptypes} is {@code void.class}
*/
- public static
- MethodType methodType(Class<?> rtype, Class<?> ptype0, Class<?>... ptypes) {
+ public static MethodType methodType(Class<?> rtype, Class<?> ptype0, Class<?>... ptypes) {
Class<?>[] ptypes1 = new Class<?>[1+ptypes.length];
ptypes1[0] = ptype0;
System.arraycopy(ptypes, 0, ptypes1, 1, ptypes.length);
@@ -263,8 +263,7 @@
* @return a method type with the given return value
* @throws NullPointerException if {@code rtype} is null
*/
- public static
- MethodType methodType(Class<?> rtype) {
+ public static MethodType methodType(Class<?> rtype) {
return makeImpl(rtype, NO_PTYPES, true);
}
@@ -278,8 +277,7 @@
* @throws NullPointerException if {@code rtype} or {@code ptype0} is null
* @throws IllegalArgumentException if {@code ptype0} is {@code void.class}
*/
- public static
- MethodType methodType(Class<?> rtype, Class<?> ptype0) {
+ public static MethodType methodType(Class<?> rtype, Class<?> ptype0) {
return makeImpl(rtype, new Class<?>[]{ ptype0 }, true);
}
@@ -293,8 +291,7 @@
* @return a method type with the given components
* @throws NullPointerException if {@code rtype} or {@code ptypes} is null
*/
- public static
- MethodType methodType(Class<?> rtype, MethodType ptypes) {
+ public static MethodType methodType(Class<?> rtype, MethodType ptypes) {
return makeImpl(rtype, ptypes.ptypes, true);
}
@@ -305,8 +302,8 @@
* @param trusted whether the ptypes can be used without cloning
* @return the unique method type of the desired structure
*/
- /*trusted*/ static
- MethodType makeImpl(Class<?> rtype, Class<?>[] ptypes, boolean trusted) {
+ /*trusted*/
+ static MethodType makeImpl(Class<?> rtype, Class<?>[] ptypes, boolean trusted) {
if (ptypes.length == 0) {
ptypes = NO_PTYPES; trusted = true;
}
@@ -342,8 +339,7 @@
* @throws IllegalArgumentException if {@code objectArgCount} is negative or greater than 255 (or 254, if {@code finalArray} is true)
* @see #genericMethodType(int)
*/
- public static
- MethodType genericMethodType(int objectArgCount, boolean finalArray) {
+ public static MethodType genericMethodType(int objectArgCount, boolean finalArray) {
MethodType mt;
checkSlotCount(objectArgCount);
int ivarargs = (!finalArray ? 0 : 1);
@@ -371,8 +367,7 @@
* @throws IllegalArgumentException if {@code objectArgCount} is negative or greater than 255
* @see #genericMethodType(int, boolean)
*/
- public static
- MethodType genericMethodType(int objectArgCount) {
+ public static MethodType genericMethodType(int objectArgCount) {
return genericMethodType(objectArgCount, false);
}
@@ -479,7 +474,8 @@
* or if the resulting method type would have more than 255 parameter slots
* @throws NullPointerException if {@code ptypesToInsert} or any of its elements is null
*/
- /*non-public*/ MethodType replaceParameterTypes(int start, int end, Class<?>... ptypesToInsert) {
+ /*non-public*/
+ MethodType replaceParameterTypes(int start, int end, Class<?>... ptypesToInsert) {
if (start == end)
return insertParameterTypes(start, ptypesToInsert);
int len = ptypes.length;
@@ -497,7 +493,8 @@
* @param arrayLength the number of parameter types to change
* @return the resulting type
*/
- /*non-public*/ MethodType asSpreaderType(Class<?> arrayType, int pos, int arrayLength) {
+ /*non-public*/
+ MethodType asSpreaderType(Class<?> arrayType, int pos, int arrayLength) {
assert(parameterCount() >= arrayLength);
int spreadPos = pos;
if (arrayLength == 0) return this; // nothing to change
@@ -527,7 +524,8 @@
/** Return the leading parameter type, which must exist and be a reference.
* @return the leading parameter type, after error checks
*/
- /*non-public*/ Class<?> leadingReferenceParameter() {
+ /*non-public*/
+ Class<?> leadingReferenceParameter() {
Class<?> ptype;
if (ptypes.length == 0 ||
(ptype = ptypes[0]).isPrimitive())
@@ -541,7 +539,8 @@
* @param arrayLength the number of parameter types to insert
* @return the resulting type
*/
- /*non-public*/ MethodType asCollectorType(Class<?> arrayType, int pos, int arrayLength) {
+ /*non-public*/
+ MethodType asCollectorType(Class<?> arrayType, int pos, int arrayLength) {
assert(parameterCount() >= 1);
assert(pos < ptypes.length);
assert(ptypes[pos].isAssignableFrom(arrayType));
@@ -652,7 +651,8 @@
* such as {@link MethodHandle#invokeBasic invokeBasic}.
* @return a version of the original type with all reference and subword types replaced
*/
- /*non-public*/ MethodType basicType() {
+ /*non-public*/
+ MethodType basicType() {
return form.basicType();
}
@@ -662,7 +662,8 @@
/**
* @return a version of the original type with MethodHandle prepended as the first argument
*/
- /*non-public*/ MethodType invokerType() {
+ /*non-public*/
+ MethodType invokerType() {
return insertParameterTypes(0, METHOD_HANDLE_ARRAY);
}
@@ -677,7 +678,8 @@
return genericMethodType(parameterCount());
}
- /*non-public*/ boolean isGeneric() {
+ /*non-public*/
+ boolean isGeneric() {
return this == erase() && !hasPrimitives();
}
@@ -1064,11 +1066,13 @@
* generate bytecodes that process method handles and invokedynamic.
* @return the number of JVM stack slots for this type's parameters
*/
- /*non-public*/ int parameterSlotCount() {
+ /*non-public*/
+ int parameterSlotCount() {
return form.parameterSlotCount();
}
- /*non-public*/ Invokers invokers() {
+ /*non-public*/
+ Invokers invokers() {
Invokers inv = invokers;
if (inv != null) return inv;
invokers = inv = new Invokers(this);
@@ -1167,7 +1171,8 @@
return toMethodDescriptorString();
}
- /*non-public*/ static String toFieldDescriptorString(Class<?> cls) {
+ /*non-public*/
+ static String toFieldDescriptorString(Class<?> cls) {
return BytecodeDescriptor.unparse(cls);
}
--- a/src/java.base/share/classes/java/lang/invoke/SimpleMethodHandle.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/invoke/SimpleMethodHandle.java Thu Nov 21 09:10:21 2019 +0000
@@ -40,19 +40,23 @@
super(type, form);
}
- /*non-public*/ static BoundMethodHandle make(MethodType type, LambdaForm form) {
+ /*non-public*/
+ static BoundMethodHandle make(MethodType type, LambdaForm form) {
return new SimpleMethodHandle(type, form);
}
- /*non-public*/ static @Stable BoundMethodHandle.SpeciesData BMH_SPECIES;
+ /*non-public*/
+ static @Stable BoundMethodHandle.SpeciesData BMH_SPECIES;
@Override
- /*non-public*/ BoundMethodHandle.SpeciesData speciesData() {
+ /*non-public*/
+ BoundMethodHandle.SpeciesData speciesData() {
return BMH_SPECIES;
}
@Override
- /*non-public*/ BoundMethodHandle copyWith(MethodType mt, LambdaForm lf) {
+ /*non-public*/
+ BoundMethodHandle copyWith(MethodType mt, LambdaForm lf) {
return make(mt, lf);
}
@@ -62,11 +66,13 @@
}
@Override
- /*non-public*/ final BoundMethodHandle copyWithExtendL(MethodType mt, LambdaForm lf, Object narg) {
+ /*non-public*/
+ final BoundMethodHandle copyWithExtendL(MethodType mt, LambdaForm lf, Object narg) {
return BoundMethodHandle.bindSingle(mt, lf, narg); // Use known fast path.
}
@Override
- /*non-public*/ final BoundMethodHandle copyWithExtendI(MethodType mt, LambdaForm lf, int narg) {
+ /*non-public*/
+ final BoundMethodHandle copyWithExtendI(MethodType mt, LambdaForm lf, int narg) {
try {
return (BoundMethodHandle) BMH_SPECIES.extendWith(I_TYPE_NUM).factory().invokeBasic(mt, lf, narg);
} catch (Throwable ex) {
@@ -74,7 +80,8 @@
}
}
@Override
- /*non-public*/ final BoundMethodHandle copyWithExtendJ(MethodType mt, LambdaForm lf, long narg) {
+ /*non-public*/
+ final BoundMethodHandle copyWithExtendJ(MethodType mt, LambdaForm lf, long narg) {
try {
return (BoundMethodHandle) BMH_SPECIES.extendWith(J_TYPE_NUM).factory().invokeBasic(mt, lf, narg);
} catch (Throwable ex) {
@@ -82,7 +89,8 @@
}
}
@Override
- /*non-public*/ final BoundMethodHandle copyWithExtendF(MethodType mt, LambdaForm lf, float narg) {
+ /*non-public*/
+ final BoundMethodHandle copyWithExtendF(MethodType mt, LambdaForm lf, float narg) {
try {
return (BoundMethodHandle) BMH_SPECIES.extendWith(F_TYPE_NUM).factory().invokeBasic(mt, lf, narg);
} catch (Throwable ex) {
@@ -90,7 +98,8 @@
}
}
@Override
- /*non-public*/ final BoundMethodHandle copyWithExtendD(MethodType mt, LambdaForm lf, double narg) {
+ /*non-public*/
+ final BoundMethodHandle copyWithExtendD(MethodType mt, LambdaForm lf, double narg) {
try {
return (BoundMethodHandle) BMH_SPECIES.extendWith(D_TYPE_NUM).factory().invokeBasic(mt, lf, narg);
} catch (Throwable ex) {
--- a/src/java.base/share/classes/java/lang/invoke/WrongMethodTypeException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/invoke/WrongMethodTypeException.java Thu Nov 21 09:10:21 2019 +0000
@@ -69,7 +69,8 @@
* @param cause the cause of the exception, or null.
*/
//FIXME: make this public in MR1
- /*non-public*/ WrongMethodTypeException(String s, Throwable cause) {
+ /*non-public*/
+ WrongMethodTypeException(String s, Throwable cause) {
super(s, cause);
}
@@ -80,7 +81,8 @@
* @param cause the cause of the exception, or null.
*/
//FIXME: make this public in MR1
- /*non-public*/ WrongMethodTypeException(Throwable cause) {
+ /*non-public*/
+ WrongMethodTypeException(Throwable cause) {
super(cause);
}
}
--- a/src/java.base/share/classes/java/lang/reflect/Member.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/lang/reflect/Member.java Thu Nov 21 09:10:21 2019 +0000
@@ -37,8 +37,7 @@
* @author Nakul Saraiya
* @since 1.1
*/
-public
-interface Member {
+public interface Member {
/**
* Identifies the set of all public members of a class or interface,
--- a/src/java.base/share/classes/java/net/DatagramSocket.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/net/DatagramSocket.java Thu Nov 21 09:10:21 2019 +0000
@@ -66,8 +66,7 @@
* @see java.nio.channels.DatagramChannel
* @since 1.0
*/
-public
-class DatagramSocket implements java.io.Closeable {
+public class DatagramSocket implements java.io.Closeable {
/**
* Various states of this socket.
*/
--- a/src/java.base/share/classes/java/net/DatagramSocketImplFactory.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/net/DatagramSocketImplFactory.java Thu Nov 21 09:10:21 2019 +0000
@@ -34,8 +34,7 @@
* @see java.net.DatagramSocket
* @since 1.3
*/
-public
-interface DatagramSocketImplFactory {
+public interface DatagramSocketImplFactory {
/**
* Creates a new {@code DatagramSocketImpl} instance.
*
--- a/src/java.base/share/classes/java/net/HttpRetryException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/net/HttpRetryException.java Thu Nov 21 09:10:21 2019 +0000
@@ -35,8 +35,7 @@
* @author Michael McMahon
* @since 1.5
*/
-public
-class HttpRetryException extends IOException {
+public class HttpRetryException extends IOException {
@java.io.Serial
private static final long serialVersionUID = -9186022286469111381L;
--- a/src/java.base/share/classes/java/net/InetAddress.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/net/InetAddress.java Thu Nov 21 09:10:21 2019 +0000
@@ -196,8 +196,7 @@
* @see java.net.InetAddress#getLocalHost()
* @since 1.0
*/
-public
-class InetAddress implements java.io.Serializable {
+public class InetAddress implements java.io.Serializable {
@Native static final int PREFER_IPV4_VALUE = 0;
@Native static final int PREFER_IPV6_VALUE = 1;
--- a/src/java.base/share/classes/java/net/MulticastSocket.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/net/MulticastSocket.java Thu Nov 21 09:10:21 2019 +0000
@@ -83,8 +83,7 @@
* @author Pavani Diwanji
* @since 1.1
*/
-public
-class MulticastSocket extends DatagramSocket {
+public class MulticastSocket extends DatagramSocket {
/**
* Used on some platforms to record if an outgoing interface
--- a/src/java.base/share/classes/java/net/ProtocolException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/net/ProtocolException.java Thu Nov 21 09:10:21 2019 +0000
@@ -34,8 +34,7 @@
* @author Chris Warth
* @since 1.0
*/
-public
-class ProtocolException extends IOException {
+public class ProtocolException extends IOException {
@java.io.Serial
private static final long serialVersionUID = -6098449442062388080L;
--- a/src/java.base/share/classes/java/net/ServerSocket.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/net/ServerSocket.java Thu Nov 21 09:10:21 2019 +0000
@@ -52,8 +52,7 @@
* @see java.nio.channels.ServerSocketChannel
* @since 1.0
*/
-public
-class ServerSocket implements java.io.Closeable {
+public class ServerSocket implements java.io.Closeable {
/**
* Various states of this socket.
*/
--- a/src/java.base/share/classes/java/net/Socket.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/net/Socket.java Thu Nov 21 09:10:21 2019 +0000
@@ -56,8 +56,7 @@
* @see java.nio.channels.SocketChannel
* @since 1.0
*/
-public
-class Socket implements java.io.Closeable {
+public class Socket implements java.io.Closeable {
/**
* Various states of this socket.
*/
--- a/src/java.base/share/classes/java/net/SocketException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/net/SocketException.java Thu Nov 21 09:10:21 2019 +0000
@@ -33,8 +33,7 @@
* @author Jonathan Payne
* @since 1.0
*/
-public
-class SocketException extends IOException {
+public class SocketException extends IOException {
@java.io.Serial
private static final long serialVersionUID = -5935874303556886934L;
--- a/src/java.base/share/classes/java/net/SocketImplFactory.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/net/SocketImplFactory.java Thu Nov 21 09:10:21 2019 +0000
@@ -36,8 +36,7 @@
* @see java.net.ServerSocket
* @since 1.0
*/
-public
-interface SocketImplFactory {
+public interface SocketImplFactory {
/**
* Creates a new {@code SocketImpl} instance.
*
--- a/src/java.base/share/classes/java/net/UnknownHostException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/net/UnknownHostException.java Thu Nov 21 09:10:21 2019 +0000
@@ -33,8 +33,7 @@
* @author Jonathan Payne
* @since 1.0
*/
-public
-class UnknownHostException extends IOException {
+public class UnknownHostException extends IOException {
@java.io.Serial
private static final long serialVersionUID = -4639126076052875403L;
--- a/src/java.base/share/classes/java/text/ParseException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/text/ParseException.java Thu Nov 21 09:10:21 2019 +0000
@@ -47,8 +47,7 @@
* @author Mark Davis
* @since 1.1
*/
-public
-class ParseException extends Exception {
+public class ParseException extends Exception {
@java.io.Serial
private static final long serialVersionUID = 2703218443322787634L;
--- a/src/java.base/share/classes/java/util/EmptyStackException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/EmptyStackException.java Thu Nov 21 09:10:21 2019 +0000
@@ -33,8 +33,7 @@
* @see java.util.Stack
* @since 1.0
*/
-public
-class EmptyStackException extends RuntimeException {
+public class EmptyStackException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = 5084686378493302095L;
--- a/src/java.base/share/classes/java/util/InputMismatchException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/InputMismatchException.java Thu Nov 21 09:10:21 2019 +0000
@@ -34,8 +34,7 @@
* @see java.util.Scanner
* @since 1.5
*/
-public
-class InputMismatchException extends NoSuchElementException {
+public class InputMismatchException extends NoSuchElementException {
@java.io.Serial
private static final long serialVersionUID = 8811230760997066428L;
--- a/src/java.base/share/classes/java/util/MissingResourceException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/MissingResourceException.java Thu Nov 21 09:10:21 2019 +0000
@@ -47,8 +47,7 @@
* @author Mark Davis
* @since 1.1
*/
-public
-class MissingResourceException extends RuntimeException {
+public class MissingResourceException extends RuntimeException {
/**
* Constructs a MissingResourceException with the specified information.
--- a/src/java.base/share/classes/java/util/NoSuchElementException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/NoSuchElementException.java Thu Nov 21 09:10:21 2019 +0000
@@ -34,8 +34,7 @@
* @see java.util.Iterator#next()
* @since 1.0
*/
-public
-class NoSuchElementException extends RuntimeException {
+public class NoSuchElementException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = 6769829250639411880L;
--- a/src/java.base/share/classes/java/util/Properties.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/Properties.java Thu Nov 21 09:10:21 2019 +0000
@@ -137,8 +137,7 @@
* @author Xueming Shen
* @since 1.0
*/
-public
-class Properties extends Hashtable<Object,Object> {
+public class Properties extends Hashtable<Object,Object> {
/**
* use serialVersionUID from JDK 1.1.X for interoperability
*/
--- a/src/java.base/share/classes/java/util/Random.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/Random.java Thu Nov 21 09:10:21 2019 +0000
@@ -73,8 +73,7 @@
* @author Frank Yellin
* @since 1.0
*/
-public
-class Random implements java.io.Serializable {
+public class Random implements java.io.Serializable {
/** use serialVersionUID from JDK 1.1 for interoperability */
@java.io.Serial
static final long serialVersionUID = 3905348978240129619L;
--- a/src/java.base/share/classes/java/util/Stack.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/Stack.java Thu Nov 21 09:10:21 2019 +0000
@@ -45,8 +45,7 @@
* @author Jonathan Payne
* @since 1.0
*/
-public
-class Stack<E> extends Vector<E> {
+public class Stack<E> extends Vector<E> {
/**
* Creates an empty Stack.
*/
--- a/src/java.base/share/classes/java/util/StringTokenizer.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/StringTokenizer.java Thu Nov 21 09:10:21 2019 +0000
@@ -99,8 +99,7 @@
* @see java.io.StreamTokenizer
* @since 1.0
*/
-public
-class StringTokenizer implements Enumeration<Object> {
+public class StringTokenizer implements Enumeration<Object> {
private int currentPosition;
private int newPosition;
private int maxPosition;
--- a/src/java.base/share/classes/java/util/jar/JarEntry.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/jar/JarEntry.java Thu Nov 21 09:10:21 2019 +0000
@@ -35,8 +35,7 @@
*
* @since 1.2
*/
-public
-class JarEntry extends ZipEntry {
+public class JarEntry extends ZipEntry {
Attributes attr;
Certificate[] certs;
CodeSigner[] signers;
--- a/src/java.base/share/classes/java/util/jar/JarException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/jar/JarException.java Thu Nov 21 09:10:21 2019 +0000
@@ -32,8 +32,7 @@
* @author David Connelly
* @since 1.2
*/
-public
-class JarException extends java.util.zip.ZipException {
+public class JarException extends java.util.zip.ZipException {
@java.io.Serial
private static final long serialVersionUID = 7159778400963954473L;
--- a/src/java.base/share/classes/java/util/jar/JarFile.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/jar/JarFile.java Thu Nov 21 09:10:21 2019 +0000
@@ -145,8 +145,7 @@
* @see java.util.jar.JarEntry
* @since 1.2
*/
-public
-class JarFile extends ZipFile {
+public class JarFile extends ZipFile {
private final static Runtime.Version BASE_VERSION;
private final static int BASE_VERSION_FEATURE;
private final static Runtime.Version RUNTIME_VERSION;
--- a/src/java.base/share/classes/java/util/jar/JarInputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/jar/JarInputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -42,8 +42,7 @@
* @see java.util.zip.ZipInputStream
* @since 1.2
*/
-public
-class JarInputStream extends ZipInputStream {
+public class JarInputStream extends ZipInputStream {
private Manifest man;
private JarEntry first;
private JarVerifier jv;
--- a/src/java.base/share/classes/java/util/jar/JarOutputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/jar/JarOutputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -41,8 +41,7 @@
* @see java.util.zip.ZipOutputStream
* @since 1.2
*/
-public
-class JarOutputStream extends ZipOutputStream {
+public class JarOutputStream extends ZipOutputStream {
private static final int JAR_MAGIC = 0xCAFE;
/**
--- a/src/java.base/share/classes/java/util/zip/Adler32.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/zip/Adler32.java Thu Nov 21 09:10:21 2019 +0000
@@ -41,8 +41,7 @@
* @author David Connelly
* @since 1.1
*/
-public
-class Adler32 implements Checksum {
+public class Adler32 implements Checksum {
private int adler = 1;
--- a/src/java.base/share/classes/java/util/zip/CRC32.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/zip/CRC32.java Thu Nov 21 09:10:21 2019 +0000
@@ -40,8 +40,7 @@
* @author David Connelly
* @since 1.1
*/
-public
-class CRC32 implements Checksum {
+public class CRC32 implements Checksum {
private int crc;
/**
--- a/src/java.base/share/classes/java/util/zip/CheckedInputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/zip/CheckedInputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -37,8 +37,7 @@
* @author David Connelly
* @since 1.1
*/
-public
-class CheckedInputStream extends FilterInputStream {
+public class CheckedInputStream extends FilterInputStream {
private Checksum cksum;
/**
--- a/src/java.base/share/classes/java/util/zip/CheckedOutputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/zip/CheckedOutputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -38,8 +38,7 @@
* @author David Connelly
* @since 1.1
*/
-public
-class CheckedOutputStream extends FilterOutputStream {
+public class CheckedOutputStream extends FilterOutputStream {
private Checksum cksum;
/**
--- a/src/java.base/share/classes/java/util/zip/DataFormatException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/zip/DataFormatException.java Thu Nov 21 09:10:21 2019 +0000
@@ -31,8 +31,7 @@
* @author David Connelly
* @since 1.1
*/
-public
-class DataFormatException extends Exception {
+public class DataFormatException extends Exception {
@java.io.Serial
private static final long serialVersionUID = 2219632870893641452L;
--- a/src/java.base/share/classes/java/util/zip/DeflaterOutputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/zip/DeflaterOutputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -39,8 +39,7 @@
* @author David Connelly
* @since 1.1
*/
-public
-class DeflaterOutputStream extends FilterOutputStream {
+public class DeflaterOutputStream extends FilterOutputStream {
/**
* Compressor for this stream.
*/
--- a/src/java.base/share/classes/java/util/zip/GZIPInputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/zip/GZIPInputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -41,8 +41,7 @@
* @since 1.1
*
*/
-public
-class GZIPInputStream extends InflaterInputStream {
+public class GZIPInputStream extends InflaterInputStream {
/**
* CRC-32 for uncompressed data.
*/
--- a/src/java.base/share/classes/java/util/zip/GZIPOutputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/zip/GZIPOutputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -35,8 +35,7 @@
* @since 1.1
*
*/
-public
-class GZIPOutputStream extends DeflaterOutputStream {
+public class GZIPOutputStream extends DeflaterOutputStream {
/**
* CRC-32 of uncompressed data.
*/
--- a/src/java.base/share/classes/java/util/zip/InflaterInputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/zip/InflaterInputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -39,8 +39,7 @@
* @author David Connelly
* @since 1.1
*/
-public
-class InflaterInputStream extends FilterInputStream {
+public class InflaterInputStream extends FilterInputStream {
/**
* Decompressor for this stream.
*/
--- a/src/java.base/share/classes/java/util/zip/ZipEntry.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/zip/ZipEntry.java Thu Nov 21 09:10:21 2019 +0000
@@ -41,8 +41,7 @@
* @author David Connelly
* @since 1.1
*/
-public
-class ZipEntry implements ZipConstants, Cloneable {
+public class ZipEntry implements ZipConstants, Cloneable {
String name; // entry name
long xdostime = -1; // last modification time (in extended DOS time,
--- a/src/java.base/share/classes/java/util/zip/ZipException.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/zip/ZipException.java Thu Nov 21 09:10:21 2019 +0000
@@ -35,8 +35,7 @@
* @since 1.1
*/
-public
-class ZipException extends IOException {
+public class ZipException extends IOException {
@java.io.Serial
private static final long serialVersionUID = 8000196834066748623L;
--- a/src/java.base/share/classes/java/util/zip/ZipFile.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/zip/ZipFile.java Thu Nov 21 09:10:21 2019 +0000
@@ -87,8 +87,7 @@
* @author David Connelly
* @since 1.1
*/
-public
-class ZipFile implements ZipConstants, Closeable {
+public class ZipFile implements ZipConstants, Closeable {
private final String name; // zip file name
private volatile boolean closeRequested;
--- a/src/java.base/share/classes/java/util/zip/ZipInputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/zip/ZipInputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -42,8 +42,7 @@
* @author David Connelly
* @since 1.1
*/
-public
-class ZipInputStream extends InflaterInputStream implements ZipConstants {
+public class ZipInputStream extends InflaterInputStream implements ZipConstants {
private ZipEntry entry;
private int flag;
private CRC32 crc = new CRC32();
--- a/src/java.base/share/classes/java/util/zip/ZipOutputStream.java Wed Nov 20 10:13:10 2019 +0000
+++ b/src/java.base/share/classes/java/util/zip/ZipOutputStream.java Thu Nov 21 09:10:21 2019 +0000
@@ -43,8 +43,7 @@
* @author David Connelly
* @since 1.1
*/
-public
-class ZipOutputStream extends DeflaterOutputStream implements ZipConstants {
+public class ZipOutputStream extends DeflaterOutputStream implements ZipConstants {
/**
* Whether to use ZIP64 for zip files with more than 64k entries.