KlassHashtableEntry;
declare_constant(JNIHandleBlock::block_size_in_oops) \
\
/**********************/ \
- /* ObjectSynchronizer */ \
- /**********************/ \
- \
- declare_constant(ObjectSynchronizer::_BLOCKSIZE) \
- \
- /**********************/ \
/* PcDesc */ \
/**********************/ \
\
diff --git a/src/hotspot/share/utilities/vmError.cpp b/src/hotspot/share/utilities/vmError.cpp
index 9567eabb54d..16e3b8e11c2 100644
--- a/src/hotspot/share/utilities/vmError.cpp
+++ b/src/hotspot/share/utilities/vmError.cpp
@@ -1420,10 +1420,12 @@ void VMError::report_and_die(int id, const char* message, const char* detail_fmt
// are handled properly.
reset_signal_handlers();
} else {
- // If UseOsErrorReporting we call this for each level of the call stack
+#if defined(_WINDOWS)
+ // If UseOSErrorReporting we call this for each level of the call stack
// while searching for the exception handler. Only the first level needs
// to be reported.
if (UseOSErrorReporting && log_done) return;
+#endif
// This is not the first error, see if it happened in a different thread
// or in the same thread during error reporting.
@@ -1613,7 +1615,7 @@ void VMError::report_and_die(int id, const char* message, const char* detail_fmt
OnError = NULL;
}
- if (!UseOSErrorReporting) {
+ if (WINDOWS_ONLY(!UseOSErrorReporting) NOT_WINDOWS(true)) {
// os::abort() will call abort hooks, try it first.
static bool skip_os_abort = false;
if (!skip_os_abort) {
diff --git a/src/hotspot/share/utilities/vmError.hpp b/src/hotspot/share/utilities/vmError.hpp
index 172ddb52fb8..84baf8fec62 100644
--- a/src/hotspot/share/utilities/vmError.hpp
+++ b/src/hotspot/share/utilities/vmError.hpp
@@ -116,9 +116,6 @@ class VMError : public AllStatic {
// and the offending address points into CDS store.
static void check_failing_cds_access(outputStream* st, const void* siginfo);
- static void report_and_die(Thread* thread, unsigned int sig, address pc, void* siginfo,
- void* context, const char* detail_fmt, ...) ATTRIBUTE_PRINTF(6, 7);
-
// Timeout handling.
// Hook functions for platform dependend functionality:
static void reporting_started();
@@ -146,6 +143,9 @@ class VMError : public AllStatic {
static void print_vm_info(outputStream* st);
// main error reporting function
+ static void report_and_die(Thread* thread, unsigned int sig, address pc, void* siginfo,
+ void* context, const char* detail_fmt, ...) ATTRIBUTE_PRINTF(6, 7);
+
static void report_and_die(int id, const char* message, const char* detail_fmt, va_list detail_args,
Thread* thread, address pc, void* siginfo, void* context,
const char* filename, int lineno, size_t size) ATTRIBUTE_PRINTF(3, 0);
diff --git a/src/java.base/share/classes/java/io/DataInputStream.java b/src/java.base/share/classes/java/io/DataInputStream.java
index 401a9764c62..b784a5ab50e 100644
--- a/src/java.base/share/classes/java/io/DataInputStream.java
+++ b/src/java.base/share/classes/java/io/DataInputStream.java
@@ -33,9 +33,10 @@
* way. An application uses a data output stream to write data that
* can later be read by a data input stream.
*
- * DataInputStream is not necessarily safe for multithreaded access.
- * Thread safety is optional and is the responsibility of users of
- * methods in this class.
+ * A DataInputStream is not safe for use by multiple concurrent
+ * threads. If a DataInputStream is to be used by more than one
+ * thread then access to the data input stream should be controlled
+ * by appropriate synchronization.
*
* @author Arthur van Hoff
* @see java.io.DataOutputStream
diff --git a/src/java.base/share/classes/java/io/DataOutputStream.java b/src/java.base/share/classes/java/io/DataOutputStream.java
index 4d7d68cfb06..e5c90a257f9 100644
--- a/src/java.base/share/classes/java/io/DataOutputStream.java
+++ b/src/java.base/share/classes/java/io/DataOutputStream.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,8 +29,12 @@
* A data output stream lets an application write primitive Java data
* types to an output stream in a portable way. An application can
* then use a data input stream to read the data back in.
+ *
+ * A DataOutputStream is not safe for use by multiple concurrent
+ * threads. If a DataOutputStream is to be used by more than one
+ * thread then access to the data output stream should be controlled
+ * by appropriate synchronization.
*
- * @author unascribed
* @see java.io.DataInputStream
* @since 1.0
*/
@@ -163,8 +167,9 @@ public final void writeByte(int v) throws IOException {
* @see java.io.FilterOutputStream#out
*/
public final void writeShort(int v) throws IOException {
- out.write((v >>> 8) & 0xFF);
- out.write((v >>> 0) & 0xFF);
+ writeBuffer[0] = (byte)(v >>> 8);
+ writeBuffer[1] = (byte)(v >>> 0);
+ out.write(writeBuffer, 0, 2);
incCount(2);
}
@@ -178,8 +183,9 @@ public final void writeShort(int v) throws IOException {
* @see java.io.FilterOutputStream#out
*/
public final void writeChar(int v) throws IOException {
- out.write((v >>> 8) & 0xFF);
- out.write((v >>> 0) & 0xFF);
+ writeBuffer[0] = (byte)(v >>> 8);
+ writeBuffer[1] = (byte)(v >>> 0);
+ out.write(writeBuffer, 0, 2);
incCount(2);
}
@@ -193,10 +199,11 @@ public final void writeChar(int v) throws IOException {
* @see java.io.FilterOutputStream#out
*/
public final void writeInt(int v) throws IOException {
- out.write((v >>> 24) & 0xFF);
- out.write((v >>> 16) & 0xFF);
- out.write((v >>> 8) & 0xFF);
- out.write((v >>> 0) & 0xFF);
+ writeBuffer[0] = (byte)(v >>> 24);
+ writeBuffer[1] = (byte)(v >>> 16);
+ writeBuffer[2] = (byte)(v >>> 8);
+ writeBuffer[3] = (byte)(v >>> 0);
+ out.write(writeBuffer, 0, 4);
incCount(4);
}
diff --git a/src/java.base/share/classes/java/io/Externalizable.java b/src/java.base/share/classes/java/io/Externalizable.java
index 09f21fdf646..84029fc5f3a 100644
--- a/src/java.base/share/classes/java/io/Externalizable.java
+++ b/src/java.base/share/classes/java/io/Externalizable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -55,7 +55,6 @@
* the writeReplace and readResolve methods documented in the Serializable
* interface.
*
- * @author unascribed
* @see java.io.ObjectOutputStream
* @see java.io.ObjectInputStream
* @see java.io.ObjectOutput
diff --git a/src/java.base/share/classes/java/io/File.java b/src/java.base/share/classes/java/io/File.java
index 553f4ef00c4..ca49cc9d228 100644
--- a/src/java.base/share/classes/java/io/File.java
+++ b/src/java.base/share/classes/java/io/File.java
@@ -142,7 +142,6 @@
* additional file operations, file attributes, and I/O exceptions to help
* diagnose errors when an operation on a file fails.
*
- * @author unascribed
* @since 1.0
*/
diff --git a/src/java.base/share/classes/java/io/FileNotFoundException.java b/src/java.base/share/classes/java/io/FileNotFoundException.java
index 4bfdd34aff1..8d13aa3fdb9 100644
--- a/src/java.base/share/classes/java/io/FileNotFoundException.java
+++ b/src/java.base/share/classes/java/io/FileNotFoundException.java
@@ -36,7 +36,6 @@
* constructors if the file does exist but for some reason is inaccessible, for
* example when an attempt is made to open a read-only file for writing.
*
- * @author unascribed
* @since 1.0
*/
diff --git a/src/java.base/share/classes/java/io/IOException.java b/src/java.base/share/classes/java/io/IOException.java
index fd19dce4e19..7a81bd1e621 100644
--- a/src/java.base/share/classes/java/io/IOException.java
+++ b/src/java.base/share/classes/java/io/IOException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
* class is the general class of exceptions produced by failed or
* interrupted I/O operations.
*
- * @author unascribed
* @see java.io.InputStream
* @see java.io.OutputStream
* @since 1.0
diff --git a/src/java.base/share/classes/java/io/InterruptedIOException.java b/src/java.base/share/classes/java/io/InterruptedIOException.java
index 7d3ac73acbc..cdd45a7d981 100644
--- a/src/java.base/share/classes/java/io/InterruptedIOException.java
+++ b/src/java.base/share/classes/java/io/InterruptedIOException.java
@@ -33,7 +33,6 @@
* indicates how many bytes were successfully transferred before
* the interruption occurred.
*
- * @author unascribed
* @see java.io.InputStream
* @see java.io.OutputStream
* @see java.lang.Thread#interrupt()
diff --git a/src/java.base/share/classes/java/io/InvalidClassException.java b/src/java.base/share/classes/java/io/InvalidClassException.java
index 71fd5d18c77..6de0e70f760 100644
--- a/src/java.base/share/classes/java/io/InvalidClassException.java
+++ b/src/java.base/share/classes/java/io/InvalidClassException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
* Specification
*
*
- * @author unascribed
* @since 1.1
*/
public class InvalidClassException extends ObjectStreamException {
diff --git a/src/java.base/share/classes/java/io/InvalidObjectException.java b/src/java.base/share/classes/java/io/InvalidObjectException.java
index 01b7ebbb19a..c6e626b238f 100644
--- a/src/java.base/share/classes/java/io/InvalidObjectException.java
+++ b/src/java.base/share/classes/java/io/InvalidObjectException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,6 @@
* @see ObjectInputValidation
* @since 1.1
*
- * @author unascribed
* @since 1.1
*/
public class InvalidObjectException extends ObjectStreamException {
diff --git a/src/java.base/share/classes/java/io/NotActiveException.java b/src/java.base/share/classes/java/io/NotActiveException.java
index 318f9f920e2..3b8b281cbf4 100644
--- a/src/java.base/share/classes/java/io/NotActiveException.java
+++ b/src/java.base/share/classes/java/io/NotActiveException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
/**
* Thrown when serialization or deserialization is not active.
*
- * @author unascribed
* @since 1.1
*/
public class NotActiveException extends ObjectStreamException {
diff --git a/src/java.base/share/classes/java/io/NotSerializableException.java b/src/java.base/share/classes/java/io/NotSerializableException.java
index 93c48da69c1..d1010188272 100644
--- a/src/java.base/share/classes/java/io/NotSerializableException.java
+++ b/src/java.base/share/classes/java/io/NotSerializableException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
* The serialization runtime or the class of the instance can throw
* this exception. The argument should be the name of the class.
*
- * @author unascribed
* @since 1.1
*/
public class NotSerializableException extends ObjectStreamException {
diff --git a/src/java.base/share/classes/java/io/ObjectInput.java b/src/java.base/share/classes/java/io/ObjectInput.java
index ac1a9b5c542..c4098a2f458 100644
--- a/src/java.base/share/classes/java/io/ObjectInput.java
+++ b/src/java.base/share/classes/java/io/ObjectInput.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
* objects. DataInput includes methods for the input of primitive types,
* ObjectInput extends that interface to include objects, arrays, and Strings.
*
- * @author unascribed
* @see java.io.InputStream
* @see java.io.ObjectOutputStream
* @see java.io.ObjectInputStream
diff --git a/src/java.base/share/classes/java/io/ObjectInputValidation.java b/src/java.base/share/classes/java/io/ObjectInputValidation.java
index de1d8a53825..e22bf884a27 100644
--- a/src/java.base/share/classes/java/io/ObjectInputValidation.java
+++ b/src/java.base/share/classes/java/io/ObjectInputValidation.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
* Allows an object to be called when a complete graph of objects has
* been deserialized.
*
- * @author unascribed
* @see ObjectInputStream
* @see ObjectInputStream#registerValidation(java.io.ObjectInputValidation, int)
* @since 1.1
diff --git a/src/java.base/share/classes/java/io/ObjectOutput.java b/src/java.base/share/classes/java/io/ObjectOutput.java
index b8a8d5c095a..8a825ade99d 100644
--- a/src/java.base/share/classes/java/io/ObjectOutput.java
+++ b/src/java.base/share/classes/java/io/ObjectOutput.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
* DataOutput includes methods for output of primitive types, ObjectOutput
* extends that interface to include objects, arrays, and Strings.
*
- * @author unascribed
* @see java.io.InputStream
* @see java.io.ObjectOutputStream
* @see java.io.ObjectInputStream
diff --git a/src/java.base/share/classes/java/io/ObjectStreamConstants.java b/src/java.base/share/classes/java/io/ObjectStreamConstants.java
index 4f7bdf4586e..93c2587034a 100644
--- a/src/java.base/share/classes/java/io/ObjectStreamConstants.java
+++ b/src/java.base/share/classes/java/io/ObjectStreamConstants.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
/**
* Constants written into the Object Serialization Stream.
*
- * @author unascribed
* @since 1.1
*/
public interface ObjectStreamConstants {
diff --git a/src/java.base/share/classes/java/io/ObjectStreamException.java b/src/java.base/share/classes/java/io/ObjectStreamException.java
index 1e4fb7a46aa..779cc0627d3 100644
--- a/src/java.base/share/classes/java/io/ObjectStreamException.java
+++ b/src/java.base/share/classes/java/io/ObjectStreamException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
/**
* Superclass of all exceptions specific to Object Stream classes.
*
- * @author unascribed
* @since 1.1
*/
public abstract class ObjectStreamException extends IOException {
diff --git a/src/java.base/share/classes/java/io/OptionalDataException.java b/src/java.base/share/classes/java/io/OptionalDataException.java
index cf1d074a4f4..f98bf079e8e 100644
--- a/src/java.base/share/classes/java/io/OptionalDataException.java
+++ b/src/java.base/share/classes/java/io/OptionalDataException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,6 @@
* is set to 0.
*
*
- * @author unascribed
* @since 1.1
*/
public class OptionalDataException extends ObjectStreamException {
diff --git a/src/java.base/share/classes/java/io/RandomAccessFile.java b/src/java.base/share/classes/java/io/RandomAccessFile.java
index d72011f0159..5f6bcfaa6ac 100644
--- a/src/java.base/share/classes/java/io/RandomAccessFile.java
+++ b/src/java.base/share/classes/java/io/RandomAccessFile.java
@@ -55,7 +55,6 @@
* than {@code EOFException} is thrown. In particular, an
* {@code IOException} may be thrown if the stream has been closed.
*
- * @author unascribed
* @since 1.0
*/
diff --git a/src/java.base/share/classes/java/io/Serializable.java b/src/java.base/share/classes/java/io/Serializable.java
index 0b92cec448a..4686d062108 100644
--- a/src/java.base/share/classes/java/io/Serializable.java
+++ b/src/java.base/share/classes/java/io/Serializable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -174,7 +174,6 @@
* the default computed value, but the requirement for matching
* serialVersionUID values is waived for array classes.
*
- * @author unascribed
* @see java.io.ObjectOutputStream
* @see java.io.ObjectInputStream
* @see java.io.ObjectOutput
diff --git a/src/java.base/share/classes/java/io/StreamCorruptedException.java b/src/java.base/share/classes/java/io/StreamCorruptedException.java
index 1aa31c1650e..5124c5ce657 100644
--- a/src/java.base/share/classes/java/io/StreamCorruptedException.java
+++ b/src/java.base/share/classes/java/io/StreamCorruptedException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
* Thrown when control information that was read from an object stream
* violates internal consistency checks.
*
- * @author unascribed
* @since 1.1
*/
public class StreamCorruptedException extends ObjectStreamException {
diff --git a/src/java.base/share/classes/java/io/WriteAbortedException.java b/src/java.base/share/classes/java/io/WriteAbortedException.java
index a2c86451850..5b82d0999f1 100644
--- a/src/java.base/share/classes/java/io/WriteAbortedException.java
+++ b/src/java.base/share/classes/java/io/WriteAbortedException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,6 @@
* cause, and may be accessed via the {@link Throwable#getCause()}
* method, as well as the aforementioned "legacy field."
*
- * @author unascribed
* @since 1.1
*/
public class WriteAbortedException extends ObjectStreamException {
diff --git a/src/java.base/share/classes/java/lang/AbstractMethodError.java b/src/java.base/share/classes/java/lang/AbstractMethodError.java
index 5c128313c15..a37fa418eae 100644
--- a/src/java.base/share/classes/java/lang/AbstractMethodError.java
+++ b/src/java.base/share/classes/java/lang/AbstractMethodError.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,6 @@
* incompatibly changed since the currently executing method was last
* compiled.
*
- * @author unascribed
* @since 1.0
*/
public class AbstractMethodError extends IncompatibleClassChangeError {
diff --git a/src/java.base/share/classes/java/lang/ArithmeticException.java b/src/java.base/share/classes/java/lang/ArithmeticException.java
index aa3efbd5053..da74380ad59 100644
--- a/src/java.base/share/classes/java/lang/ArithmeticException.java
+++ b/src/java.base/share/classes/java/lang/ArithmeticException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,6 @@
* Throwable, boolean, boolean) suppression were disabled and/or the
* stack trace was not writable}.
*
- * @author unascribed
* @since 1.0
*/
public class ArithmeticException extends RuntimeException {
diff --git a/src/java.base/share/classes/java/lang/ArrayStoreException.java b/src/java.base/share/classes/java/lang/ArrayStoreException.java
index 2fb68bf6386..118c59706ab 100644
--- a/src/java.base/share/classes/java/lang/ArrayStoreException.java
+++ b/src/java.base/share/classes/java/lang/ArrayStoreException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,6 @@
* x[0] = new Integer(0);
*
*
- * @author unascribed
* @since 1.0
*/
public class ArrayStoreException extends RuntimeException {
diff --git a/src/java.base/share/classes/java/lang/Class.java b/src/java.base/share/classes/java/lang/Class.java
index df1f07c12e3..c82286b25e7 100644
--- a/src/java.base/share/classes/java/lang/Class.java
+++ b/src/java.base/share/classes/java/lang/Class.java
@@ -186,7 +186,6 @@
* Class}. Use {@code Class>} if the class being modeled is
* unknown.
*
- * @author unascribed
* @see java.lang.ClassLoader#defineClass(byte[], int, int)
* @since 1.0
* @jls 15.8.2 Class Literals
diff --git a/src/java.base/share/classes/java/lang/ClassCastException.java b/src/java.base/share/classes/java/lang/ClassCastException.java
index 73b00f44741..a436f546953 100644
--- a/src/java.base/share/classes/java/lang/ClassCastException.java
+++ b/src/java.base/share/classes/java/lang/ClassCastException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,6 @@
* System.out.println((String)x);
*
*
- * @author unascribed
* @since 1.0
*/
public class ClassCastException extends RuntimeException {
diff --git a/src/java.base/share/classes/java/lang/ClassCircularityError.java b/src/java.base/share/classes/java/lang/ClassCircularityError.java
index afd38cd96fa..52f03f6d792 100644
--- a/src/java.base/share/classes/java/lang/ClassCircularityError.java
+++ b/src/java.base/share/classes/java/lang/ClassCircularityError.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
* Thrown when the Java Virtual Machine detects a circularity in the
* superclass hierarchy of a class being loaded.
*
- * @author unascribed
* @since 1.0
*/
public class ClassCircularityError extends LinkageError {
diff --git a/src/java.base/share/classes/java/lang/ClassFormatError.java b/src/java.base/share/classes/java/lang/ClassFormatError.java
index 61145956042..2fdc8d56e5b 100644
--- a/src/java.base/share/classes/java/lang/ClassFormatError.java
+++ b/src/java.base/share/classes/java/lang/ClassFormatError.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
* file and determines that the file is malformed or otherwise cannot
* be interpreted as a class file.
*
- * @author unascribed
* @since 1.0
*/
public class ClassFormatError extends LinkageError {
diff --git a/src/java.base/share/classes/java/lang/ClassNotFoundException.java b/src/java.base/share/classes/java/lang/ClassNotFoundException.java
index 2647c947d7d..2a26786a297 100644
--- a/src/java.base/share/classes/java/lang/ClassNotFoundException.java
+++ b/src/java.base/share/classes/java/lang/ClassNotFoundException.java
@@ -49,7 +49,6 @@
* now known as the cause, and may be accessed via the {@link
* Throwable#getCause()} method, as well as the aforementioned "legacy method."
*
- * @author unascribed
* @see java.lang.Class#forName(java.lang.String)
* @see java.lang.ClassLoader#findSystemClass(java.lang.String)
* @see java.lang.ClassLoader#loadClass(java.lang.String, boolean)
diff --git a/src/java.base/share/classes/java/lang/CloneNotSupportedException.java b/src/java.base/share/classes/java/lang/CloneNotSupportedException.java
index 58d9731feca..a3fea187bd6 100644
--- a/src/java.base/share/classes/java/lang/CloneNotSupportedException.java
+++ b/src/java.base/share/classes/java/lang/CloneNotSupportedException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,6 @@
* throw this exception to indicate that an object could not or
* should not be cloned.
*
- * @author unascribed
* @see java.lang.Cloneable
* @see java.lang.Object#clone()
* @since 1.0
diff --git a/src/java.base/share/classes/java/lang/Cloneable.java b/src/java.base/share/classes/java/lang/Cloneable.java
index 7f65223ce7a..1dfb8176a46 100644
--- a/src/java.base/share/classes/java/lang/Cloneable.java
+++ b/src/java.base/share/classes/java/lang/Cloneable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,7 +45,6 @@
* fact that it implements this interface. Even if the clone method is invoked
* reflectively, there is no guarantee that it will succeed.
*
- * @author unascribed
* @see java.lang.CloneNotSupportedException
* @see java.lang.Object#clone()
* @since 1.0
diff --git a/src/java.base/share/classes/java/lang/IllegalAccessError.java b/src/java.base/share/classes/java/lang/IllegalAccessError.java
index 64b8cd40916..8773c1d4e35 100644
--- a/src/java.base/share/classes/java/lang/IllegalAccessError.java
+++ b/src/java.base/share/classes/java/lang/IllegalAccessError.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@
* only occur at run time if the definition of a class has
* incompatibly changed.
*
- * @author unascribed
* @since 1.0
*/
public class IllegalAccessError extends IncompatibleClassChangeError {
diff --git a/src/java.base/share/classes/java/lang/IllegalAccessException.java b/src/java.base/share/classes/java/lang/IllegalAccessException.java
index 64b3822bcb3..e2a3a1b2b80 100644
--- a/src/java.base/share/classes/java/lang/IllegalAccessException.java
+++ b/src/java.base/share/classes/java/lang/IllegalAccessException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,6 @@
* executing method does not have access to the definition of
* the specified class, field, method or constructor.
*
- * @author unascribed
* @see Class#newInstance()
* @see java.lang.reflect.Field#set(Object, Object)
* @see java.lang.reflect.Field#setBoolean(Object, boolean)
diff --git a/src/java.base/share/classes/java/lang/IllegalArgumentException.java b/src/java.base/share/classes/java/lang/IllegalArgumentException.java
index a6e1dd43022..10794ee06de 100644
--- a/src/java.base/share/classes/java/lang/IllegalArgumentException.java
+++ b/src/java.base/share/classes/java/lang/IllegalArgumentException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
* Thrown to indicate that a method has been passed an illegal or
* inappropriate argument.
*
- * @author unascribed
* @since 1.0
*/
public class IllegalArgumentException extends RuntimeException {
diff --git a/src/java.base/share/classes/java/lang/IllegalMonitorStateException.java b/src/java.base/share/classes/java/lang/IllegalMonitorStateException.java
index 12da87d5151..7ff87a8b0aa 100644
--- a/src/java.base/share/classes/java/lang/IllegalMonitorStateException.java
+++ b/src/java.base/share/classes/java/lang/IllegalMonitorStateException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
* object's monitor or to notify other threads waiting on an object's
* monitor without owning the specified monitor.
*
- * @author unascribed
* @see java.lang.Object#notify()
* @see java.lang.Object#notifyAll()
* @see java.lang.Object#wait()
diff --git a/src/java.base/share/classes/java/lang/IllegalThreadStateException.java b/src/java.base/share/classes/java/lang/IllegalThreadStateException.java
index 1937a9f8d45..0fae6ef4fb5 100644
--- a/src/java.base/share/classes/java/lang/IllegalThreadStateException.java
+++ b/src/java.base/share/classes/java/lang/IllegalThreadStateException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,6 @@
* {@code suspend} and {@code resume} methods in class
* {@code Thread}.
*
- * @author unascribed
* @see java.lang.Thread#resume()
* @see java.lang.Thread#suspend()
* @since 1.0
diff --git a/src/java.base/share/classes/java/lang/IncompatibleClassChangeError.java b/src/java.base/share/classes/java/lang/IncompatibleClassChangeError.java
index fc76a89151b..6468a1a6f24 100644
--- a/src/java.base/share/classes/java/lang/IncompatibleClassChangeError.java
+++ b/src/java.base/share/classes/java/lang/IncompatibleClassChangeError.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
* definition. The definition of some class, on which the currently
* executing method depends, has since changed.
*
- * @author unascribed
* @since 1.0
*/
public class IncompatibleClassChangeError extends LinkageError {
diff --git a/src/java.base/share/classes/java/lang/InstantiationError.java b/src/java.base/share/classes/java/lang/InstantiationError.java
index 565447001da..0c06ef409df 100644
--- a/src/java.base/share/classes/java/lang/InstantiationError.java
+++ b/src/java.base/share/classes/java/lang/InstantiationError.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@
* only occur at run time if the definition of a class has
* incompatibly changed.
*
- * @author unascribed
* @since 1.0
*/
diff --git a/src/java.base/share/classes/java/lang/InstantiationException.java b/src/java.base/share/classes/java/lang/InstantiationException.java
index 9c22bd58b09..ed3af1bf30a 100644
--- a/src/java.base/share/classes/java/lang/InstantiationException.java
+++ b/src/java.base/share/classes/java/lang/InstantiationException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,6 @@
* the class has no nullary constructor
*
*
- * @author unascribed
* @see java.lang.Class#newInstance()
* @since 1.0
*/
diff --git a/src/java.base/share/classes/java/lang/InternalError.java b/src/java.base/share/classes/java/lang/InternalError.java
index f701ed19b05..eda8344523e 100644
--- a/src/java.base/share/classes/java/lang/InternalError.java
+++ b/src/java.base/share/classes/java/lang/InternalError.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
* Thrown to indicate some unexpected internal error has occurred in
* the Java Virtual Machine.
*
- * @author unascribed
* @since 1.0
*/
public class InternalError extends VirtualMachineError {
diff --git a/src/java.base/share/classes/java/lang/Math.java b/src/java.base/share/classes/java/lang/Math.java
index 03834741d12..ff7ceff6cf2 100644
--- a/src/java.base/share/classes/java/lang/Math.java
+++ b/src/java.base/share/classes/java/lang/Math.java
@@ -99,7 +99,6 @@
* occurs only with a specific minimum or maximum value and
* should be checked against the minimum or maximum as appropriate.
*
- * @author unascribed
* @author Joseph D. Darcy
* @since 1.0
*/
diff --git a/src/java.base/share/classes/java/lang/NegativeArraySizeException.java b/src/java.base/share/classes/java/lang/NegativeArraySizeException.java
index 73d7740dfd8..a0f5eba0d80 100644
--- a/src/java.base/share/classes/java/lang/NegativeArraySizeException.java
+++ b/src/java.base/share/classes/java/lang/NegativeArraySizeException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
/**
* Thrown if an application tries to create an array with negative size.
*
- * @author unascribed
* @since 1.0
*/
public class NegativeArraySizeException extends RuntimeException {
diff --git a/src/java.base/share/classes/java/lang/NoClassDefFoundError.java b/src/java.base/share/classes/java/lang/NoClassDefFoundError.java
index 334b03804d9..52387242c82 100644
--- a/src/java.base/share/classes/java/lang/NoClassDefFoundError.java
+++ b/src/java.base/share/classes/java/lang/NoClassDefFoundError.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,6 @@
* executing class was compiled, but the definition can no longer be
* found.
*
- * @author unascribed
* @since 1.0
*/
public class NoClassDefFoundError extends LinkageError {
diff --git a/src/java.base/share/classes/java/lang/NoSuchFieldError.java b/src/java.base/share/classes/java/lang/NoSuchFieldError.java
index af31a3e2974..2b3a0b25a5c 100644
--- a/src/java.base/share/classes/java/lang/NoSuchFieldError.java
+++ b/src/java.base/share/classes/java/lang/NoSuchFieldError.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@
* only occur at run time if the definition of a class has
* incompatibly changed.
*
- * @author unascribed
* @since 1.0
*/
public class NoSuchFieldError extends IncompatibleClassChangeError {
diff --git a/src/java.base/share/classes/java/lang/NoSuchFieldException.java b/src/java.base/share/classes/java/lang/NoSuchFieldException.java
index 759f6c7ab9c..d25ba977c82 100644
--- a/src/java.base/share/classes/java/lang/NoSuchFieldException.java
+++ b/src/java.base/share/classes/java/lang/NoSuchFieldException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
/**
* Signals that the class doesn't have a field of a specified name.
*
- * @author unascribed
* @since 1.1
*/
public class NoSuchFieldException extends ReflectiveOperationException {
diff --git a/src/java.base/share/classes/java/lang/NoSuchMethodError.java b/src/java.base/share/classes/java/lang/NoSuchMethodError.java
index 1dc7a9ac7f6..9ef207e60e4 100644
--- a/src/java.base/share/classes/java/lang/NoSuchMethodError.java
+++ b/src/java.base/share/classes/java/lang/NoSuchMethodError.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,6 @@
* only occur at run time if the definition of a class has
* incompatibly changed.
*
- * @author unascribed
* @since 1.0
*/
public class NoSuchMethodError extends IncompatibleClassChangeError {
diff --git a/src/java.base/share/classes/java/lang/NoSuchMethodException.java b/src/java.base/share/classes/java/lang/NoSuchMethodException.java
index abcd687dbbd..3bd0193d186 100644
--- a/src/java.base/share/classes/java/lang/NoSuchMethodException.java
+++ b/src/java.base/share/classes/java/lang/NoSuchMethodException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
/**
* Thrown when a particular method cannot be found.
*
- * @author unascribed
* @since 1.0
*/
public class NoSuchMethodException extends ReflectiveOperationException {
diff --git a/src/java.base/share/classes/java/lang/NullPointerException.java b/src/java.base/share/classes/java/lang/NullPointerException.java
index ff1fd66e5ab..7258b711b62 100644
--- a/src/java.base/share/classes/java/lang/NullPointerException.java
+++ b/src/java.base/share/classes/java/lang/NullPointerException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -46,7 +46,6 @@
* Throwable, boolean, boolean) suppression were disabled and/or the
* stack trace was not writable}.
*
- * @author unascribed
* @since 1.0
*/
public class NullPointerException extends RuntimeException {
diff --git a/src/java.base/share/classes/java/lang/NumberFormatException.java b/src/java.base/share/classes/java/lang/NumberFormatException.java
index a7d023c1a15..7a317304f6e 100644
--- a/src/java.base/share/classes/java/lang/NumberFormatException.java
+++ b/src/java.base/share/classes/java/lang/NumberFormatException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
* a string to one of the numeric types, but that the string does not
* have the appropriate format.
*
- * @author unascribed
* @see java.lang.Integer#parseInt(String)
* @since 1.0
*/
diff --git a/src/java.base/share/classes/java/lang/Object.java b/src/java.base/share/classes/java/lang/Object.java
index 6f293dc5300..6c1720193b3 100644
--- a/src/java.base/share/classes/java/lang/Object.java
+++ b/src/java.base/share/classes/java/lang/Object.java
@@ -36,7 +36,6 @@
* Every class has {@code Object} as a superclass. All objects,
* including arrays, implement the methods of this class.
*
- * @author unascribed
* @see java.lang.Class
* @since 1.0
*/
diff --git a/src/java.base/share/classes/java/lang/OutOfMemoryError.java b/src/java.base/share/classes/java/lang/OutOfMemoryError.java
index 45cd03facfb..94bf8aea195 100644
--- a/src/java.base/share/classes/java/lang/OutOfMemoryError.java
+++ b/src/java.base/share/classes/java/lang/OutOfMemoryError.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,6 @@
* boolean, boolean) suppression were disabled and/or the stack trace was not
* writable}.
*
- * @author unascribed
* @since 1.0
*/
public class OutOfMemoryError extends VirtualMachineError {
diff --git a/src/java.base/share/classes/java/lang/Runtime.java b/src/java.base/share/classes/java/lang/Runtime.java
index 499624804dd..dae8be95ce6 100644
--- a/src/java.base/share/classes/java/lang/Runtime.java
+++ b/src/java.base/share/classes/java/lang/Runtime.java
@@ -48,7 +48,6 @@
*
* An application cannot create its own instance of this class.
*
- * @author unascribed
* @see java.lang.Runtime#getRuntime()
* @since 1.0
*/
diff --git a/src/java.base/share/classes/java/lang/SecurityException.java b/src/java.base/share/classes/java/lang/SecurityException.java
index b704749e815..4e4f966f76a 100644
--- a/src/java.base/share/classes/java/lang/SecurityException.java
+++ b/src/java.base/share/classes/java/lang/SecurityException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,6 @@
/**
* Thrown by the security manager to indicate a security violation.
*
- * @author unascribed
* @see java.lang.SecurityManager
* @since 1.0
*/
diff --git a/src/java.base/share/classes/java/lang/StackOverflowError.java b/src/java.base/share/classes/java/lang/StackOverflowError.java
index 95ec9a30d48..45a6af30280 100644
--- a/src/java.base/share/classes/java/lang/StackOverflowError.java
+++ b/src/java.base/share/classes/java/lang/StackOverflowError.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
* Thrown when a stack overflow occurs because an application
* recurses too deeply.
*
- * @author unascribed
* @since 1.0
*/
public class StackOverflowError extends VirtualMachineError {
diff --git a/src/java.base/share/classes/java/lang/StrictMath.java b/src/java.base/share/classes/java/lang/StrictMath.java
index d511847d9f6..941834381be 100644
--- a/src/java.base/share/classes/java/lang/StrictMath.java
+++ b/src/java.base/share/classes/java/lang/StrictMath.java
@@ -74,7 +74,6 @@
* occurs only with a specific minimum or maximum value and
* should be checked against the minimum or maximum as appropriate.
*
- * @author unascribed
* @author Joseph D. Darcy
* @since 1.3
*/
diff --git a/src/java.base/share/classes/java/lang/Thread.java b/src/java.base/share/classes/java/lang/Thread.java
index 7692b4179e0..f50b024f9d2 100644
--- a/src/java.base/share/classes/java/lang/Thread.java
+++ b/src/java.base/share/classes/java/lang/Thread.java
@@ -133,7 +133,6 @@
* or method in this class will cause a {@link NullPointerException} to be
* thrown.
*
- * @author unascribed
* @see Runnable
* @see Runtime#exit(int)
* @see #run()
diff --git a/src/java.base/share/classes/java/lang/ThreadGroup.java b/src/java.base/share/classes/java/lang/ThreadGroup.java
index c942a038b8b..5252b2c56a5 100644
--- a/src/java.base/share/classes/java/lang/ThreadGroup.java
+++ b/src/java.base/share/classes/java/lang/ThreadGroup.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,6 @@
* group, but not to access information about its thread group's
* parent thread group or any other thread groups.
*
- * @author unascribed
* @since 1.0
*/
/* The locking strategy for this code is to try to lock only one level of the
diff --git a/src/java.base/share/classes/java/lang/Throwable.java b/src/java.base/share/classes/java/lang/Throwable.java
index 7bca70ec96e..72948a36485 100644
--- a/src/java.base/share/classes/java/lang/Throwable.java
+++ b/src/java.base/share/classes/java/lang/Throwable.java
@@ -106,7 +106,6 @@
* {@code String} (the detail message) and a {@code Throwable} (the
* cause).
*
- * @author unascribed
* @author Josh Bloch (Added exception chaining and programmatic access to
* stack trace in 1.4.)
* @jls 11.2 Compile-Time Checking of Exceptions
diff --git a/src/java.base/share/classes/java/lang/UnknownError.java b/src/java.base/share/classes/java/lang/UnknownError.java
index 3d2bbaaac9d..d6ced29f921 100644
--- a/src/java.base/share/classes/java/lang/UnknownError.java
+++ b/src/java.base/share/classes/java/lang/UnknownError.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
* Thrown when an unknown but serious exception has occurred in the
* Java Virtual Machine.
*
- * @author unascribed
* @since 1.0
*/
public class UnknownError extends VirtualMachineError {
diff --git a/src/java.base/share/classes/java/lang/UnsatisfiedLinkError.java b/src/java.base/share/classes/java/lang/UnsatisfiedLinkError.java
index e171bd1ca92..2a6e8596146 100644
--- a/src/java.base/share/classes/java/lang/UnsatisfiedLinkError.java
+++ b/src/java.base/share/classes/java/lang/UnsatisfiedLinkError.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
* Thrown if the Java Virtual Machine cannot find an appropriate
* native-language definition of a method declared {@code native}.
*
- * @author unascribed
* @see java.lang.Runtime
* @since 1.0
*/
diff --git a/src/java.base/share/classes/java/lang/VerifyError.java b/src/java.base/share/classes/java/lang/VerifyError.java
index 1e3be9122fb..7409fc6665c 100644
--- a/src/java.base/share/classes/java/lang/VerifyError.java
+++ b/src/java.base/share/classes/java/lang/VerifyError.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
* though well formed, contains some sort of internal inconsistency
* or security problem.
*
- * @author unascribed
* @since 1.0
*/
public class VerifyError extends LinkageError {
diff --git a/src/java.base/share/classes/java/lang/Void.java b/src/java.base/share/classes/java/lang/Void.java
index 581d0d6f488..3ea0e79e61c 100644
--- a/src/java.base/share/classes/java/lang/Void.java
+++ b/src/java.base/share/classes/java/lang/Void.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
* reference to the {@code Class} object representing the Java keyword
* void.
*
- * @author unascribed
* @since 1.1
*/
public final
diff --git a/src/java.base/share/classes/java/lang/invoke/IndirectVarHandle.java b/src/java.base/share/classes/java/lang/invoke/IndirectVarHandle.java
index 85e17a640c8..2ef81c14519 100644
--- a/src/java.base/share/classes/java/lang/invoke/IndirectVarHandle.java
+++ b/src/java.base/share/classes/java/lang/invoke/IndirectVarHandle.java
@@ -53,7 +53,12 @@
private final Class>[] coordinates;
IndirectVarHandle(VarHandle target, Class> value, Class>[] coordinates, BiFunction handleFactory) {
- super(new VarForm(value, coordinates));
+ this(target, value, coordinates, handleFactory, new VarForm(value, coordinates), false);
+ }
+
+ private IndirectVarHandle(VarHandle target, Class> value, Class>[] coordinates,
+ BiFunction handleFactory, VarForm form, boolean exact) {
+ super(form, exact);
this.handleFactory = handleFactory;
this.target = target;
this.directTarget = target.asDirect();
@@ -72,8 +77,8 @@ public List> coordinateTypes() {
}
@Override
- MethodType accessModeTypeUncached(AccessMode accessMode) {
- return accessMode.at.accessModeType(directTarget.getClass(), value, coordinates);
+ MethodType accessModeTypeUncached(AccessType at) {
+ return at.accessModeType(null, value, coordinates);
}
@Override
@@ -90,6 +95,20 @@ VarHandle target() {
return target;
}
+ @Override
+ public VarHandle withInvokeExactBehavior() {
+ return hasInvokeExactBehavior()
+ ? this
+ : new IndirectVarHandle(target, value, coordinates, handleFactory, vform, true);
+ }
+
+ @Override
+ public VarHandle withInvokeBehavior() {
+ return !hasInvokeExactBehavior()
+ ? this
+ : new IndirectVarHandle(target, value, coordinates, handleFactory, vform, false);
+ }
+
@Override
@ForceInline
MethodHandle getMethodHandle(int mode) {
diff --git a/src/java.base/share/classes/java/lang/invoke/Invokers.java b/src/java.base/share/classes/java/lang/invoke/Invokers.java
index 9e44de43337..ee1f9baa3da 100644
--- a/src/java.base/share/classes/java/lang/invoke/Invokers.java
+++ b/src/java.base/share/classes/java/lang/invoke/Invokers.java
@@ -27,6 +27,7 @@
import jdk.internal.vm.annotation.DontInline;
import jdk.internal.vm.annotation.ForceInline;
+import jdk.internal.vm.annotation.Hidden;
import jdk.internal.vm.annotation.Stable;
import java.lang.reflect.Array;
@@ -463,7 +464,12 @@ private static LambdaForm varHandleMethodInvokerHandleForm(VarHandle.AccessMode
@ForceInline
/*non-public*/
+ @Hidden
static MethodHandle checkVarHandleGenericType(VarHandle handle, VarHandle.AccessDescriptor ad) {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
// 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);
diff --git a/src/java.base/share/classes/java/lang/invoke/MemoryAccessVarHandleBase.java b/src/java.base/share/classes/java/lang/invoke/MemoryAccessVarHandleBase.java
index dee289fa157..0176cbf6d47 100644
--- a/src/java.base/share/classes/java/lang/invoke/MemoryAccessVarHandleBase.java
+++ b/src/java.base/share/classes/java/lang/invoke/MemoryAccessVarHandleBase.java
@@ -42,8 +42,8 @@ abstract class MemoryAccessVarHandleBase extends VarHandle {
/** alignment constraint (in bytes, expressed as a bit mask) **/
final long alignmentMask;
- MemoryAccessVarHandleBase(VarForm form, boolean be, long length, long offset, long alignmentMask) {
- super(form);
+ MemoryAccessVarHandleBase(VarForm form, boolean be, long length, long offset, long alignmentMask, boolean exact) {
+ super(form, exact);
this.be = be;
this.length = length;
this.offset = offset;
diff --git a/src/java.base/share/classes/java/lang/invoke/MemoryAccessVarHandleGenerator.java b/src/java.base/share/classes/java/lang/invoke/MemoryAccessVarHandleGenerator.java
index 6e66fc1ab42..addd09f82b7 100644
--- a/src/java.base/share/classes/java/lang/invoke/MemoryAccessVarHandleGenerator.java
+++ b/src/java.base/share/classes/java/lang/invoke/MemoryAccessVarHandleGenerator.java
@@ -71,6 +71,7 @@
import static jdk.internal.org.objectweb.asm.Opcodes.LALOAD;
import static jdk.internal.org.objectweb.asm.Opcodes.LASTORE;
import static jdk.internal.org.objectweb.asm.Opcodes.LLOAD;
+import static jdk.internal.org.objectweb.asm.Opcodes.NEW;
import static jdk.internal.org.objectweb.asm.Opcodes.NEWARRAY;
import static jdk.internal.org.objectweb.asm.Opcodes.PUTFIELD;
import static jdk.internal.org.objectweb.asm.Opcodes.PUTSTATIC;
@@ -95,6 +96,12 @@ class MemoryAccessVarHandleGenerator {
private final static MethodHandle ADD_OFFSETS_HANDLE;
private final static MethodHandle MUL_OFFSETS_HANDLE;
+ private final static MethodType CONSTR_TYPE = MethodType.methodType(void.class, VarForm.class,
+ boolean.class, long.class, long.class, long.class, boolean.class, long[].class);
+ // MemoryAccessVarHandleBase
+ private final static MethodType SUPER_CONTR_TYPE = MethodType.methodType(void.class, VarForm.class,
+ boolean.class, long.class, long.class, long.class, boolean.class);
+
static {
helperClassCache = new HashMap<>();
helperClassCache.put(byte.class, MemoryAccessVarHandleByteHelper.class);
@@ -140,7 +147,7 @@ class MemoryAccessVarHandleGenerator {
Arrays.fill(components, long.class);
this.form = new VarForm(BASE_CLASS, MemoryAddressProxy.class, carrier, components);
this.helperClass = helperClassCache.get(carrier);
- this.implClassName = helperClass.getName().replace('.', '/') + dimensions;
+ this.implClassName = internalName(helperClass) + dimensions;
// live constants
Class>[] intermediate = new Class>[dimensions];
Arrays.fill(intermediate, long.class);
@@ -164,8 +171,7 @@ MethodHandle generateHandleFactory() {
VarForm form = new VarForm(implCls, MemoryAddressProxy.class, carrier, components);
- MethodType constrType = MethodType.methodType(void.class, VarForm.class, boolean.class, long.class, long.class, long.class, long[].class);
- MethodHandle constr = lookup.findConstructor(implCls, constrType);
+ MethodHandle constr = lookup.findConstructor(implCls, CONSTR_TYPE);
constr = MethodHandles.insertArguments(constr, 0, form);
return constr;
} catch (Throwable ex) {
@@ -202,6 +208,9 @@ byte[] generateClassBytes() {
addCarrierAccessor(cw);
+ addAsExact(cw);
+ addAsGeneric(cw);
+
for (VarHandle.AccessMode mode : VarHandle.AccessMode.values()) {
addAccessModeMethodIfNeeded(mode, cw);
}
@@ -253,23 +262,23 @@ void addStaticInitializer(ClassWriter cw) {
}
void addConstructor(ClassWriter cw) {
- MethodType constrType = MethodType.methodType(void.class, VarForm.class, boolean.class, long.class, long.class, long.class, long[].class);
- MethodVisitor mv = cw.visitMethod(0, "", constrType.toMethodDescriptorString(), null, null);
+ MethodVisitor mv = cw.visitMethod(0, "", CONSTR_TYPE.toMethodDescriptorString(), null, null);
mv.visitCode();
//super call
mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ALOAD, 1); // vform
mv.visitTypeInsn(CHECKCAST, Type.getInternalName(VarForm.class));
- mv.visitVarInsn(ILOAD, 2);
- mv.visitVarInsn(LLOAD, 3);
- mv.visitVarInsn(LLOAD, 5);
- mv.visitVarInsn(LLOAD, 7);
+ mv.visitVarInsn(ILOAD, 2); // be
+ mv.visitVarInsn(LLOAD, 3); // length
+ mv.visitVarInsn(LLOAD, 5); // offset
+ mv.visitVarInsn(LLOAD, 7); // alignmentMask
+ mv.visitVarInsn(ILOAD, 9); // exact
mv.visitMethodInsn(INVOKESPECIAL, Type.getInternalName(BASE_CLASS), "",
- MethodType.methodType(void.class, VarForm.class, boolean.class, long.class, long.class, long.class).toMethodDescriptorString(), false);
+ SUPER_CONTR_TYPE.toMethodDescriptorString(), false);
//init dimensions
for (int i = 0 ; i < dimensions ; i++) {
mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 9);
+ mv.visitVarInsn(ALOAD, 10);
mv.visitLdcInsn(i);
mv.visitInsn(LALOAD);
mv.visitFieldInsn(PUTFIELD, implClassName, "dim" + i, "J");
@@ -280,11 +289,10 @@ void addConstructor(ClassWriter cw) {
}
void addAccessModeTypeMethod(ClassWriter cw) {
- MethodType modeMethType = MethodType.methodType(MethodType.class, VarHandle.AccessMode.class);
+ MethodType modeMethType = MethodType.methodType(MethodType.class, VarHandle.AccessType.class);
MethodVisitor mv = cw.visitMethod(ACC_FINAL, "accessModeTypeUncached", modeMethType.toMethodDescriptorString(), null, null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 1);
- mv.visitFieldInsn(GETFIELD, Type.getInternalName(VarHandle.AccessMode.class), "at", VarHandle.AccessType.class.descriptorString());
mv.visitLdcInsn(Type.getType(MemoryAddressProxy.class));
mv.visitTypeInsn(CHECKCAST, Type.getInternalName(Class.class));
mv.visitFieldInsn(GETSTATIC, implClassName, "carrier", Class.class.descriptorString());
@@ -409,6 +417,38 @@ void addCarrierAccessor(ClassWriter cw) {
mv.visitEnd();
}
+ private void addAsExact(ClassWriter cw) {
+ addAsExactOrAsGeneric(cw, "asExact", true);
+ }
+
+ private void addAsGeneric(ClassWriter cw) {
+ addAsExactOrAsGeneric(cw, "asGeneric", false);
+ }
+
+ private void addAsExactOrAsGeneric(ClassWriter cw, String name, boolean exact) {
+ MethodVisitor mv = cw.visitMethod(ACC_FINAL, name, "()Ljava/lang/invoke/VarHandle;", null, null);
+ mv.visitCode();
+ mv.visitTypeInsn(NEW, implClassName);
+ mv.visitInsn(DUP);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, internalName(VarHandle.class), "vform", VarForm.class.descriptorString());
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, internalName(MemoryAccessVarHandleBase.class), "be", boolean.class.descriptorString());
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, internalName(MemoryAccessVarHandleBase.class), "length", long.class.descriptorString());
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, internalName(MemoryAccessVarHandleBase.class), "offset", long.class.descriptorString());
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, internalName(MemoryAccessVarHandleBase.class), "alignmentMask", long.class.descriptorString());
+ mv.visitIntInsn(BIPUSH, exact ? 1 : 0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKEVIRTUAL, implClassName, "strides", "()[J", false);
+ mv.visitMethodInsn(INVOKESPECIAL, implClassName, "", CONSTR_TYPE.descriptorString(), false);
+ mv.visitInsn(ARETURN);
+ mv.visitMaxs(0, 0);
+ mv.visitEnd();
+ }
+
// shared code generation helpers
private static int getSlotsForType(Class> c) {
@@ -418,6 +458,10 @@ private static int getSlotsForType(Class> c) {
return 1;
}
+ private static String internalName(Class> cls) {
+ return cls.getName().replace('.', '/');
+ }
+
/**
* Emits an actual return instruction conforming to the given return type.
*/
diff --git a/src/java.base/share/classes/java/lang/invoke/VarHandle.java b/src/java.base/share/classes/java/lang/invoke/VarHandle.java
index 4f7d5a54db0..698eb8374a1 100644
--- a/src/java.base/share/classes/java/lang/invoke/VarHandle.java
+++ b/src/java.base/share/classes/java/lang/invoke/VarHandle.java
@@ -282,8 +282,8 @@
* match fails, it means that the access mode method which the caller is
* invoking is not present on the individual VarHandle being invoked.
*
- *
- * Invocation of an access mode method behaves as if an invocation of
+ *
+ * Invocation of an access mode method behaves, by default, as if an invocation of
* {@link MethodHandle#invoke}, where the receiving method handle accepts the
* VarHandle instance as the leading argument. More specifically, the
* following, where {@code {access-mode}} corresponds to the access mode method
@@ -318,7 +318,7 @@
* widen primitive values, as if by {@link MethodHandle#asType asType} (see also
* {@link MethodHandles#varHandleInvoker}).
*
- * More concisely, such behaviour is equivalent to:
+ * More concisely, such behavior is equivalent to:
*
{@code
* VarHandle vh = ..
* VarHandle.AccessMode am = VarHandle.AccessMode.valueFromMethodName("{access-mode}");
@@ -328,6 +328,37 @@
* }
* Where, in this case, the method handle is bound to the VarHandle instance.
*
+ *
+ * A VarHandle's invocation behavior can be adjusted (see {@link #withInvokeExactBehavior}) such that invocation of
+ * an access mode method behaves as if invocation of {@link MethodHandle#invokeExact},
+ * where the receiving method handle accepts the VarHandle instance as the leading argument.
+ * More specifically, the following, where {@code {access-mode}} corresponds to the access mode method
+ * name:
+ *
{@code
+ * VarHandle vh = ..
+ * R r = (R) vh.{access-mode}(p1, p2, ..., pN);
+ * }
+ * behaves as if:
+ * {@code
+ * VarHandle vh = ..
+ * VarHandle.AccessMode am = VarHandle.AccessMode.valueFromMethodName("{access-mode}");
+ * MethodHandle mh = MethodHandles.varHandleExactInvoker(
+ * am,
+ * vh.accessModeType(am));
+ *
+ * R r = (R) mh.invokeExact(vh, p1, p2, ..., pN)
+ * }
+ * (modulo access mode methods do not declare throwing of {@code Throwable}).
+ *
+ * More concisely, such behavior is equivalent to:
+ * {@code
+ * VarHandle vh = ..
+ * VarHandle.AccessMode am = VarHandle.AccessMode.valueFromMethodName("{access-mode}");
+ * MethodHandle mh = vh.toMethodHandle(am);
+ *
+ * R r = (R) mh.invokeExact(p1, p2, ..., pN)
+ * }
+ * Where, in this case, the method handle is bound to the VarHandle instance.
*
* Invocation checking
* In typical programs, VarHandle access mode type matching will usually
@@ -425,7 +456,7 @@
* {@link java.lang.invoke.MethodHandles#varHandleInvoker}. The
* {@link java.lang.invoke.MethodHandles.Lookup#findVirtual Lookup.findVirtual}
* API is also able to return a method handle to call an access mode method for
- * any specified access mode type and is equivalent in behaviour to
+ * any specified access mode type and is equivalent in behavior to
* {@link java.lang.invoke.MethodHandles#varHandleInvoker}.
*
* Interoperation between VarHandles and Java generics
@@ -446,9 +477,15 @@
*/
public abstract class VarHandle implements Constable {
final VarForm vform;
+ final boolean exact;
VarHandle(VarForm vform) {
+ this(vform, false);
+ }
+
+ VarHandle(VarForm vform, boolean exact) {
this.vform = vform;
+ this.exact = exact;
}
RuntimeException unsupported() {
@@ -465,6 +502,18 @@ VarHandle asDirect() {
VarHandle target() { return null; }
+ /**
+ * Returns {@code true} if this VarHandle has invoke-exact behavior.
+ *
+ * @see #withInvokeExactBehavior()
+ * @see #withInvokeBehavior()
+ * @return {@code true} if this VarHandle has invoke-exact behavior.
+ * @since 16
+ */
+ public boolean hasInvokeExactBehavior() {
+ return exact;
+ }
+
// Plain accessors
/**
@@ -1541,6 +1590,44 @@ VarHandle asDirect() {
@IntrinsicCandidate
Object getAndBitwiseXorRelease(Object... args);
+ /**
+ * Returns a VarHandle, with access to the same variable(s) as this VarHandle, but whose
+ * invocation behavior of access mode methods is adjusted to
+ * invoke-exact behavior.
+ *
+ * If this VarHandle already has invoke-exact behavior this VarHandle is returned.
+ *
+ * Invoking {@link #hasInvokeExactBehavior()} on the returned var handle
+ * is guaranteed to return {@code true}.
+ *
+ * @apiNote
+ * Invoke-exact behavior guarantees that upon invocation of an access mode method
+ * the types and arity of the arguments must match the {@link #accessModeType(AccessMode) access mode type},
+ * otherwise a {@link WrongMethodTypeException} is thrown.
+ *
+ * @see #withInvokeBehavior()
+ * @see #hasInvokeExactBehavior()
+ * @return a VarHandle with invoke-exact behavior
+ * @since 16
+ */
+ public abstract VarHandle withInvokeExactBehavior();
+
+ /**
+ * Returns a VarHandle, with access to the same variable(s) as this VarHandle, but whose
+ * invocation behavior of access mode methods is adjusted to
+ * invoke behavior.
+ *
+ * If this VarHandle already has invoke behavior this VarHandle is returned.
+ *
+ * Invoking {@link #hasInvokeExactBehavior()} on the returned var handle
+ * is guaranteed to return {@code false}.
+ *
+ * @see #withInvokeExactBehavior()
+ * @see #hasInvokeExactBehavior()
+ * @return a VarHandle with invoke behavior
+ * @since 16
+ */
+ public abstract VarHandle withInvokeBehavior();
enum AccessType {
GET(Object.class),
@@ -1859,6 +1946,7 @@ static MemberName getMemberName(int ordinal, VarForm vform) {
}
static final class AccessDescriptor {
+ final MethodType symbolicMethodTypeExact;
final MethodType symbolicMethodTypeErased;
final MethodType symbolicMethodTypeInvoker;
final Class> returnType;
@@ -1866,6 +1954,7 @@ static final class AccessDescriptor {
final int mode;
public AccessDescriptor(MethodType symbolicMethodType, int type, int mode) {
+ this.symbolicMethodTypeExact = symbolicMethodType;
this.symbolicMethodTypeErased = symbolicMethodType.erase();
this.symbolicMethodTypeInvoker = symbolicMethodType.insertParameterTypes(0, VarHandle.class);
this.returnType = symbolicMethodType.returnType();
@@ -1922,15 +2011,25 @@ public List> coordinateTypes() {
* @return the access mode type for the given access mode
*/
public final MethodType accessModeType(AccessMode accessMode) {
+ return accessModeType(accessMode.at.ordinal());
+ }
+
+ @ForceInline
+ final MethodType accessModeType(int accessTypeOrdinal) {
TypesAndInvokers tis = getTypesAndInvokers();
- MethodType mt = tis.methodType_table[accessMode.at.ordinal()];
+ MethodType mt = tis.methodType_table[accessTypeOrdinal];
if (mt == null) {
- mt = tis.methodType_table[accessMode.at.ordinal()] =
- accessModeTypeUncached(accessMode);
+ mt = tis.methodType_table[accessTypeOrdinal] =
+ accessModeTypeUncached(accessTypeOrdinal);
}
return mt;
}
- abstract MethodType accessModeTypeUncached(AccessMode accessMode);
+
+ final MethodType accessModeTypeUncached(int accessTypeOrdinal) {
+ return accessModeTypeUncached(AccessType.values()[accessTypeOrdinal]);
+ }
+
+ abstract MethodType accessModeTypeUncached(AccessType accessMode);
/**
* Returns {@code true} if the given access mode is supported, otherwise
diff --git a/src/java.base/share/classes/java/lang/invoke/VarHandleGuards.java b/src/java.base/share/classes/java/lang/invoke/VarHandleGuards.java
index 9df0fe1a540..36bf67f0559 100644
--- a/src/java.base/share/classes/java/lang/invoke/VarHandleGuards.java
+++ b/src/java.base/share/classes/java/lang/invoke/VarHandleGuards.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,23 @@
package java.lang.invoke;
import jdk.internal.vm.annotation.ForceInline;
+import jdk.internal.vm.annotation.Hidden;
// This class is auto-generated by java.lang.invoke.VarHandles$GuardMethodGenerator. Do not edit.
final class VarHandleGuards {
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static Object guard_L_L(VarHandle handle, Object arg0, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
Object r = MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
return ad.returnType.cast(r);
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0);
}
@@ -44,14 +49,17 @@ final static Object guard_L_L(VarHandle handle, Object arg0, VarHandle.AccessDes
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static void guard_LL_V(VarHandle handle, Object arg0, Object arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
- }
- else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
+ } else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
@@ -59,49 +67,65 @@ else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbol
@ForceInline
@LambdaForm.Compiled
- final static Object guard_LL_L(VarHandle handle, Object arg0, Object arg1, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- Object r = MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
- return ad.returnType.cast(r);
+ @Hidden
+ final static boolean guard_LLL_Z(VarHandle handle, Object arg0, Object arg1, Object arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
+ return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
}
@ForceInline
@LambdaForm.Compiled
- final static boolean guard_LLL_Z(VarHandle handle, Object arg0, Object arg1, Object arg2, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static Object guard_LLL_L(VarHandle handle, Object arg0, Object arg1, Object arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ Object r = MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ return ad.returnType.cast(r);
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
+ return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
}
@ForceInline
@LambdaForm.Compiled
- final static Object guard_LLL_L(VarHandle handle, Object arg0, Object arg1, Object arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ @Hidden
+ final static Object guard_LL_L(VarHandle handle, Object arg0, Object arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- Object r = MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ Object r = MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
return ad.returnType.cast(r);
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
+ return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
}
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static int guard_L_I(VarHandle handle, Object arg0, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
return (int) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0);
}
@@ -109,14 +133,17 @@ final static int guard_L_I(VarHandle handle, Object arg0, VarHandle.AccessDescri
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static void guard_LI_V(VarHandle handle, Object arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
- }
- else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
+ } else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
@@ -124,47 +151,63 @@ else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbol
@ForceInline
@LambdaForm.Compiled
- final static int guard_LI_I(VarHandle handle, Object arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (int) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static boolean guard_LII_Z(VarHandle handle, Object arg0, int arg1, int arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
+ return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
}
@ForceInline
@LambdaForm.Compiled
- final static boolean guard_LII_Z(VarHandle handle, Object arg0, int arg1, int arg2, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static int guard_LII_I(VarHandle handle, Object arg0, int arg1, int arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
+ return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
}
@ForceInline
@LambdaForm.Compiled
- final static int guard_LII_I(VarHandle handle, Object arg0, int arg1, int arg2, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static int guard_LI_I(VarHandle handle, Object arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (int) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
+ return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
}
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static long guard_L_J(VarHandle handle, Object arg0, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
return (long) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0);
}
@@ -172,14 +215,17 @@ final static long guard_L_J(VarHandle handle, Object arg0, VarHandle.AccessDescr
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static void guard_LJ_V(VarHandle handle, Object arg0, long arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
- }
- else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
+ } else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
@@ -187,47 +233,63 @@ else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbol
@ForceInline
@LambdaForm.Compiled
- final static long guard_LJ_J(VarHandle handle, Object arg0, long arg1, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (long) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static boolean guard_LJJ_Z(VarHandle handle, Object arg0, long arg1, long arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
+ return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
}
@ForceInline
@LambdaForm.Compiled
- final static boolean guard_LJJ_Z(VarHandle handle, Object arg0, long arg1, long arg2, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static long guard_LJJ_J(VarHandle handle, Object arg0, long arg1, long arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
+ return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
}
@ForceInline
@LambdaForm.Compiled
- final static long guard_LJJ_J(VarHandle handle, Object arg0, long arg1, long arg2, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static long guard_LJ_J(VarHandle handle, Object arg0, long arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (long) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
+ return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
}
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static float guard_L_F(VarHandle handle, Object arg0, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
return (float) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0);
}
@@ -235,14 +297,17 @@ final static float guard_L_F(VarHandle handle, Object arg0, VarHandle.AccessDesc
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static void guard_LF_V(VarHandle handle, Object arg0, float arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
- }
- else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
+ } else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
@@ -250,47 +315,63 @@ else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbol
@ForceInline
@LambdaForm.Compiled
- final static float guard_LF_F(VarHandle handle, Object arg0, float arg1, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (float) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static boolean guard_LFF_Z(VarHandle handle, Object arg0, float arg1, float arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
+ return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
}
@ForceInline
@LambdaForm.Compiled
- final static boolean guard_LFF_Z(VarHandle handle, Object arg0, float arg1, float arg2, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static float guard_LFF_F(VarHandle handle, Object arg0, float arg1, float arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (float) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
+ return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
}
@ForceInline
@LambdaForm.Compiled
- final static float guard_LFF_F(VarHandle handle, Object arg0, float arg1, float arg2, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (float) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static float guard_LF_F(VarHandle handle, Object arg0, float arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (float) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
+ return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
}
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static double guard_L_D(VarHandle handle, Object arg0, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
return (double) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0);
}
@@ -298,14 +379,17 @@ final static double guard_L_D(VarHandle handle, Object arg0, VarHandle.AccessDes
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static void guard_LD_V(VarHandle handle, Object arg0, double arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
- }
- else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
+ } else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
@@ -313,48 +397,64 @@ else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbol
@ForceInline
@LambdaForm.Compiled
- final static double guard_LD_D(VarHandle handle, Object arg0, double arg1, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (double) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static boolean guard_LDD_Z(VarHandle handle, Object arg0, double arg1, double arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
+ return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
}
@ForceInline
@LambdaForm.Compiled
- final static boolean guard_LDD_Z(VarHandle handle, Object arg0, double arg1, double arg2, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static double guard_LDD_D(VarHandle handle, Object arg0, double arg1, double arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (double) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
+ return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
}
@ForceInline
@LambdaForm.Compiled
- final static double guard_LDD_D(VarHandle handle, Object arg0, double arg1, double arg2, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (double) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static double guard_LD_D(VarHandle handle, Object arg0, double arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (double) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
+ return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
}
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static Object guard__L(VarHandle handle, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
Object r = MethodHandle.linkToStatic(handle, handle.vform.getMemberName(ad.mode));
return ad.returnType.cast(r);
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect());
}
@@ -362,14 +462,17 @@ final static Object guard__L(VarHandle handle, VarHandle.AccessDescriptor ad) th
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static void guard_L_V(VarHandle handle, Object arg0, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
- }
- else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
+ } else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0);
}
@@ -377,11 +480,15 @@ else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbol
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static boolean guard_LL_Z(VarHandle handle, Object arg0, Object arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
@@ -389,11 +496,15 @@ final static boolean guard_LL_Z(VarHandle handle, Object arg0, Object arg1, VarH
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static int guard__I(VarHandle handle, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
return (int) MethodHandle.linkToStatic(handle, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect());
}
@@ -401,14 +512,17 @@ final static int guard__I(VarHandle handle, VarHandle.AccessDescriptor ad) throw
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static void guard_I_V(VarHandle handle, int arg0, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
- }
- else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
+ } else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0);
}
@@ -416,47 +530,63 @@ else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbol
@ForceInline
@LambdaForm.Compiled
- final static int guard_I_I(VarHandle handle, int arg0, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (int) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static boolean guard_II_Z(VarHandle handle, int arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0);
+ return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
}
@ForceInline
@LambdaForm.Compiled
- final static boolean guard_II_Z(VarHandle handle, int arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static int guard_II_I(VarHandle handle, int arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (int) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
+ return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
}
@ForceInline
@LambdaForm.Compiled
- final static int guard_II_I(VarHandle handle, int arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (int) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static int guard_I_I(VarHandle handle, int arg0, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (int) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
+ return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0);
}
}
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static long guard__J(VarHandle handle, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
return (long) MethodHandle.linkToStatic(handle, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect());
}
@@ -464,14 +594,17 @@ final static long guard__J(VarHandle handle, VarHandle.AccessDescriptor ad) thro
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static void guard_J_V(VarHandle handle, long arg0, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
- }
- else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
+ } else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0);
}
@@ -479,47 +612,63 @@ else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbol
@ForceInline
@LambdaForm.Compiled
- final static long guard_J_J(VarHandle handle, long arg0, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (long) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static boolean guard_JJ_Z(VarHandle handle, long arg0, long arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0);
+ return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
}
@ForceInline
@LambdaForm.Compiled
- final static boolean guard_JJ_Z(VarHandle handle, long arg0, long arg1, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static long guard_JJ_J(VarHandle handle, long arg0, long arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (long) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
+ return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
}
@ForceInline
@LambdaForm.Compiled
- final static long guard_JJ_J(VarHandle handle, long arg0, long arg1, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (long) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static long guard_J_J(VarHandle handle, long arg0, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (long) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
+ return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0);
}
}
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static float guard__F(VarHandle handle, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
return (float) MethodHandle.linkToStatic(handle, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect());
}
@@ -527,14 +676,17 @@ final static float guard__F(VarHandle handle, VarHandle.AccessDescriptor ad) thr
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static void guard_F_V(VarHandle handle, float arg0, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
- }
- else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
+ } else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0);
}
@@ -542,47 +694,63 @@ else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbol
@ForceInline
@LambdaForm.Compiled
- final static float guard_F_F(VarHandle handle, float arg0, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (float) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static boolean guard_FF_Z(VarHandle handle, float arg0, float arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0);
+ return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
}
@ForceInline
@LambdaForm.Compiled
- final static boolean guard_FF_Z(VarHandle handle, float arg0, float arg1, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static float guard_FF_F(VarHandle handle, float arg0, float arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (float) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
+ return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
}
@ForceInline
@LambdaForm.Compiled
- final static float guard_FF_F(VarHandle handle, float arg0, float arg1, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (float) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static float guard_F_F(VarHandle handle, float arg0, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (float) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
+ return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0);
}
}
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static double guard__D(VarHandle handle, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
return (double) MethodHandle.linkToStatic(handle, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect());
}
@@ -590,14 +758,17 @@ final static double guard__D(VarHandle handle, VarHandle.AccessDescriptor ad) th
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static void guard_D_V(VarHandle handle, double arg0, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
- }
- else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
+ } else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0);
}
@@ -605,48 +776,64 @@ else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbol
@ForceInline
@LambdaForm.Compiled
- final static double guard_D_D(VarHandle handle, double arg0, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (double) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static boolean guard_DD_Z(VarHandle handle, double arg0, double arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0);
+ return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
}
@ForceInline
@LambdaForm.Compiled
- final static boolean guard_DD_Z(VarHandle handle, double arg0, double arg1, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static double guard_DD_D(VarHandle handle, double arg0, double arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (double) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
+ return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
}
@ForceInline
@LambdaForm.Compiled
- final static double guard_DD_D(VarHandle handle, double arg0, double arg1, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (double) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static double guard_D_D(VarHandle handle, double arg0, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (double) MethodHandle.linkToStatic(handle, arg0, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
+ return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0);
}
}
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static Object guard_LI_L(VarHandle handle, Object arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
Object r = MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
return ad.returnType.cast(r);
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
@@ -654,14 +841,17 @@ final static Object guard_LI_L(VarHandle handle, Object arg0, int arg1, VarHandl
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static void guard_LIL_V(VarHandle handle, Object arg0, int arg1, Object arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
- }
- else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
+ } else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
@@ -669,52 +859,67 @@ else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbol
@ForceInline
@LambdaForm.Compiled
- final static Object guard_LIL_L(VarHandle handle, Object arg0, int arg1, Object arg2, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- Object r = MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
- return ad.returnType.cast(r);
+ @Hidden
+ final static boolean guard_LILL_Z(VarHandle handle, Object arg0, int arg1, Object arg2, Object arg3, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
+ return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
}
}
@ForceInline
@LambdaForm.Compiled
- final static boolean guard_LILL_Z(VarHandle handle, Object arg0, int arg1, Object arg2, Object arg3, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static Object guard_LILL_L(VarHandle handle, Object arg0, int arg1, Object arg2, Object arg3, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ Object r = MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
+ return ad.returnType.cast(r);
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
+ return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
}
}
@ForceInline
@LambdaForm.Compiled
- final static Object guard_LILL_L(VarHandle handle, Object arg0, int arg1, Object arg2, Object arg3, VarHandle.AccessDescriptor ad) throws Throwable {
+ @Hidden
+ final static Object guard_LIL_L(VarHandle handle, Object arg0, int arg1, Object arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- Object r = MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
+ Object r = MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
return ad.returnType.cast(r);
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
+ return mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
}
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static void guard_LII_V(VarHandle handle, Object arg0, int arg1, int arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
- }
- else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
+ } else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
@@ -722,11 +927,15 @@ else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbol
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static boolean guard_LIII_Z(VarHandle handle, Object arg0, int arg1, int arg2, int arg3, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
}
@@ -734,11 +943,15 @@ final static boolean guard_LIII_Z(VarHandle handle, Object arg0, int arg1, int a
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static int guard_LIII_I(VarHandle handle, Object arg0, int arg1, int arg2, int arg3, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
}
@@ -746,11 +959,15 @@ final static int guard_LIII_I(VarHandle handle, Object arg0, int arg1, int arg2,
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static long guard_LI_J(VarHandle handle, Object arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
return (long) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
@@ -758,14 +975,17 @@ final static long guard_LI_J(VarHandle handle, Object arg0, int arg1, VarHandle.
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static void guard_LIJ_V(VarHandle handle, Object arg0, int arg1, long arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
- }
- else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
+ } else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
@@ -773,47 +993,63 @@ else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbol
@ForceInline
@LambdaForm.Compiled
- final static long guard_LIJ_J(VarHandle handle, Object arg0, int arg1, long arg2, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static boolean guard_LIJJ_Z(VarHandle handle, Object arg0, int arg1, long arg2, long arg3, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
+ return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
}
}
@ForceInline
@LambdaForm.Compiled
- final static boolean guard_LIJJ_Z(VarHandle handle, Object arg0, int arg1, long arg2, long arg3, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static long guard_LIJJ_J(VarHandle handle, Object arg0, int arg1, long arg2, long arg3, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
+ return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
}
}
@ForceInline
@LambdaForm.Compiled
- final static long guard_LIJJ_J(VarHandle handle, Object arg0, int arg1, long arg2, long arg3, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static long guard_LIJ_J(VarHandle handle, Object arg0, int arg1, long arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
+ return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
}
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static float guard_LI_F(VarHandle handle, Object arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
return (float) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
@@ -821,14 +1057,17 @@ final static float guard_LI_F(VarHandle handle, Object arg0, int arg1, VarHandle
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static void guard_LIF_V(VarHandle handle, Object arg0, int arg1, float arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
- }
- else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
+ } else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
@@ -836,47 +1075,63 @@ else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbol
@ForceInline
@LambdaForm.Compiled
- final static float guard_LIF_F(VarHandle handle, Object arg0, int arg1, float arg2, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (float) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static boolean guard_LIFF_Z(VarHandle handle, Object arg0, int arg1, float arg2, float arg3, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
+ return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
}
}
@ForceInline
@LambdaForm.Compiled
- final static boolean guard_LIFF_Z(VarHandle handle, Object arg0, int arg1, float arg2, float arg3, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static float guard_LIFF_F(VarHandle handle, Object arg0, int arg1, float arg2, float arg3, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (float) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
+ return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
}
}
@ForceInline
@LambdaForm.Compiled
- final static float guard_LIFF_F(VarHandle handle, Object arg0, int arg1, float arg2, float arg3, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (float) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static float guard_LIF_F(VarHandle handle, Object arg0, int arg1, float arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (float) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
+ return (float) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
}
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static double guard_LI_D(VarHandle handle, Object arg0, int arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
return (double) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
@@ -884,14 +1139,17 @@ final static double guard_LI_D(VarHandle handle, Object arg0, int arg1, VarHandl
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static void guard_LID_V(VarHandle handle, Object arg0, int arg1, double arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
- }
- else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
+ } else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
@@ -899,47 +1157,63 @@ else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbol
@ForceInline
@LambdaForm.Compiled
- final static double guard_LID_D(VarHandle handle, Object arg0, int arg1, double arg2, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (double) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static boolean guard_LIDD_Z(VarHandle handle, Object arg0, int arg1, double arg2, double arg3, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
+ return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
}
}
@ForceInline
@LambdaForm.Compiled
- final static boolean guard_LIDD_Z(VarHandle handle, Object arg0, int arg1, double arg2, double arg3, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static double guard_LIDD_D(VarHandle handle, Object arg0, int arg1, double arg2, double arg3, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (double) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
+ return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
}
}
@ForceInline
@LambdaForm.Compiled
- final static double guard_LIDD_D(VarHandle handle, Object arg0, int arg1, double arg2, double arg3, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (double) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static double guard_LID_D(VarHandle handle, Object arg0, int arg1, double arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (double) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
+ return (double) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
}
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static int guard_LJ_I(VarHandle handle, Object arg0, long arg1, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
return (int) MethodHandle.linkToStatic(handle, arg0, arg1, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1);
}
@@ -947,14 +1221,17 @@ final static int guard_LJ_I(VarHandle handle, Object arg0, long arg1, VarHandle.
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static void guard_LJI_V(VarHandle handle, Object arg0, long arg1, int arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
- }
- else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
+ } else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
@@ -962,50 +1239,65 @@ else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbol
@ForceInline
@LambdaForm.Compiled
- final static int guard_LJI_I(VarHandle handle, Object arg0, long arg1, int arg2, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static boolean guard_LJII_Z(VarHandle handle, Object arg0, long arg1, int arg2, int arg3, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
+ return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
}
}
@ForceInline
@LambdaForm.Compiled
- final static boolean guard_LJII_Z(VarHandle handle, Object arg0, long arg1, int arg2, int arg3, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static int guard_LJII_I(VarHandle handle, Object arg0, long arg1, int arg2, int arg3, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
+ return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
}
}
@ForceInline
@LambdaForm.Compiled
- final static int guard_LJII_I(VarHandle handle, Object arg0, long arg1, int arg2, int arg3, VarHandle.AccessDescriptor ad) throws Throwable {
- if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
- return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
+ @Hidden
+ final static int guard_LJI_I(VarHandle handle, Object arg0, long arg1, int arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
}
- else {
+ if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+ return (int) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
- return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
+ return (int) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
}
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static void guard_LJJ_V(VarHandle handle, Object arg0, long arg1, long arg2, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
- }
- else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
+ } else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
MethodHandle.linkToStatic(handle, arg0, arg1, arg2, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2);
}
@@ -1013,11 +1305,15 @@ else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbol
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static boolean guard_LJJJ_Z(VarHandle handle, Object arg0, long arg1, long arg2, long arg3, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
return (boolean) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
return (boolean) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
}
@@ -1025,11 +1321,15 @@ final static boolean guard_LJJJ_Z(VarHandle handle, Object arg0, long arg1, long
@ForceInline
@LambdaForm.Compiled
+ @Hidden
final static long guard_LJJJ_J(VarHandle handle, Object arg0, long arg1, long arg2, long arg3, VarHandle.AccessDescriptor ad) throws Throwable {
+ if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+ throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ + ad.symbolicMethodTypeExact);
+ }
if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
return (long) MethodHandle.linkToStatic(handle, arg0, arg1, arg2, arg3, handle.vform.getMemberName(ad.mode));
- }
- else {
+ } else {
MethodHandle mh = handle.getMethodHandle(ad.mode);
return (long) mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic(handle.asDirect(), arg0, arg1, arg2, arg3);
}
diff --git a/src/java.base/share/classes/java/lang/invoke/VarHandles.java b/src/java.base/share/classes/java/lang/invoke/VarHandles.java
index 0a169951752..db2e0f7f886 100644
--- a/src/java.base/share/classes/java/lang/invoke/VarHandles.java
+++ b/src/java.base/share/classes/java/lang/invoke/VarHandles.java
@@ -31,8 +31,10 @@
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
+import java.lang.reflect.Parameter;
import java.nio.ByteOrder;
import java.util.ArrayList;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -43,6 +45,8 @@
import static java.lang.invoke.MethodHandleStatics.UNSAFE;
import static java.lang.invoke.MethodHandleStatics.VAR_HANDLE_IDENTITY_ADAPT;
import static java.lang.invoke.MethodHandleStatics.newIllegalArgumentException;
+import static java.util.stream.Collectors.joining;
+import static java.util.stream.Collectors.toList;
final class VarHandles {
@@ -349,7 +353,8 @@ static VarHandle makeMemoryAddressViewHandle(Class> carrier, long alignmentMas
.generateHandleFactory());
try {
- return maybeAdapt((VarHandle)fac.invoke(be, size, offset, alignmentMask, strides));
+ boolean exact = false;
+ return maybeAdapt((VarHandle)fac.invoke(be, size, offset, alignmentMask, exact, strides));
} catch (Throwable ex) {
throw new IllegalStateException(ex);
}
@@ -359,7 +364,7 @@ private static VarHandle maybeAdapt(VarHandle target) {
if (!VAR_HANDLE_IDENTITY_ADAPT) return target;
target = filterValue(target,
MethodHandles.identity(target.varType()), MethodHandles.identity(target.varType()));
- MethodType mtype = target.accessModeType(VarHandle.AccessMode.GET).dropParameterTypes(0, 1);
+ MethodType mtype = target.accessModeType(VarHandle.AccessMode.GET);
for (int i = 0 ; i < mtype.parameterCount() ; i++) {
target = filterCoordinates(target, i, MethodHandles.identity(mtype.parameterType(i)));
}
@@ -689,33 +694,42 @@ private static boolean isCheckedException(Class> clazz) {
// static final String GUARD_METHOD_SIG_TEMPLATE = " _()";
//
// static final String GUARD_METHOD_TEMPLATE =
-// "@ForceInline\n" +
-// "@LambdaForm.Compiled\n" +
-// "final static throws Throwable {\n" +
-// " if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodType) {\n" +
-// " MethodHandle.linkToStatic();\n" +
-// " }\n" +
-// " else {\n" +
-// " MethodHandle mh = handle.getMethodHandle(ad.mode);\n" +
-// " mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic();\n" +
-// " }\n" +
-// "}";
+// """
+// @ForceInline
+// @LambdaForm.Compiled
+// @Hidden
+// final static throws Throwable {
+// if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+// throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+// + ad.symbolicMethodTypeExact);
+// }
+// if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+// MethodHandle.linkToStatic();
+// } else {
+// MethodHandle mh = handle.getMethodHandle(ad.mode);
+// mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic();
+// }
+// }""";
//
// static final String GUARD_METHOD_TEMPLATE_V =
-// "@ForceInline\n" +
-// "@LambdaForm.Compiled\n" +
-// "final static throws Throwable {\n" +
-// " if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodType) {\n" +
-// " MethodHandle.linkToStatic();\n" +
-// " }\n" +
-// " else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodType) {\n" +
-// " MethodHandle.linkToStatic();\n" +
-// " }\n" +
-// " else {\n" +
-// " MethodHandle mh = handle.getMethodHandle(ad.mode);\n" +
-// " mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic();\n" +
-// " }\n" +
-// "}";
+// """
+// @ForceInline
+// @LambdaForm.Compiled
+// @Hidden
+// final static throws Throwable {
+// if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
+// throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+// + ad.symbolicMethodTypeExact);
+// }
+// if (handle.isDirect() && handle.vform.methodType_table[ad.type] == ad.symbolicMethodTypeErased) {
+// MethodHandle.linkToStatic();
+// } else if (handle.isDirect() && handle.vform.getMethodType_V(ad.type) == ad.symbolicMethodTypeErased) {
+// MethodHandle.linkToStatic();
+// } else {
+// MethodHandle mh = handle.getMethodHandle(ad.mode);
+// mh.asType(ad.symbolicMethodTypeInvoker).invokeBasic();
+// }
+// }""";
//
// // A template for deriving the operations
// // could be supported by annotating VarHandle directly with the
@@ -751,6 +765,7 @@ private static boolean isCheckedException(Class> clazz) {
// System.out.println("package java.lang.invoke;");
// System.out.println();
// System.out.println("import jdk.internal.vm.annotation.ForceInline;");
+// System.out.println("import jdk.internal.vm.annotation.Hidden;");
// System.out.println();
// System.out.println("// This class is auto-generated by " +
// GuardMethodGenerator.class.getName() +
@@ -803,11 +818,8 @@ private static boolean isCheckedException(Class> clazz) {
// hts.flatMap(ht -> Stream.of(VarHandleTemplate.class.getMethods()).
// map(m -> generateMethodType(m, ht.receiver, ht.value, ht.intermediates))).
// distinct().
-// map(mt -> generateMethod(mt)).
-// forEach(s -> {
-// System.out.println(s);
-// System.out.println();
-// });
+// map(GuardMethodGenerator::generateMethod).
+// forEach(System.out::println);
//
// System.out.println("}");
// }
@@ -863,6 +875,7 @@ private static boolean isCheckedException(Class> clazz) {
//
// List LINK_TO_INVOKER_ARGS = params.keySet().stream().
// collect(toList());
+// LINK_TO_INVOKER_ARGS.set(0, LINK_TO_INVOKER_ARGS.get(0) + ".asDirect()");
//
// RETURN = returnType == void.class
// ? ""
@@ -878,7 +891,7 @@ private static boolean isCheckedException(Class> clazz) {
//
// String RETURN_ERASED = returnType != Object.class
// ? ""
-// : " return ad.returnType.cast(r);";
+// : "\n return ad.returnType.cast(r);";
//
// String template = returnType == void.class
// ? GUARD_METHOD_TEMPLATE_V
@@ -895,7 +908,7 @@ private static boolean isCheckedException(Class> clazz) {
// collect(joining(", "))).
// replace("", LINK_TO_INVOKER_ARGS.stream().
// collect(joining(", ")))
-// ;
+// .indent(4);
// }
//
// static String className(Class> c) {
diff --git a/src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template b/src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template
index ef6c0257247..0e1a998d620 100644
--- a/src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template
+++ b/src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template
@@ -45,12 +45,12 @@ final class VarHandle$Type$s {
#end[Object]
FieldInstanceReadOnly(Class> receiverType, long fieldOffset{#if[Object]?, Class> fieldType}) {
- this(receiverType, fieldOffset{#if[Object]?, fieldType}, FieldInstanceReadOnly.FORM);
+ this(receiverType, fieldOffset{#if[Object]?, fieldType}, FieldInstanceReadOnly.FORM, false);
}
protected FieldInstanceReadOnly(Class> receiverType, long fieldOffset{#if[Object]?, Class> fieldType},
- VarForm form) {
- super(form);
+ VarForm form, boolean exact) {
+ super(form, exact);
this.fieldOffset = fieldOffset;
this.receiverType = receiverType;
#if[Object]
@@ -59,8 +59,22 @@ final class VarHandle$Type$s {
}
@Override
- final MethodType accessModeTypeUncached(AccessMode accessMode) {
- return accessMode.at.accessModeType(receiverType, {#if[Object]?fieldType:$type$.class});
+ public FieldInstanceReadOnly withInvokeExactBehavior() {
+ return hasInvokeExactBehavior()
+ ? this
+ : new FieldInstanceReadOnly(receiverType, fieldOffset{#if[Object]?, fieldType}, vform, true);
+ }
+
+ @Override
+ public FieldInstanceReadOnly withInvokeBehavior() {
+ return !hasInvokeExactBehavior()
+ ? this
+ : new FieldInstanceReadOnly(receiverType, fieldOffset{#if[Object]?, fieldType}, vform, false);
+ }
+
+ @Override
+ final MethodType accessModeTypeUncached(AccessType at) {
+ return at.accessModeType(receiverType, {#if[Object]?fieldType:$type$.class});
}
@Override
@@ -109,7 +123,26 @@ final class VarHandle$Type$s {
static final class FieldInstanceReadWrite extends FieldInstanceReadOnly {
FieldInstanceReadWrite(Class> receiverType, long fieldOffset{#if[Object]?, Class> fieldType}) {
- super(receiverType, fieldOffset{#if[Object]?, fieldType}, FieldInstanceReadWrite.FORM);
+ this(receiverType, fieldOffset{#if[Object]?, fieldType}, false);
+ }
+
+ private FieldInstanceReadWrite(Class> receiverType, long fieldOffset{#if[Object]?, Class> fieldType},
+ boolean exact) {
+ super(receiverType, fieldOffset{#if[Object]?, fieldType}, FieldInstanceReadWrite.FORM, exact);
+ }
+
+ @Override
+ public FieldInstanceReadWrite withInvokeExactBehavior() {
+ return hasInvokeExactBehavior()
+ ? this
+ : new FieldInstanceReadWrite(receiverType, fieldOffset{#if[Object]?, fieldType}, true);
+ }
+
+ @Override
+ public FieldInstanceReadWrite withInvokeBehavior() {
+ return !hasInvokeExactBehavior()
+ ? this
+ : new FieldInstanceReadWrite(receiverType, fieldOffset{#if[Object]?, fieldType}, false);
}
#if[Object]
@@ -364,12 +397,12 @@ final class VarHandle$Type$s {
#end[Object]
FieldStaticReadOnly(Object base, long fieldOffset{#if[Object]?, Class> fieldType}) {
- this(base, fieldOffset{#if[Object]?, fieldType}, FieldStaticReadOnly.FORM);
+ this(base, fieldOffset{#if[Object]?, fieldType}, FieldStaticReadOnly.FORM, false);
}
protected FieldStaticReadOnly(Object base, long fieldOffset{#if[Object]?, Class> fieldType},
- VarForm form) {
- super(form);
+ VarForm form, boolean exact) {
+ super(form, exact);
this.base = base;
this.fieldOffset = fieldOffset;
#if[Object]
@@ -377,6 +410,20 @@ final class VarHandle$Type$s {
#end[Object]
}
+ @Override
+ public FieldStaticReadOnly withInvokeExactBehavior() {
+ return hasInvokeExactBehavior()
+ ? this
+ : new FieldStaticReadOnly(base, fieldOffset{#if[Object]?, fieldType}, vform, true);
+ }
+
+ @Override
+ public FieldStaticReadOnly withInvokeBehavior() {
+ return !hasInvokeExactBehavior()
+ ? this
+ : new FieldStaticReadOnly(base, fieldOffset{#if[Object]?, fieldType}, vform, false);
+ }
+
@Override
public Optional describeConstable() {
var fieldTypeRef = {#if[Object]?fieldType:$type$.class}.describeConstable();
@@ -393,8 +440,8 @@ final class VarHandle$Type$s {
}
@Override
- final MethodType accessModeTypeUncached(AccessMode accessMode) {
- return accessMode.at.accessModeType(null, {#if[Object]?fieldType:$type$.class});
+ final MethodType accessModeTypeUncached(AccessType at) {
+ return at.accessModeType(null, {#if[Object]?fieldType:$type$.class});
}
@ForceInline
@@ -430,7 +477,26 @@ final class VarHandle$Type$s {
static final class FieldStaticReadWrite extends FieldStaticReadOnly {
FieldStaticReadWrite(Object base, long fieldOffset{#if[Object]?, Class> fieldType}) {
- super(base, fieldOffset{#if[Object]?, fieldType}, FieldStaticReadWrite.FORM);
+ this(base, fieldOffset{#if[Object]?, fieldType}, false);
+ }
+
+ private FieldStaticReadWrite(Object base, long fieldOffset{#if[Object]?, Class> fieldType},
+ boolean exact) {
+ super(base, fieldOffset{#if[Object]?, fieldType}, FieldStaticReadWrite.FORM, exact);
+ }
+
+ @Override
+ public FieldStaticReadWrite withInvokeExactBehavior() {
+ return hasInvokeExactBehavior()
+ ? this
+ : new FieldStaticReadWrite(base, fieldOffset{#if[Object]?, fieldType}, true);
+ }
+
+ @Override
+ public FieldStaticReadWrite withInvokeBehavior() {
+ return !hasInvokeExactBehavior()
+ ? this
+ : new FieldStaticReadWrite(base, fieldOffset{#if[Object]?, fieldType}, false);
}
#if[Object]
@@ -693,7 +759,11 @@ final class VarHandle$Type$s {
#end[Object]
Array(int abase, int ashift{#if[Object]?, Class> arrayType}) {
- super(Array.FORM);
+ this(abase, ashift{#if[Object]?, arrayType}, false);
+ }
+
+ private Array(int abase, int ashift{#if[Object]?, Class> arrayType}, boolean exact) {
+ super(Array.FORM, exact);
this.abase = abase;
this.ashift = ashift;
#if[Object]
@@ -702,6 +772,20 @@ final class VarHandle$Type$s {
#end[Object]
}
+ @Override
+ public Array withInvokeExactBehavior() {
+ return hasInvokeExactBehavior()
+ ? this
+ : new Array(abase, ashift{#if[Object]?, arrayType}, true);
+ }
+
+ @Override
+ public Array withInvokeBehavior() {
+ return !hasInvokeExactBehavior()
+ ? this
+ : new Array(abase, ashift{#if[Object]?, arrayType}, false);
+ }
+
@Override
public Optional describeConstable() {
var arrayTypeRef = {#if[Object]?arrayType:$type$[].class}.describeConstable();
@@ -712,8 +796,8 @@ final class VarHandle$Type$s {
}
@Override
- final MethodType accessModeTypeUncached(AccessMode accessMode) {
- return accessMode.at.accessModeType({#if[Object]?arrayType:$type$[].class}, {#if[Object]?arrayType.getComponentType():$type$.class}, int.class);
+ final MethodType accessModeTypeUncached(AccessType at) {
+ return at.accessModeType({#if[Object]?arrayType:$type$[].class}, {#if[Object]?arrayType.getComponentType():$type$.class}, int.class);
}
#if[Object]
diff --git a/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template b/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template
index 9ac3d25866e..cdbe6df68c4 100644
--- a/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template
+++ b/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template
@@ -68,8 +68,8 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase {
private static abstract class ByteArrayViewVarHandle extends VarHandle {
final boolean be;
- ByteArrayViewVarHandle(VarForm form, boolean be) {
- super(form);
+ ByteArrayViewVarHandle(VarForm form, boolean be, boolean exact) {
+ super(form, exact);
this.be = be;
}
}
@@ -77,12 +77,30 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase {
static final class ArrayHandle extends ByteArrayViewVarHandle {
ArrayHandle(boolean be) {
- super(ArrayHandle.FORM, be);
+ this(be, false);
+ }
+
+ private ArrayHandle(boolean be, boolean exact) {
+ super(ArrayHandle.FORM, be, exact);
+ }
+
+ @Override
+ public ArrayHandle withInvokeExactBehavior() {
+ return hasInvokeExactBehavior()
+ ? this
+ : new ArrayHandle(be, true);
+ }
+
+ @Override
+ public ArrayHandle withInvokeBehavior() {
+ return !hasInvokeExactBehavior()
+ ? this
+ : new ArrayHandle(be, false);
}
@Override
- final MethodType accessModeTypeUncached(AccessMode accessMode) {
- return accessMode.at.accessModeType(byte[].class, $type$.class, int.class);
+ final MethodType accessModeTypeUncached(AccessType at) {
+ return at.accessModeType(byte[].class, $type$.class, int.class);
}
@ForceInline
@@ -555,12 +573,30 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase {
static final class ByteBufferHandle extends ByteArrayViewVarHandle {
ByteBufferHandle(boolean be) {
- super(ByteBufferHandle.FORM, be);
+ this(be, false);
+ }
+
+ private ByteBufferHandle(boolean be, boolean exact) {
+ super(ByteBufferHandle.FORM, be, exact);
+ }
+
+ @Override
+ public ByteBufferHandle withInvokeExactBehavior() {
+ return hasInvokeExactBehavior()
+ ? this
+ : new ByteBufferHandle(be, true);
+ }
+
+ @Override
+ public ByteBufferHandle withInvokeBehavior() {
+ return !hasInvokeExactBehavior()
+ ? this
+ : new ByteBufferHandle(be, false);
}
@Override
- final MethodType accessModeTypeUncached(AccessMode accessMode) {
- return accessMode.at.accessModeType(ByteBuffer.class, $type$.class, int.class);
+ final MethodType accessModeTypeUncached(AccessType at) {
+ return at.accessModeType(ByteBuffer.class, $type$.class, int.class);
}
@ForceInline
diff --git a/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java b/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java
index 1020248796d..09da26d705e 100644
--- a/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java
+++ b/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java
@@ -354,7 +354,6 @@ public String toString() {
}
}
-
/**
* A package exported by a module, may be qualified or unqualified.
@@ -892,7 +891,6 @@ public String toString() {
}
-
/**
* A module's version string.
diff --git a/src/java.base/share/classes/java/lang/ref/Finalizer.java b/src/java.base/share/classes/java/lang/ref/Finalizer.java
index 59c59c528be..54b1283bb44 100644
--- a/src/java.base/share/classes/java/lang/ref/Finalizer.java
+++ b/src/java.base/share/classes/java/lang/ref/Finalizer.java
@@ -82,7 +82,7 @@ private void runFinalizer(JavaLangAccess jla) {
}
try {
- Object finalizee = this.get();
+ Object finalizee = this.getInactive();
if (finalizee != null && !(finalizee instanceof java.lang.Enum)) {
jla.invokeFinalize(finalizee);
diff --git a/src/java.base/share/classes/java/lang/ref/Reference.java b/src/java.base/share/classes/java/lang/ref/Reference.java
index 4c119e3d4b9..0cc1bbe3af2 100644
--- a/src/java.base/share/classes/java/lang/ref/Reference.java
+++ b/src/java.base/share/classes/java/lang/ref/Reference.java
@@ -342,6 +342,20 @@ public T get() {
return this.referent;
}
+ /**
+ * Load referent with strong semantics. Treating the referent
+ * as strong referent is ok when the Reference is inactive,
+ * because then the referent is switched to strong semantics
+ * anyway.
+ *
+ * This is only used from Finalizer to bypass the intrinsic,
+ * which might return a null referent, even though it is not
+ * null, and would subsequently not finalize the referent/finalizee.
+ */
+ T getInactive() {
+ return this.referent;
+ }
+
/**
* Tests if the referent of this reference object is {@code obj}.
* Using a {@code null} {@code obj} returns {@code true} if the
diff --git a/src/java.base/share/classes/java/net/ServerSocket.java b/src/java.base/share/classes/java/net/ServerSocket.java
index 0397d860aa9..249c09b9674 100644
--- a/src/java.base/share/classes/java/net/ServerSocket.java
+++ b/src/java.base/share/classes/java/net/ServerSocket.java
@@ -75,7 +75,6 @@
*
* Additional (implementation specific) options may also be supported.
*
- * @author unascribed
* @see java.net.SocketImpl
* @see java.net.ServerSocket#setSocketFactory(java.net.SocketImplFactory)
* @see java.nio.channels.ServerSocketChannel
diff --git a/src/java.base/share/classes/java/net/Socket.java b/src/java.base/share/classes/java/net/Socket.java
index 43b2a31df60..3357dbfe777 100644
--- a/src/java.base/share/classes/java/net/Socket.java
+++ b/src/java.base/share/classes/java/net/Socket.java
@@ -96,7 +96,6 @@
*
* Additional (implementation specific) options may also be supported.
*
- * @author unascribed
* @see java.net.Socket#setSocketImplFactory(java.net.SocketImplFactory)
* @see java.net.SocketImpl
* @see java.nio.channels.SocketChannel
diff --git a/src/java.base/share/classes/java/net/SocketImpl.java b/src/java.base/share/classes/java/net/SocketImpl.java
index 4c3e9c08970..a747cfff014 100644
--- a/src/java.base/share/classes/java/net/SocketImpl.java
+++ b/src/java.base/share/classes/java/net/SocketImpl.java
@@ -60,7 +60,6 @@
* to use the old implementation. The property and old implementation will be
* removed in a future version.
*
- * @author unascribed
* @since 1.0
*/
public abstract class SocketImpl implements SocketOptions {
diff --git a/src/java.base/share/classes/java/net/UnknownServiceException.java b/src/java.base/share/classes/java/net/UnknownServiceException.java
index fb48dd8bd60..3664e19f8e0 100644
--- a/src/java.base/share/classes/java/net/UnknownServiceException.java
+++ b/src/java.base/share/classes/java/net/UnknownServiceException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@
* not make sense, or the application is attempting to write to a
* read-only URL connection.
*
- * @author unascribed
* @since 1.0
*/
public class UnknownServiceException extends IOException {
diff --git a/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template b/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template
index 09c48e86bfc..07c7d3c7d26 100644
--- a/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template
+++ b/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template
@@ -416,6 +416,16 @@ class Direct$Type$Buffer$RW$$BO$
#end[rw]
}
+ public $Type$Buffer put(int index, $Type$Buffer src, int offset, int length) {
+#if[rw]
+ checkSegment();
+ super.put(index, src, offset, length);
+ return this;
+#else[rw]
+ throw new ReadOnlyBufferException();
+#end[rw]
+ }
+
public $Type$Buffer put($type$[] src, int offset, int length) {
#if[rw]
checkSegment();
diff --git a/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template b/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template
index 263e699ac1f..e4a89efc6d8 100644
--- a/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template
+++ b/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template
@@ -251,6 +251,16 @@ class Heap$Type$Buffer$RW$
#end[rw]
}
+ public $Type$Buffer put(int index, $Type$Buffer src, int offset, int length) {
+#if[rw]
+ checkSegment();
+ super.put(index, src, offset, length);
+ return this;
+#else[rw]
+ throw new ReadOnlyBufferException();
+#end[rw]
+ }
+
public $Type$Buffer put(int index, $type$[] src, int offset, int length) {
#if[rw]
checkSegment();
diff --git a/src/java.base/share/classes/java/nio/X-Buffer.java.template b/src/java.base/share/classes/java/nio/X-Buffer.java.template
index 4804f4b4319..8a5be7ceaf6 100644
--- a/src/java.base/share/classes/java/nio/X-Buffer.java.template
+++ b/src/java.base/share/classes/java/nio/X-Buffer.java.template
@@ -956,6 +956,76 @@ public abstract class $Type$Buffer
if (n > limit() - pos)
throw new BufferOverflowException();
+ putBuffer(pos, src, srcPos, n);
+
+ position(pos + n);
+ src.position(srcPos + n);
+
+ return this;
+ }
+
+ /**
+ * Absolute bulk put method (optional operation).
+ *
+ * This method transfers {@code length} $type$s into this buffer from
+ * the given source buffer, starting at the given {@code offset} in the
+ * source buffer and the given {@code index} in this buffer. The positions
+ * of both buffers are unchanged.
+ *
+ *
In other words, an invocation of this method of the form
+ * dst.put(index, src, offset, length)
+ * has exactly the same effect as the loop
+ *
+ *
{@code
+ * for (int i = offset, j = index; i < offset + length; i++, j++)
+ * dst.put(j, src.get(i));
+ * }
+ *
+ * except that it first checks the consistency of the supplied parameters
+ * and it is potentially much more efficient. If this buffer and
+ * the source buffer share the same backing array or memory, then the
+ * result will be as if the source elements were first copied to an
+ * intermediate location before being written into this buffer.
+ *
+ * @param index
+ * The index in this buffer at which the first $type$ will be
+ * written; must be non-negative and less than {@code limit()}
+ *
+ * @param src
+ * The buffer from which $type$s are to be read
+ *
+ * @param offset
+ * The index within the source buffer of the first $type$ to be
+ * read; must be non-negative and less than {@code src.limit()}
+ *
+ * @param length
+ * The number of $type$s to be read from the given buffer;
+ * must be non-negative and no larger than the smaller of
+ * {@code limit() - index} and {@code src.limit() - offset}
+ *
+ * @return This buffer
+ *
+ * @throws IndexOutOfBoundsException
+ * If the preconditions on the {@code index}, {@code offset}, and
+ * {@code length} parameters do not hold
+ *
+ * @throws ReadOnlyBufferException
+ * If this buffer is read-only
+ *
+ * @since 16
+ */
+ public $Type$Buffer put(int index, $Type$Buffer src, int offset, int length) {
+ Objects.checkFromIndexSize(index, length, limit());
+ Objects.checkFromIndexSize(offset, length, src.limit());
+ if (isReadOnly())
+ throw new ReadOnlyBufferException();
+
+ putBuffer(index, src, offset, length);
+
+ return this;
+ }
+
+ void putBuffer(int pos, $Type$Buffer src, int srcPos, int n) {
Object srcBase = src.base();
#if[char]
@@ -999,18 +1069,14 @@ public abstract class $Type$Buffer
}
}
#end[!byte]
-
- position(pos + n);
- src.position(srcPos + n);
#if[char]
} else { // src.isAddressable() == false
assert StringCharBuffer.class.isInstance(src);
- for (int i = 0; i < n; i++)
- put(src.get());
+ int posMax = pos + n;
+ for (int i = pos, j = srcPos; i < posMax; i++, j++)
+ put(i, src.get(j));
}
#end[char]
-
- return this;
}
/**
diff --git a/src/java.base/share/classes/java/util/Dictionary.java b/src/java.base/share/classes/java/util/Dictionary.java
index 162de2b5d62..653894765eb 100644
--- a/src/java.base/share/classes/java/util/Dictionary.java
+++ b/src/java.base/share/classes/java/util/Dictionary.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
* NOTE: This class is obsolete. New implementations should
* implement the Map interface, rather than extending this class.
*
- * @author unascribed
* @see java.util.Map
* @see java.lang.Object#equals(java.lang.Object)
* @see java.lang.Object#hashCode()
diff --git a/src/java.base/share/classes/java/util/InputMismatchException.java b/src/java.base/share/classes/java/util/InputMismatchException.java
index 3367a8a6fb5..522a5532cd4 100644
--- a/src/java.base/share/classes/java/util/InputMismatchException.java
+++ b/src/java.base/share/classes/java/util/InputMismatchException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
* retrieved does not match the pattern for the expected type, or
* that the token is out of range for the expected type.
*
- * @author unascribed
* @see java.util.Scanner
* @since 1.5
*/
diff --git a/src/java.base/share/classes/java/util/NoSuchElementException.java b/src/java.base/share/classes/java/util/NoSuchElementException.java
index 243ecb4ca02..28c20367958 100644
--- a/src/java.base/share/classes/java/util/NoSuchElementException.java
+++ b/src/java.base/share/classes/java/util/NoSuchElementException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
* Thrown by various accessor methods to indicate that the element being requested
* does not exist.
*
- * @author unascribed
* @see java.util.Enumeration#nextElement()
* @see java.util.Iterator#next()
* @since 1.0
diff --git a/src/java.base/share/classes/java/util/StringTokenizer.java b/src/java.base/share/classes/java/util/StringTokenizer.java
index 8e8a09b9828..f30f7b863a4 100644
--- a/src/java.base/share/classes/java/util/StringTokenizer.java
+++ b/src/java.base/share/classes/java/util/StringTokenizer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -95,7 +95,6 @@
* test
*
*
- * @author unascribed
* @see java.io.StreamTokenizer
* @since 1.0
*/
diff --git a/src/java.base/share/classes/java/util/regex/PatternSyntaxException.java b/src/java.base/share/classes/java/util/regex/PatternSyntaxException.java
index 4b60fbb9ec0..f58034aad3c 100644
--- a/src/java.base/share/classes/java/util/regex/PatternSyntaxException.java
+++ b/src/java.base/share/classes/java/util/regex/PatternSyntaxException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
* Unchecked exception thrown to indicate a syntax error in a
* regular-expression pattern.
*
- * @author unascribed
* @since 1.4
*/
diff --git a/src/java.base/share/classes/java/util/zip/Adler32.java b/src/java.base/share/classes/java/util/zip/Adler32.java
index ee7c06e619d..33aac1ad79d 100644
--- a/src/java.base/share/classes/java/util/zip/Adler32.java
+++ b/src/java.base/share/classes/java/util/zip/Adler32.java
@@ -25,6 +25,7 @@
package java.util.zip;
+import java.lang.ref.Reference;
import java.nio.ByteBuffer;
import sun.nio.ch.DirectBuffer;
@@ -96,8 +97,12 @@ public void update(ByteBuffer buffer) {
int rem = limit - pos;
if (rem <= 0)
return;
- if (buffer instanceof DirectBuffer) {
- adler = updateByteBuffer(adler, ((DirectBuffer)buffer).address(), pos, rem);
+ if (buffer.isDirect()) {
+ try {
+ adler = updateByteBuffer(adler, ((DirectBuffer)buffer).address(), pos, rem);
+ } finally {
+ Reference.reachabilityFence(buffer);
+ }
} else if (buffer.hasArray()) {
adler = updateBytes(adler, buffer.array(), pos + buffer.arrayOffset(), rem);
} else {
diff --git a/src/java.base/share/classes/java/util/zip/CRC32.java b/src/java.base/share/classes/java/util/zip/CRC32.java
index a70afb90e51..17264eb1798 100644
--- a/src/java.base/share/classes/java/util/zip/CRC32.java
+++ b/src/java.base/share/classes/java/util/zip/CRC32.java
@@ -25,6 +25,7 @@
package java.util.zip;
+import java.lang.ref.Reference;
import java.nio.ByteBuffer;
import java.util.Objects;
@@ -95,8 +96,12 @@ public void update(ByteBuffer buffer) {
int rem = limit - pos;
if (rem <= 0)
return;
- if (buffer instanceof DirectBuffer) {
- crc = updateByteBuffer(crc, ((DirectBuffer)buffer).address(), pos, rem);
+ if (buffer.isDirect()) {
+ try {
+ crc = updateByteBuffer(crc, ((DirectBuffer)buffer).address(), pos, rem);
+ } finally {
+ Reference.reachabilityFence(buffer);
+ }
} else if (buffer.hasArray()) {
crc = updateBytes(crc, buffer.array(), pos + buffer.arrayOffset(), rem);
} else {
diff --git a/src/java.base/share/classes/java/util/zip/CRC32C.java b/src/java.base/share/classes/java/util/zip/CRC32C.java
index 0359a798816..fa138d4d3f6 100644
--- a/src/java.base/share/classes/java/util/zip/CRC32C.java
+++ b/src/java.base/share/classes/java/util/zip/CRC32C.java
@@ -24,6 +24,7 @@
*/
package java.util.zip;
+import java.lang.ref.Reference;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
@@ -170,9 +171,13 @@ public void update(ByteBuffer buffer) {
return;
}
- if (buffer instanceof DirectBuffer) {
- crc = updateDirectByteBuffer(crc, ((DirectBuffer) buffer).address(),
- pos, limit);
+ if (buffer.isDirect()) {
+ try {
+ crc = updateDirectByteBuffer(crc, ((DirectBuffer) buffer).address(),
+ pos, limit);
+ } finally {
+ Reference.reachabilityFence(buffer);
+ }
} else if (buffer.hasArray()) {
crc = updateBytes(crc, buffer.array(), pos + buffer.arrayOffset(),
limit + buffer.arrayOffset());
diff --git a/src/java.base/share/classes/java/util/zip/ZipException.java b/src/java.base/share/classes/java/util/zip/ZipException.java
index f6dcc59cfe6..45048a4254b 100644
--- a/src/java.base/share/classes/java/util/zip/ZipException.java
+++ b/src/java.base/share/classes/java/util/zip/ZipException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
/**
* Signals that a Zip exception of some sort has occurred.
*
- * @author unascribed
* @see java.io.IOException
* @since 1.1
*/
diff --git a/src/java.base/share/classes/jdk/internal/PreviewFeature.java b/src/java.base/share/classes/jdk/internal/PreviewFeature.java
index 5624ead42d9..4bf0838ec2a 100644
--- a/src/java.base/share/classes/jdk/internal/PreviewFeature.java
+++ b/src/java.base/share/classes/jdk/internal/PreviewFeature.java
@@ -54,7 +54,6 @@
public boolean essentialAPI() default false;
public enum Feature {
- PATTERN_MATCHING_IN_INSTANCEOF,
// 8242284:
// The TEXT_BLOCKS enum constant is not used in the JDK 15 codebase, but
// exists to support the bootcycle build of JDK 15. The bootcycle build
diff --git a/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java b/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java
index 720be39e2bb..505024bebad 100644
--- a/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java
+++ b/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -573,8 +573,12 @@ private static ZoneInfo getZoneInfo(String zoneId,
// we can then pass in the dom = -1, dow > 0 into ZoneInfo
//
// hacking, assume the >=24 is the result of ZRB optimization for
- // "last", it works for now.
- if (dom < 0 || dom >= 24) {
+ // "last", it works for now. From tzdata2020d this hacking
+ // will not work for Asia/Gaza and Asia/Hebron which follow
+ // Palestine DST rules.
+ if (dom < 0 || dom >= 24 &&
+ !(zoneId.equals("Asia/Gaza") ||
+ zoneId.equals("Asia/Hebron"))) {
params[1] = -1;
params[2] = toCalendarDOW[dow];
} else {
@@ -596,7 +600,9 @@ private static ZoneInfo getZoneInfo(String zoneId,
params[7] = 0;
} else {
// hacking: see comment above
- if (dom < 0 || dom >= 24) {
+ if (dom < 0 || dom >= 24 &&
+ !(zoneId.equals("Asia/Gaza") ||
+ zoneId.equals("Asia/Hebron"))) {
params[6] = -1;
params[7] = toCalendarDOW[dow];
} else {
diff --git a/src/java.compiler/share/classes/javax/lang/model/element/ElementKind.java b/src/java.compiler/share/classes/javax/lang/model/element/ElementKind.java
index c16a4c7f978..fa609761022 100644
--- a/src/java.compiler/share/classes/javax/lang/model/element/ElementKind.java
+++ b/src/java.compiler/share/classes/javax/lang/model/element/ElementKind.java
@@ -121,20 +121,9 @@ public enum ElementKind {
RECORD_COMPONENT,
/**
- * {@preview Associated with pattern matching for {@code
- * instanceof}, a preview feature of the Java language.
- *
- * This enum constant is associated with pattern
- * matching for {@code instanceof}, a preview
- * feature of the Java language. Preview features
- * may be removed in a future release, or upgraded to permanent
- * features of the Java language.}
- *
- * A binding variable in a pattern .
- * @since 14
+ * A binding variable in a pattern.
+ * @since 16
*/
- @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.PATTERN_MATCHING_IN_INSTANCEOF,
- essentialAPI=false)
BINDING_VARIABLE;
/**
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifBorders.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifBorders.java
index 2b1b9b89f7a..c61b1258894 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifBorders.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifBorders.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,11 +25,6 @@
package com.sun.java.swing.plaf.motif;
-import sun.swing.SwingUtilities2;
-import javax.swing.*;
-import javax.swing.border.*;
-import javax.swing.plaf.*;
-
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
@@ -40,15 +35,21 @@
import java.awt.Point;
import java.awt.Rectangle;
+import javax.swing.AbstractButton;
+import javax.swing.ButtonModel;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JInternalFrame;
+import javax.swing.JMenuBar;
+import javax.swing.JPopupMenu;
+import javax.swing.UIManager;
+import javax.swing.border.AbstractBorder;
+import javax.swing.plaf.UIResource;
+
+import sun.swing.SwingUtilities2;
+
/**
* Factory object that can vend Icons appropriate for the basic {@literal L & F}.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Amy Fowler
*/
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifButtonUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifButtonUI.java
index eb2520cd2b1..08017a0b2c8 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifButtonUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifButtonUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,24 +25,27 @@
package com.sun.java.swing.plaf.motif;
-import sun.awt.AppContext;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Insets;
+import java.awt.Rectangle;
+import java.awt.Shape;
+
+import javax.swing.AbstractButton;
+import javax.swing.JComponent;
+import javax.swing.LookAndFeel;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.border.AbstractBorder;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicButtonListener;
+import javax.swing.plaf.basic.BasicButtonUI;
-import javax.swing.*;
-import javax.swing.border.*;
-import javax.swing.plaf.basic.*;
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.plaf.*;
+import sun.awt.AppContext;
/**
* MotifButton implementation
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Rich Schiavi
*/
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifCheckBoxUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifCheckBoxUI.java
index 11dc92d3a8d..fa06aa6bd02 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifCheckBoxUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifCheckBoxUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,23 +25,15 @@
package com.sun.java.swing.plaf.motif;
-import sun.awt.AppContext;
-
-import javax.swing.*;
+import javax.swing.AbstractButton;
+import javax.swing.JComponent;
+import javax.swing.UIManager;
+import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.*;
-
-import java.awt.*;
+import sun.awt.AppContext;
/**
* MotifCheckBox implementation
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Rich Schiavi
*/
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifComboBoxUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifComboBoxUI.java
index fcd12ac20d4..254b63181b3 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifComboBoxUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifComboBoxUI.java
@@ -52,14 +52,7 @@
import javax.swing.plaf.basic.ComboPopup;
/**
- * ComboBox motif look and feel
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
+ * ComboBox motif look and feel.
*
* @author Arnaud Weber
*/
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifDesktopPaneUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifDesktopPaneUI.java
index c3e1f85993b..60552b8c780 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifDesktopPaneUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifDesktopPaneUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,25 +25,26 @@
package com.sun.java.swing.plaf.motif;
-import javax.swing.*;
-import java.awt.Rectangle;
-import java.awt.Dimension;
-import java.awt.Insets;
import java.awt.Color;
-import java.awt.Graphics;
import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Insets;
import java.awt.Point;
-import javax.swing.plaf.*;
+import java.awt.Rectangle;
import java.io.Serializable;
+import javax.swing.DefaultDesktopManager;
+import javax.swing.JComponent;
+import javax.swing.JDesktopPane;
+import javax.swing.JInternalFrame;
+import javax.swing.JLayeredPane;
+import javax.swing.SwingUtilities;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.UIResource;
+
/**
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
+ * Motif desktop pane.
*
* @author David Kloba
*/
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifEditorPaneUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifEditorPaneUI.java
index c7943dff79f..3367b36f0fd 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifEditorPaneUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifEditorPaneUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,22 +22,16 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package com.sun.java.swing.plaf.motif;
-import javax.swing.*;
-import javax.swing.text.*;
-import javax.swing.plaf.*;
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicEditorPaneUI;
+import javax.swing.text.Caret;
/**
* Provides the look and feel for an pluggable content-type text editor.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Timothy Prinzing
*/
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifIconFactory.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifIconFactory.java
index c7cf812dbf5..dac6514f0c4 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifIconFactory.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifIconFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,29 +25,21 @@
package com.sun.java.swing.plaf.motif;
-import javax.swing.*;
-
-import javax.swing.plaf.UIResource;
-
import java.awt.Color;
import java.awt.Component;
-import java.awt.Dimension;
import java.awt.Graphics;
-import java.awt.Polygon;
-
import java.io.Serializable;
+import javax.swing.AbstractButton;
+import javax.swing.ButtonModel;
+import javax.swing.Icon;
+import javax.swing.JCheckBox;
+import javax.swing.UIManager;
+import javax.swing.plaf.UIResource;
+
/**
* Icon factory for the CDE/Motif Look and Feel
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
- * 1.20 04/27/99
* @author Georges Saab
*/
@SuppressWarnings("serial") // Same-version serialization only
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameUI.java
index 8d9e5122ef6..cba71847fa4 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,27 +25,29 @@
package com.sun.java.swing.plaf.motif;
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import javax.swing.event.*;
-
-import java.util.EventListener;
-
-import javax.swing.plaf.basic.*;
-import javax.swing.border.*;
-import javax.swing.plaf.*;
-
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.ActionMap;
+import javax.swing.InputMap;
+import javax.swing.JComponent;
+import javax.swing.JInternalFrame;
+import javax.swing.KeyStroke;
+import javax.swing.LookAndFeel;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.border.Border;
+import javax.swing.plaf.ActionMapUIResource;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.UIResource;
+import javax.swing.plaf.basic.BasicInternalFrameUI;
/**
* A Motif {@literal L&F} implementation of InternalFrame.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Tom Ball
*/
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLabelUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLabelUI.java
index 1da0036e3fa..f19a3c23cb5 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLabelUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLabelUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,22 +25,15 @@
package com.sun.java.swing.plaf.motif;
-import sun.awt.AppContext;
-
-import javax.swing.*;
-import javax.swing.plaf.basic.BasicLabelUI;
+import javax.swing.JComponent;
import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicLabelUI;
+
+import sun.awt.AppContext;
/**
* A Motif {@literal L&F} implementation of LabelUI.
* This merely sets up new default values in MotifLookAndFeel.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Amy Fowler
*/
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java
index 34f4bd700d2..d4993c11eb9 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java
@@ -27,39 +27,27 @@
import java.awt.Color;
import java.awt.Font;
-import java.awt.Insets;
import java.awt.event.KeyEvent;
-import java.awt.event.InputEvent;
-import java.util.*;
-import javax.swing.*;
-import javax.swing.plaf.*;
-import javax.swing.border.*;
-import javax.swing.text.JTextComponent;
-import javax.swing.text.DefaultEditorKit;
-
-import javax.swing.plaf.basic.BasicLookAndFeel;
+import javax.swing.JTextField;
+import javax.swing.UIDefaults;
+import javax.swing.border.Border;
+import javax.swing.plaf.BorderUIResource;
+import javax.swing.plaf.ColorUIResource;
+import javax.swing.plaf.FontUIResource;
+import javax.swing.plaf.InsetsUIResource;
import javax.swing.plaf.basic.BasicBorders;
-import javax.swing.plaf.basic.BasicComboBoxRenderer;
-import javax.swing.plaf.basic.BasicComboBoxEditor;
+import javax.swing.plaf.basic.BasicLookAndFeel;
+import javax.swing.text.DefaultEditorKit;
import sun.swing.SwingAccessor;
import sun.swing.SwingUtilities2;
-import sun.awt.OSInfo;
/**
* Implements the Motif Look and Feel.
* UI classes not implemented specifically for Motif will
* default to those implemented in Basic.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
- * @author unattributed
* @deprecated The Motif Look and Feel is deprecated with the intent to remove
* it in some future release. It is recommended to use
* {@link javax.swing.plaf.metal.MetalLookAndFeel} instead.
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifMenuBarUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifMenuBarUI.java
index cdc05400fe2..4e9beaa8ab4 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifMenuBarUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifMenuBarUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,35 +25,13 @@
package com.sun.java.swing.plaf.motif;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Color;
-import java.awt.Insets;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.event.*;
-import java.io.Serializable;
-
-import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.border.*;
-import javax.swing.plaf.*;
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicMenuBarUI;
-//REMIND
-import javax.swing.plaf.basic.*;
/**
* A Windows {@literal L&F} implementation of MenuBarUI. This implementation
* is a "combined" view/controller.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Georges Saab
* @author Rich Schiavi
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifOptionPaneUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifOptionPaneUI.java
index ddba46c9cc9..7da390bad23 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifOptionPaneUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifOptionPaneUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,26 +25,21 @@
package com.sun.java.swing.plaf.motif;
-import javax.swing.*;
-import javax.swing.plaf.basic.BasicOptionPaneUI;
-import javax.swing.plaf.ComponentUI;
import java.awt.Color;
-import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.Rectangle;
+
+import javax.swing.Icon;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.SwingConstants;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicOptionPaneUI;
/**
* Provides the CDE/Motif look and feel for a JOptionPane.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Scott Violet
*/
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPasswordFieldUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPasswordFieldUI.java
index 3b0159c8d7b..8e1369d7e96 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPasswordFieldUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPasswordFieldUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,22 +22,16 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package com.sun.java.swing.plaf.motif;
-import javax.swing.*;
-import javax.swing.text.*;
-import javax.swing.plaf.*;
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicPasswordFieldUI;
+import javax.swing.text.Caret;
/**
* Provides the Motif look and feel for a password field.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Timothy Prinzing
*/
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPopupMenuUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPopupMenuUI.java
index a0b182b8019..0986f81f0ff 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPopupMenuUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPopupMenuUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,36 +25,27 @@
package com.sun.java.swing.plaf.motif;
-import sun.swing.SwingUtilities2;
-import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.border.*;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
-import java.awt.Frame;
-import java.awt.Graphics;
import java.awt.Insets;
import java.awt.LayoutManager;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.event.*;
-import javax.swing.plaf.*;
+import java.awt.event.MouseEvent;
+
+import javax.swing.JComponent;
+import javax.swing.JPopupMenu;
+import javax.swing.UIDefaults;
+import javax.swing.UIManager;
+import javax.swing.border.Border;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicPopupMenuUI;
+import sun.swing.SwingUtilities2;
/**
* A Motif {@literal L&F} implementation of PopupMenuUI.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Georges Saab
* @author Rich Schiavi
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifProgressBarUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifProgressBarUI.java
index 66d99e007d4..2c53d741397 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifProgressBarUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifProgressBarUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,24 +25,12 @@
package com.sun.java.swing.plaf.motif;
-import java.awt.*;
-import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.plaf.*;
-import java.io.Serializable;
-
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicProgressBarUI;
-
/**
* A Motif ProgressBarUI.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Michael C. Albers
*/
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifRadioButtonMenuItemUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifRadioButtonMenuItemUI.java
index 3cc793fccae..1a9d7fa1e91 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifRadioButtonMenuItemUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifRadioButtonMenuItemUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,26 +25,24 @@
package com.sun.java.swing.plaf.motif;
-import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.plaf.*;
+import java.awt.Point;
+import java.awt.event.MouseEvent;
+import java.io.Serializable;
+
+import javax.swing.JComponent;
+import javax.swing.JMenuItem;
+import javax.swing.LookAndFeel;
+import javax.swing.MenuSelectionManager;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.MouseInputListener;
+import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicRadioButtonMenuItemUI;
-import java.awt.*;
-import java.awt.event.*;
-import java.io.Serializable;
import sun.swing.SwingUtilities2;
-
/**
* MotifRadioButtonMenuItem implementation
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Georges Saab
* @author Rich Schiavi
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifRadioButtonUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifRadioButtonUI.java
index 328ca4844ed..58619280493 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifRadioButtonUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifRadioButtonUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,25 +25,21 @@
package com.sun.java.swing.plaf.motif;
-import sun.awt.AppContext;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Rectangle;
-import javax.swing.*;
-import javax.swing.border.*;
+import javax.swing.AbstractButton;
+import javax.swing.JComponent;
+import javax.swing.UIManager;
+import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicRadioButtonUI;
-import javax.swing.plaf.*;
-
-import java.awt.*;
+import sun.awt.AppContext;
/**
* RadioButtonUI implementation for MotifRadioButtonUI
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Rich Schiavi
*/
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifScrollBarButton.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifScrollBarButton.java
index cb586512c82..5b812ca4c8c 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifScrollBarButton.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifScrollBarButton.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,23 +25,15 @@
package com.sun.java.swing.plaf.motif;
-import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.BasicArrowButton;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
-import java.awt.*;
-import java.awt.event.*;
+import javax.swing.UIManager;
+import javax.swing.plaf.basic.BasicArrowButton;
/**
* Motif scroll bar button.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*/
@SuppressWarnings("serial") // Superclass is not serializable across versions
public class MotifScrollBarButton extends BasicArrowButton
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifScrollBarUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifScrollBarUI.java
index 294a1c374ab..08a283f5e52 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifScrollBarUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifScrollBarUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package com.sun.java.swing.plaf.motif;
import java.awt.Dimension;
@@ -38,16 +39,8 @@
import static sun.swing.SwingUtilities2.drawHLine;
import static sun.swing.SwingUtilities2.drawVLine;
-
/**
* Implementation of ScrollBarUI for the Motif Look and Feel
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Rich Schiavi
* @author Hans Muller
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifScrollPaneUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifScrollPaneUI.java
index af659095672..833cf732b0a 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifScrollPaneUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifScrollPaneUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,23 +25,20 @@
package com.sun.java.swing.plaf.motif;
-import javax.swing.*;
-import javax.swing.border.*;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.BasicScrollPaneUI;
-
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import javax.swing.JComponent;
+import javax.swing.JScrollBar;
+import javax.swing.JScrollPane;
+import javax.swing.border.Border;
+import javax.swing.border.CompoundBorder;
+import javax.swing.border.EmptyBorder;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicScrollPaneUI;
+
/**
* A CDE/Motif {@code L&F} implementation of ScrollPaneUI.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Hans Muller
*/
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSeparatorUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSeparatorUI.java
index bc457b01b13..dac713eda7b 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSeparatorUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSeparatorUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,25 +25,13 @@
package com.sun.java.swing.plaf.motif;
-import javax.swing.*;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.Rectangle;
-import javax.swing.plaf.*;
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicSeparatorUI;
/**
* A Motif {@literal L&F} implementation of SeparatorUI.
* This implementation is a "combined" view/controller.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Georges Saab
* @author Jeff Shapiro
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSliderUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSliderUI.java
index e22db5e05cd..c8820de17c4 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSliderUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSliderUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,14 +38,7 @@
import static sun.swing.SwingUtilities2.drawVLine;
/**
- * Motif Slider
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
+ * Motif Slider.
*
* @author Jeff Dinkins
*/
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSplitPaneDivider.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSplitPaneDivider.java
index 6040eb31323..7dceae4930d 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSplitPaneDivider.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSplitPaneDivider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,23 +25,20 @@
package com.sun.java.swing.plaf.motif;
-import java.awt.*;
-import java.awt.event.*;
+import java.awt.Color;
+import java.awt.Cursor;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Insets;
+import java.awt.event.MouseEvent;
+
import javax.swing.JSplitPane;
import javax.swing.UIManager;
-import javax.swing.plaf.basic.BasicSplitPaneUI;
import javax.swing.plaf.basic.BasicSplitPaneDivider;
-
+import javax.swing.plaf.basic.BasicSplitPaneUI;
/**
* Divider used for Motif split pane.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Jeff Dinkins
*/
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSplitPaneUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSplitPaneUI.java
index 6ee670812c3..c61a1713c9b 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSplitPaneUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSplitPaneUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,21 +25,13 @@
package com.sun.java.swing.plaf.motif;
-import javax.swing.plaf.basic.BasicSplitPaneUI;
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicSplitPaneDivider;
-import javax.swing.plaf.*;
-import javax.swing.*;
-import java.awt.*;
+import javax.swing.plaf.basic.BasicSplitPaneUI;
/**
* Motif rendition of a split pane.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Jeff Dinkins
*/
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTabbedPaneUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTabbedPaneUI.java
index e7bae098a55..1c53fc4a179 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTabbedPaneUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTabbedPaneUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,23 +25,17 @@
package com.sun.java.swing.plaf.motif;
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.plaf.*;
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Rectangle;
+
+import javax.swing.JComponent;
+import javax.swing.UIManager;
+import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicTabbedPaneUI;
-import java.io.Serializable;
/**
* A Motif {@literal L&F} implementation of TabbedPaneUI.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Amy Fowler
* @author Philip Milne
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextAreaUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextAreaUI.java
index c6f4cc54b3a..baddbf3a75d 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextAreaUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextAreaUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,24 +22,18 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package com.sun.java.swing.plaf.motif;
-import javax.swing.*;
-import javax.swing.text.*;
-import javax.swing.plaf.*;
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicTextAreaUI;
+import javax.swing.text.Caret;
/**
* Provides the look and feel for a plain text editor. In this
* implementation the default UI is extended to act as a simple
* view factory.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Timothy Prinzing
*/
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextFieldUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextFieldUI.java
index 895183c1e6a..08437687ebc 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextFieldUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextFieldUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,22 +22,16 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package com.sun.java.swing.plaf.motif;
-import javax.swing.*;
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicTextFieldUI;
-import javax.swing.plaf.*;
import javax.swing.text.Caret;
/**
* Provides the Motif look and feel for a text field.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Timothy Prinzing
*/
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextPaneUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextPaneUI.java
index 3e1590a8831..e47ad4c60bf 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextPaneUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextPaneUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,22 +22,16 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package com.sun.java.swing.plaf.motif;
-import javax.swing.*;
-import javax.swing.text.*;
-import javax.swing.plaf.*;
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicTextPaneUI;
+import javax.swing.text.Caret;
/**
* Provides the look and feel for a styled text editor.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Timothy Prinzing
*/
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextUI.java
index a2a85e9cbff..b79ef19df8e 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,25 +22,29 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
package com.sun.java.swing.plaf.motif;
-import java.awt.*;
-import java.awt.event.*;
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Rectangle;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
-import javax.swing.*;
-import javax.swing.text.*;
-import javax.swing.plaf.*;
+import javax.swing.KeyStroke;
+import javax.swing.plaf.TextUI;
+import javax.swing.plaf.UIResource;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Caret;
+import javax.swing.text.DefaultCaret;
+import javax.swing.text.DefaultEditorKit;
+import javax.swing.text.JTextComponent;
/**
* Provides the look and feel features that are common across
* the Motif/CDE text LAF implementations.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Timothy Prinzing
*/
@@ -58,13 +62,6 @@ public static Caret createCaret() {
/**
* The motif caret is rendered as an I beam.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*/
@SuppressWarnings("serial") // Superclass is not serializable across versions
public static class MotifCaret extends DefaultCaret implements UIResource {
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifToggleButtonUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifToggleButtonUI.java
index b13c87e392b..eef60ade9c9 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifToggleButtonUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifToggleButtonUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,26 +25,24 @@
package com.sun.java.swing.plaf.motif;
-import sun.awt.AppContext;
-
-import java.awt.*;
-import java.awt.event.*;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Insets;
-import javax.swing.*;
-import javax.swing.border.*;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
+import javax.swing.AbstractButton;
+import javax.swing.JComponent;
+import javax.swing.LookAndFeel;
+import javax.swing.UIManager;
+import javax.swing.border.Border;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.UIResource;
+import javax.swing.plaf.basic.BasicToggleButtonUI;
+import sun.awt.AppContext;
/**
- * BasicToggleButton implementation
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
+ * BasicToggleButton implementation.
*
* @author Rich Schiavi
*/
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTreeCellRenderer.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTreeCellRenderer.java
index fbddca81841..78ec251f05d 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTreeCellRenderer.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTreeCellRenderer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,24 +25,18 @@
package com.sun.java.swing.plaf.motif;
-import javax.swing.*;
-import javax.swing.plaf.*;
-import javax.swing.tree.*;
-import java.awt.*;
-import java.awt.event.*;
-import java.beans.*;
-import java.io.*;
-import java.util.*;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.io.Serializable;
+
+import javax.swing.Icon;
+import javax.swing.UIManager;
+import javax.swing.plaf.IconUIResource;
+import javax.swing.tree.DefaultTreeCellRenderer;
/**
* Motif rendered to display a tree cell.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Jeff Dinkins
*/
@@ -62,13 +56,6 @@ public static Icon loadLeafIcon() {
/**
* Icon for a node with no children.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*/
@SuppressWarnings("serial") // Same-version serialization only
public static class TreeLeafIcon implements Icon, Serializable {
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTreeUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTreeUI.java
index 5977b807300..468ef4eb565 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTreeUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTreeUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,26 +25,20 @@
package com.sun.java.swing.plaf.motif;
-import java.awt.*;
-import java.awt.event.*;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.io.Serializable;
-import java.io.*;
-import java.util.*;
-
-import javax.swing.*;
-import javax.swing.plaf.*;
-import javax.swing.tree.*;
-import javax.swing.plaf.basic.*;
+import javax.swing.Icon;
+import javax.swing.JComponent;
+import javax.swing.UIManager;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicTreeUI;
+import javax.swing.tree.TreeCellRenderer;
/**
* Motif rendition of the tree component.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*
* @author Jeff Dinkins
*/
@@ -83,13 +77,6 @@ protected void paintHorizontalLine( Graphics g, JComponent c, int y, int left, i
/**
* The minus sign button icon.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*/
@SuppressWarnings("serial") // Same-version serialization only
public static class MotifExpandedIcon implements Icon, Serializable {
@@ -132,13 +119,6 @@ public void paintIcon(Component c, Graphics g, int x, int y) {
/**
* The plus sign button icon.
- *
- * Warning:
- * Serialized objects of this class will not be compatible with
- * future Swing releases. The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing. A future release of Swing will provide support for
- * long term persistence.
*/
@SuppressWarnings("serial") // Same-version serialization only
public static class MotifCollapsedIcon extends MotifExpandedIcon {
diff --git a/src/java.desktop/share/classes/java/awt/Robot.java b/src/java.desktop/share/classes/java/awt/Robot.java
index 535fe58a676..a7af9903e4f 100644
--- a/src/java.desktop/share/classes/java/awt/Robot.java
+++ b/src/java.desktop/share/classes/java/awt/Robot.java
@@ -43,6 +43,9 @@
import sun.awt.image.SunWritableRaster;
import sun.java2d.SunGraphicsEnvironment;
+import static sun.java2d.SunGraphicsEnvironment.toDeviceSpace;
+import static sun.java2d.SunGraphicsEnvironment.toDeviceSpaceAbs;
+
/**
* This class is used to generate native system input events
* for the purposes of test automation, self-running demos, and
@@ -385,13 +388,9 @@ private static void checkKeycodeArgument(int keycode) {
*/
public synchronized Color getPixelColor(int x, int y) {
checkScreenCaptureAllowed();
- AffineTransform tx = GraphicsEnvironment.
- getLocalGraphicsEnvironment().getDefaultScreenDevice().
- getDefaultConfiguration().getDefaultTransform();
- x = (int) (x * tx.getScaleX());
- y = (int) (y * tx.getScaleY());
- Color color = new Color(peer.getRGBPixel(x, y));
- return color;
+ Point point = peer.useAbsoluteCoordinates() ? toDeviceSpaceAbs(x, y)
+ : toDeviceSpace(x, y);
+ return new Color(peer.getRGBPixel(point.x, point.y));
}
/**
@@ -523,17 +522,16 @@ public synchronized BufferedImage createScreenCapture(Rectangle screenRect) {
imageArray[0] = highResolutionImage;
} else {
-
- int sX = (int) Math.floor(screenRect.x * uiScaleX);
- int sY = (int) Math.floor(screenRect.y * uiScaleY);
- int sWidth = (int) Math.ceil(screenRect.width * uiScaleX);
- int sHeight = (int) Math.ceil(screenRect.height * uiScaleY);
- int[] temppixels;
- Rectangle scaledRect = new Rectangle(sX, sY, sWidth, sHeight);
- temppixels = peer.getRGBPixels(scaledRect);
-
+ Rectangle scaledRect;
+ if (peer.useAbsoluteCoordinates()) {
+ scaledRect = toDeviceSpaceAbs(gc, screenRect.x,
+ screenRect.y, screenRect.width, screenRect.height);
+ } else {
+ scaledRect = toDeviceSpace(gc, screenRect.x,
+ screenRect.y, screenRect.width, screenRect.height);
+ }
// HighResolutionImage
- pixels = temppixels;
+ pixels = peer.getRGBPixels(scaledRect);
buffer = new DataBufferInt(pixels, pixels.length);
raster = Raster.createPackedRaster(buffer, scaledRect.width,
scaledRect.height, scaledRect.width, bandmasks, null);
diff --git a/src/java.desktop/share/classes/java/awt/color/ColorSpace.java b/src/java.desktop/share/classes/java/awt/color/ColorSpace.java
index ecb40c2844f..f88bde99dad 100644
--- a/src/java.desktop/share/classes/java/awt/color/ColorSpace.java
+++ b/src/java.desktop/share/classes/java/awt/color/ColorSpace.java
@@ -244,25 +244,25 @@ public abstract class ColorSpace implements Serializable {
/**
- * The sRGB color space defined at
+ * The built-in sRGB color space defined at
*
* http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html.
*/
@Native public static final int CS_sRGB = 1000;
/**
- * A built-in linear RGB color space. This space is based on the same RGB
+ * The built-in linear RGB color space. This space is based on the same RGB
* primaries as {@code CS_sRGB}, but has a linear tone reproduction curve.
*/
@Native public static final int CS_LINEAR_RGB = 1004;
/**
- * The CIEXYZ conversion color space defined above.
+ * The built-in CIEXYZ conversion color space defined above.
*/
@Native public static final int CS_CIEXYZ = 1001;
/**
- * The Photo YCC conversion color space.
+ * The built-in Photo YCC conversion color space.
*/
@Native public static final int CS_PYCC = 1002;
diff --git a/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java b/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java
index 73b5f1ebb92..da571ab5db7 100644
--- a/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java
+++ b/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java
@@ -115,10 +115,10 @@ public class ICC_ColorSpace extends ColorSpace {
private boolean needScaleInit = true;
// {to,from}{RGB,CIEXYZ} methods create and cache these when needed
- private transient ColorTransform this2srgb;
- private transient ColorTransform srgb2this;
- private transient ColorTransform this2xyz;
- private transient ColorTransform xyz2this;
+ private transient volatile ColorTransform this2srgb;
+ private transient volatile ColorTransform srgb2this;
+ private transient volatile ColorTransform this2xyz;
+ private transient volatile ColorTransform xyz2this;
/**
* Constructs a new {@code ICC_ColorSpace} from an {@code ICC_Profile}
@@ -193,20 +193,22 @@ public ICC_Profile getProfile() {
* @throws ArrayIndexOutOfBoundsException if array length is not at least
* the number of components in this {@code ColorSpace}
*/
- public float[] toRGB (float[] colorvalue) {
-
+ public float[] toRGB(float[] colorvalue) {
if (this2srgb == null) {
- ColorTransform[] transformList = new ColorTransform [2];
- ICC_ColorSpace srgbCS =
- (ICC_ColorSpace) ColorSpace.getInstance (CS_sRGB);
- PCMM mdl = CMSManager.getModule();
- transformList[0] = mdl.createTransform(
- thisProfile, ColorTransform.Any, ColorTransform.In);
- transformList[1] = mdl.createTransform(
- srgbCS.getProfile(), ColorTransform.Any, ColorTransform.Out);
- this2srgb = mdl.createTransform(transformList);
- if (needScaleInit) {
- setComponentScaling();
+ synchronized (this) {
+ if (this2srgb == null) {
+ ColorTransform[] transforms = new ColorTransform[2];
+ var srgb = (ICC_ColorSpace) getInstance(CS_sRGB);
+ PCMM mdl = CMSManager.getModule();
+ transforms[0] = mdl.createTransform(thisProfile,
+ ColorTransform.Any, ColorTransform.In);
+ transforms[1] = mdl.createTransform(srgb.getProfile(),
+ ColorTransform.Any, ColorTransform.Out);
+ if (needScaleInit) {
+ setComponentScaling();
+ }
+ this2srgb = mdl.createTransform(transforms);
+ }
}
}
@@ -243,20 +245,22 @@ public float[] toRGB (float[] colorvalue) {
* this {@code ColorSpace}
* @throws ArrayIndexOutOfBoundsException if array length is not at least 3
*/
- public float[] fromRGB(float[] rgbvalue) {
-
+ public float[] fromRGB(float[] rgbvalue) {
if (srgb2this == null) {
- ColorTransform[] transformList = new ColorTransform [2];
- ICC_ColorSpace srgbCS =
- (ICC_ColorSpace) ColorSpace.getInstance (CS_sRGB);
- PCMM mdl = CMSManager.getModule();
- transformList[0] = mdl.createTransform(
- srgbCS.getProfile(), ColorTransform.Any, ColorTransform.In);
- transformList[1] = mdl.createTransform(
- thisProfile, ColorTransform.Any, ColorTransform.Out);
- srgb2this = mdl.createTransform(transformList);
- if (needScaleInit) {
- setComponentScaling();
+ synchronized (this) {
+ if (srgb2this == null) {
+ ColorTransform[] transforms = new ColorTransform[2];
+ var srgb = (ICC_ColorSpace) getInstance(CS_sRGB);
+ PCMM mdl = CMSManager.getModule();
+ transforms[0] = mdl.createTransform(srgb.getProfile(),
+ ColorTransform.Any, ColorTransform.In);
+ transforms[1] = mdl.createTransform(thisProfile,
+ ColorTransform.Any, ColorTransform.Out);
+ if (needScaleInit) {
+ setComponentScaling();
+ }
+ srgb2this = mdl.createTransform(transforms);
+ }
}
}
@@ -373,26 +377,28 @@ public float[] fromRGB(float[] rgbvalue) {
* @throws ArrayIndexOutOfBoundsException if array length is not at least
* the number of components in this {@code ColorSpace}
*/
- public float[] toCIEXYZ(float[] colorvalue) {
-
+ public float[] toCIEXYZ(float[] colorvalue) {
if (this2xyz == null) {
- ColorTransform[] transformList = new ColorTransform [2];
- ICC_ColorSpace xyzCS =
- (ICC_ColorSpace) ColorSpace.getInstance (CS_CIEXYZ);
- PCMM mdl = CMSManager.getModule();
- try {
- transformList[0] = mdl.createTransform(
- thisProfile, ICC_Profile.icRelativeColorimetric,
- ColorTransform.In);
- } catch (CMMException e) {
- transformList[0] = mdl.createTransform(
- thisProfile, ColorTransform.Any, ColorTransform.In);
- }
- transformList[1] = mdl.createTransform(
- xyzCS.getProfile(), ColorTransform.Any, ColorTransform.Out);
- this2xyz = mdl.createTransform (transformList);
- if (needScaleInit) {
- setComponentScaling();
+ synchronized (this) {
+ if (this2xyz == null) {
+ ColorTransform[] transforms = new ColorTransform[2];
+ var xyz = (ICC_ColorSpace) getInstance(CS_CIEXYZ);
+ PCMM mdl = CMSManager.getModule();
+ try {
+ transforms[0] = mdl.createTransform(thisProfile,
+ ICC_Profile.icRelativeColorimetric,
+ ColorTransform.In);
+ } catch (CMMException e) {
+ transforms[0] = mdl.createTransform(thisProfile,
+ ColorTransform.Any, ColorTransform.In);
+ }
+ transforms[1] = mdl.createTransform(xyz.getProfile(),
+ ColorTransform.Any, ColorTransform.Out);
+ if (needScaleInit) {
+ setComponentScaling();
+ }
+ this2xyz = mdl.createTransform(transforms);
+ }
}
}
@@ -511,26 +517,28 @@ public float[] toCIEXYZ(float[] colorvalue) {
* this {@code ColorSpace}
* @throws ArrayIndexOutOfBoundsException if array length is not at least 3
*/
- public float[] fromCIEXYZ(float[] colorvalue) {
-
+ public float[] fromCIEXYZ(float[] colorvalue) {
if (xyz2this == null) {
- ColorTransform[] transformList = new ColorTransform [2];
- ICC_ColorSpace xyzCS =
- (ICC_ColorSpace) ColorSpace.getInstance (CS_CIEXYZ);
- PCMM mdl = CMSManager.getModule();
- transformList[0] = mdl.createTransform (
- xyzCS.getProfile(), ColorTransform.Any, ColorTransform.In);
- try {
- transformList[1] = mdl.createTransform(
- thisProfile, ICC_Profile.icRelativeColorimetric,
- ColorTransform.Out);
- } catch (CMMException e) {
- transformList[1] = CMSManager.getModule().createTransform(
- thisProfile, ColorTransform.Any, ColorTransform.Out);
- }
- xyz2this = mdl.createTransform(transformList);
- if (needScaleInit) {
- setComponentScaling();
+ synchronized (this) {
+ if (xyz2this == null) {
+ ColorTransform[] transforms = new ColorTransform[2];
+ var xyz = (ICC_ColorSpace) getInstance(CS_CIEXYZ);
+ PCMM mdl = CMSManager.getModule();
+ transforms[0] = mdl.createTransform(xyz.getProfile(),
+ ColorTransform.Any, ColorTransform.In);
+ try {
+ transforms[1] = mdl.createTransform(thisProfile,
+ ICC_Profile.icRelativeColorimetric,
+ ColorTransform.Out);
+ } catch (CMMException e) {
+ transforms[1] = mdl.createTransform(thisProfile,
+ ColorTransform.Any, ColorTransform.Out);
+ }
+ if (needScaleInit) {
+ setComponentScaling();
+ }
+ xyz2this = mdl.createTransform(transforms);
+ }
}
}
diff --git a/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java b/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java
index 1ccfa05818e..b4e38a25c7e 100644
--- a/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java
+++ b/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java
@@ -831,8 +831,6 @@ else if ((getColorSpaceType (p) == ColorSpace.TYPE_RGB) &&
*/
public static ICC_Profile getInstance (int cspace) {
ICC_Profile thisProfile = null;
- String fileName;
-
switch (cspace) {
case ColorSpace.CS_sRGB:
synchronized(ICC_Profile.class) {
@@ -870,17 +868,11 @@ public static ICC_Profile getInstance (int cspace) {
case ColorSpace.CS_PYCC:
synchronized(ICC_Profile.class) {
if (PYCCprofile == null) {
- if (standardProfileExists("PYCC.pf"))
- {
- ProfileDeferralInfo pInfo =
- new ProfileDeferralInfo("PYCC.pf",
- ColorSpace.TYPE_3CLR, 3,
- CLASS_DISPLAY);
- PYCCprofile = getDeferredInstance(pInfo);
- } else {
- throw new IllegalArgumentException(
- "Can't load standard profile: PYCC.pf");
- }
+ ProfileDeferralInfo pInfo =
+ new ProfileDeferralInfo("PYCC.pf",
+ ColorSpace.TYPE_3CLR, 3,
+ CLASS_DISPLAY);
+ PYCCprofile = getDeferredInstance(pInfo);
}
thisProfile = PYCCprofile;
}
@@ -1851,17 +1843,6 @@ private static boolean isChildOf(File f, String dirName) {
}
}
- /**
- * Checks whether built-in profile specified by fileName exists.
- */
- private static boolean standardProfileExists(final String fileName) {
- return AccessController.doPrivileged(new PrivilegedAction() {
- public Boolean run() {
- return PCMM.class.getResource("profiles/"+fileName) != null;
- }
- });
- }
-
/*
* Serialization support.
*
diff --git a/src/java.desktop/share/classes/java/awt/peer/RobotPeer.java b/src/java.desktop/share/classes/java/awt/peer/RobotPeer.java
index 4c77e193073..10a901817a2 100644
--- a/src/java.desktop/share/classes/java/awt/peer/RobotPeer.java
+++ b/src/java.desktop/share/classes/java/awt/peer/RobotPeer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -117,4 +117,14 @@ public interface RobotPeer
* @see Robot#createScreenCapture(Rectangle)
*/
int[] getRGBPixels(Rectangle bounds);
+
+ /**
+ * Determines if absolute coordinates should be used by this peer.
+ *
+ * @return {@code true} if absolute coordinates should be used,
+ * {@code false} otherwise
+ */
+ default boolean useAbsoluteCoordinates() {
+ return false;
+ }
}
diff --git a/src/java.desktop/share/classes/javax/swing/SwingUtilities.java b/src/java.desktop/share/classes/javax/swing/SwingUtilities.java
index 9dcb5d5ece8..db8b71e3b2c 100644
--- a/src/java.desktop/share/classes/javax/swing/SwingUtilities.java
+++ b/src/java.desktop/share/classes/javax/swing/SwingUtilities.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,6 @@
/**
* A collection of utility methods for Swing.
*
- * @author unknown
* @since 1.2
*/
public class SwingUtilities implements SwingConstants
diff --git a/src/java.desktop/share/classes/javax/swing/UnsupportedLookAndFeelException.java b/src/java.desktop/share/classes/javax/swing/UnsupportedLookAndFeelException.java
index a82c97d9940..02910664ea5 100644
--- a/src/java.desktop/share/classes/javax/swing/UnsupportedLookAndFeelException.java
+++ b/src/java.desktop/share/classes/javax/swing/UnsupportedLookAndFeelException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,6 @@
* has been added to the java.beans
package.
* Please see {@link java.beans.XMLEncoder}.
*
- * @author unattributed
* @since 1.2
*/
@SuppressWarnings("serial") // Same-version serialization only
diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java
index 8c709c72070..d893f62bbd1 100644
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -100,8 +100,6 @@
* of all JavaBeans
* has been added to the java.beans
package.
* Please see {@link java.beans.XMLEncoder}.
- *
- * @author unattributed
*/
@SuppressWarnings("serial") // Same-version serialization only
public abstract class BasicLookAndFeel extends LookAndFeel implements Serializable
diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java
index 243d465ac3e..a26f0511432 100644
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1226,6 +1226,7 @@ public void stateChanged(ChangeEvent ev) {
// menu hidden -- return focus to where it had been before
// and uninstall menu keybindings
removeItems();
+ menuInputMap = null;
} else {
if (popup != lastPopup) {
receivedKeyPressed = false;
diff --git a/src/java.desktop/share/classes/sun/java2d/SunGraphicsEnvironment.java b/src/java.desktop/share/classes/sun/java2d/SunGraphicsEnvironment.java
index 0f3f195fb19..c5ce7ebd315 100644
--- a/src/java.desktop/share/classes/sun/java2d/SunGraphicsEnvironment.java
+++ b/src/java.desktop/share/classes/sun/java2d/SunGraphicsEnvironment.java
@@ -27,6 +27,7 @@
import java.awt.AWTError;
import java.awt.Color;
+import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
@@ -349,53 +350,124 @@ public static GraphicsConfiguration getGraphicsConfigurationAtPoint(
}
/**
- * Converts coordinates from the user's space to the device space using
- * appropriate device transformation.
+ * Returns the bounds of the graphics configuration in device space.
+ *
+ * @param config the graphics configuration which bounds are requested
+ * @return the bounds of the area covered by this
+ * {@code GraphicsConfiguration} in device space (pixels)
+ */
+ public static Rectangle getGCDeviceBounds(GraphicsConfiguration config) {
+ AffineTransform tx = config.getDefaultTransform();
+ Rectangle bounds = config.getBounds();
+ bounds.width *= tx.getScaleX();
+ bounds.height *= tx.getScaleY();
+ return bounds;
+ }
+
+ /**
+ * Converts the size (w, h) from the device space to the user's space using
+ * passed graphics configuration.
+ *
+ * @param gc the graphics configuration to be used for transformation
+ * @param w the width in the device space
+ * @param h the height in the device space
+ * @return the size in the user's space
+ */
+ public static Dimension toUserSpace(GraphicsConfiguration gc,
+ int w, int h) {
+ AffineTransform tx = gc.getDefaultTransform();
+ return new Dimension(
+ Region.clipRound(w / tx.getScaleX()),
+ Region.clipRound(h / tx.getScaleY())
+ );
+ }
+
+ /**
+ * Converts absolute coordinates from the user's space to the device space
+ * using appropriate device transformation.
*
- * @param x coordinate in the user space
- * @param y coordinate in the user space
- * @return the point which uses device space(pixels)
+ * @param x absolute coordinate in the user's space
+ * @param y absolute coordinate in the user's space
+ * @return the point which uses device space (pixels)
*/
- public static Point convertToDeviceSpace(double x, double y) {
+ public static Point toDeviceSpaceAbs(int x, int y) {
GraphicsConfiguration gc = getLocalGraphicsEnvironment()
- .getDefaultScreenDevice().getDefaultConfiguration();
+ .getDefaultScreenDevice().getDefaultConfiguration();
gc = getGraphicsConfigurationAtPoint(gc, x, y);
+ return toDeviceSpaceAbs(gc, x, y, 0, 0).getLocation();
+ }
+ /**
+ * Converts the rectangle from the user's space to the device space using
+ * appropriate device transformation.
+ *
+ * @param rect the rectangle in the user's space
+ * @return the rectangle which uses device space (pixels)
+ */
+ public static Rectangle toDeviceSpaceAbs(Rectangle rect) {
+ GraphicsConfiguration gc = getLocalGraphicsEnvironment()
+ .getDefaultScreenDevice().getDefaultConfiguration();
+ gc = getGraphicsConfigurationAtPoint(gc, rect.x, rect.y);
+ return toDeviceSpaceAbs(gc, rect.x, rect.y, rect.width, rect.height);
+ }
+
+ /**
+ * Converts absolute coordinates (x, y) and the size (w, h) from the user's
+ * space to the device space using passed graphics configuration.
+ *
+ * @param gc the graphics configuration to be used for transformation
+ * @param x absolute coordinate in the user's space
+ * @param y absolute coordinate in the user's space
+ * @param w the width in the user's space
+ * @param h the height in the user's space
+ * @return the rectangle which uses device space (pixels)
+ */
+ public static Rectangle toDeviceSpaceAbs(GraphicsConfiguration gc,
+ int x, int y, int w, int h) {
AffineTransform tx = gc.getDefaultTransform();
- x = Region.clipRound(x * tx.getScaleX());
- y = Region.clipRound(y * tx.getScaleY());
- return new Point((int) x, (int) y);
+ Rectangle screen = gc.getBounds();
+ return new Rectangle(
+ screen.x + Region.clipRound((x - screen.x) * tx.getScaleX()),
+ screen.y + Region.clipRound((y - screen.y) * tx.getScaleY()),
+ Region.clipRound(w * tx.getScaleX()),
+ Region.clipRound(h * tx.getScaleY())
+ );
}
/**
- * Converts bounds from the user's space to the device space using
+ * Converts coordinates from the user's space to the device space using
* appropriate device transformation.
*
- * @param bounds the rectangle in the user space
- * @return the rectangle which uses device space(pixels)
+ * @param x coordinate in the user's space
+ * @param y coordinate in the user's space
+ * @return the point which uses device space (pixels)
*/
- public static Rectangle convertToDeviceSpace(Rectangle bounds) {
+ public static Point toDeviceSpace(int x, int y) {
GraphicsConfiguration gc = getLocalGraphicsEnvironment()
.getDefaultScreenDevice().getDefaultConfiguration();
- gc = getGraphicsConfigurationAtPoint(gc, bounds.x, bounds.y);
- return convertToDeviceSpace(gc, bounds);
+ gc = getGraphicsConfigurationAtPoint(gc, x, y);
+ return toDeviceSpace(gc, x, y, 0, 0).getLocation();
}
/**
- * Converts bounds from the user's space to the device space using
- * appropriate device transformation of the passed graphics configuration.
+ * Converts coordinates (x, y) and the size (w, h) from the user's
+ * space to the device space using passed graphics configuration.
*
- * @param bounds the rectangle in the user space
- * @return the rectangle which uses device space(pixels)
+ * @param gc the graphics configuration to be used for transformation
+ * @param x coordinate in the user's space
+ * @param y coordinate in the user's space
+ * @param w the width in the user's space
+ * @param h the height in the user's space
+ * @return the rectangle which uses device space (pixels)
*/
- public static Rectangle convertToDeviceSpace(GraphicsConfiguration gc,
- Rectangle bounds) {
+ public static Rectangle toDeviceSpace(GraphicsConfiguration gc,
+ int x, int y, int w, int h) {
AffineTransform tx = gc.getDefaultTransform();
return new Rectangle(
- Region.clipRound(bounds.x * tx.getScaleX()),
- Region.clipRound(bounds.y * tx.getScaleY()),
- Region.clipRound(bounds.width * tx.getScaleX()),
- Region.clipRound(bounds.height * tx.getScaleY())
+ Region.clipRound(x * tx.getScaleX()),
+ Region.clipRound(y * tx.getScaleY()),
+ Region.clipRound(w * tx.getScaleX()),
+ Region.clipRound(h * tx.getScaleY())
);
}
}
diff --git a/src/java.desktop/share/classes/sun/java2d/cmm/CMSManager.java b/src/java.desktop/share/classes/sun/java2d/cmm/CMSManager.java
index fea14af51ed..4d9f09c5905 100644
--- a/src/java.desktop/share/classes/sun/java2d/cmm/CMSManager.java
+++ b/src/java.desktop/share/classes/sun/java2d/cmm/CMSManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,14 +25,11 @@
package sun.java2d.cmm;
+import java.awt.color.CMMException;
import java.awt.color.ColorSpace;
import java.awt.color.ICC_Profile;
-import java.awt.color.CMMException;
-import java.awt.image.BufferedImage;
-import java.awt.image.Raster;
-import java.awt.image.WritableRaster;
import java.security.AccessController;
-import java.security.PrivilegedAction;
+
import sun.security.action.GetPropertyAction;
public class CMSManager {
@@ -103,11 +100,6 @@ public Profile loadProfile(byte[] data) {
return p;
}
- public void freeProfile(Profile p) {
- System.err.printf(cName + ".freeProfile(ID=%s)\n", p.toString());
- tcmm.freeProfile(p);
- }
-
public int getProfileSize(Profile p) {
System.err.print(cName + ".getProfileSize(ID=" + p + ")");
int size = tcmm.getProfileSize(p);
diff --git a/src/java.desktop/share/classes/sun/java2d/cmm/PCMM.java b/src/java.desktop/share/classes/sun/java2d/cmm/PCMM.java
index d147f0a42dc..0526abafeca 100644
--- a/src/java.desktop/share/classes/sun/java2d/cmm/PCMM.java
+++ b/src/java.desktop/share/classes/sun/java2d/cmm/PCMM.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@ public interface PCMM {
/* methods invoked from ICC_Profile */
public Profile loadProfile(byte[] data);
- public void freeProfile(Profile p);
public int getProfileSize(Profile p);
public void getProfileData(Profile p, byte[] data);
public void getTagData(Profile p, int tagSignature, byte[] data);
diff --git a/src/java.desktop/share/classes/sun/java2d/cmm/ProfileDeferralMgr.java b/src/java.desktop/share/classes/sun/java2d/cmm/ProfileDeferralMgr.java
index 49b6808baa4..d19b6f6da68 100644
--- a/src/java.desktop/share/classes/sun/java2d/cmm/ProfileDeferralMgr.java
+++ b/src/java.desktop/share/classes/sun/java2d/cmm/ProfileDeferralMgr.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -59,23 +59,6 @@ public static void registerDeferral(ProfileActivator pa) {
}
- /**
- * Removes a ProfileActivator object from the vector of ProfileActivator
- * objects whose activate method will be called if the CMM needs to be
- * activated.
- */
- public static void unregisterDeferral(ProfileActivator pa) {
-
- if (!deferring) {
- return;
- }
- if (aVector == null) {
- return;
- }
- aVector.removeElement(pa);
- return;
- }
-
/**
* Removes a ProfileActivator object from the vector of ProfileActivator
* objects whose activate method will be called if the CMM needs to be
diff --git a/src/java.desktop/share/classes/sun/java2d/cmm/lcms/LCMS.java b/src/java.desktop/share/classes/sun/java2d/cmm/lcms/LCMS.java
index a9e6adbbed9..32232d02798 100644
--- a/src/java.desktop/share/classes/sun/java2d/cmm/lcms/LCMS.java
+++ b/src/java.desktop/share/classes/sun/java2d/cmm/lcms/LCMS.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
import java.awt.color.CMMException;
import java.awt.color.ICC_Profile;
+
import sun.java2d.cmm.ColorTransform;
import sun.java2d.cmm.PCMM;
import sun.java2d.cmm.Profile;
@@ -56,12 +57,6 @@ private LCMSProfile getLcmsProfile(Profile p) {
throw new CMMException("Invalid profile: " + p);
}
-
- @Override
- public void freeProfile(Profile p) {
- // we use disposer, so this method does nothing
- }
-
@Override
public int getProfileSize(final Profile p) {
synchronized (p) {
diff --git a/src/java.desktop/share/legal/harfbuzz.md b/src/java.desktop/share/legal/harfbuzz.md
index 16698bc86ac..465bcf5be3c 100644
--- a/src/java.desktop/share/legal/harfbuzz.md
+++ b/src/java.desktop/share/legal/harfbuzz.md
@@ -1,16 +1,18 @@
-## Harfbuzz v2.3.1
+## Harfbuzz v2.7.2
### Harfbuzz License
-http://cgit.freedesktop.org/harfbuzz/tree/COPYING
+https://github.com/harfbuzz/harfbuzz/blob/master/COPYING
-HarfBuzz is licensed under the so-called "Old MIT" license. Details follow.
+HarfBuzz is licensed under the so-called "Old MIT" license. Details follow.
For parts of HarfBuzz that are licensed under different licenses see individual
files names COPYING in subdirectories where applicable.
-Copyright © 2010,2011,2012 Google, Inc.
+Copyright © 2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020 Google, Inc.
+Copyright © 2018,2019,2020 Ebrahim Byagowi
+Copyright © 2019,2020 Facebook, Inc.
Copyright © 2012 Mozilla Foundation
Copyright © 2011 Codethink Limited
Copyright © 2008,2010 Nokia Corporation and/or its subsidiary(-ies)
diff --git a/src/java.desktop/share/native/libharfbuzz/hb-aat-fdsc-table.hh b/src/java.desktop/share/native/libharfbuzz/hb-aat-fdsc-table.hh
deleted file mode 100644
index 4ee7353346d..00000000000
--- a/src/java.desktop/share/native/libharfbuzz/hb-aat-fdsc-table.hh
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright © 2018 Ebrahim Byagowi
- *
- * This is part of HarfBuzz, a text shaping library.
- *
- * Permission is hereby granted, without written agreement and without
- * license or royalty fees, to use, copy, modify, and distribute this
- * software and its documentation for any purpose, provided that the
- * above copyright notice and the following two paragraphs appear in
- * all copies of this software.
- *
- * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
- * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
- * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
- * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
- * DAMAGE.
- *
- * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
- * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
- * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
- * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- */
-
-#ifndef HB_AAT_FDSC_TABLE_HH
-#define HB_AAT_FDSC_TABLE_HH
-
-#include "hb-aat-layout-common.hh"
-#include "hb-open-type.hh"
-
-/*
- * fdsc -- Font descriptors
- * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6fdsc.html
- */
-#define HB_AAT_TAG_fdsc HB_TAG('f','d','s','c')
-
-
-namespace AAT {
-
-
-struct FontDescriptor
-{
- bool has_data () const { return tag; }
-
- int cmp (hb_tag_t a) const { return tag.cmp (a); }
-
- float get_value () const { return u.value.to_float (); }
-
- enum non_alphabetic_value_t {
- Alphabetic = 0,
- Dingbats = 1,
- PiCharacters = 2,
- Fleurons = 3,
- DecorativeBorders = 4,
- InternationalSymbols= 5,
- MathSymbols = 6
- };
-
- bool sanitize (hb_sanitize_context_t *c) const
- {
- TRACE_SANITIZE (this);
- return_trace (c->check_struct (this));
- }
-
- protected:
- Tag tag; /* The 4-byte table tag name. */
- union {
- Fixed value; /* The value for the descriptor tag. */
- HBUINT32 nalfType; /* If the tag is `nalf`, see non_alphabetic_value_t */
- } u;
- public:
- DEFINE_SIZE_STATIC (8);
-};
-
-struct fdsc
-{
- static constexpr hb_tag_t tableTag = HB_AAT_TAG_fdsc;
-
- enum {
- Weight = HB_TAG ('w','g','h','t'),
- /* Percent weight relative to regular weight.
- * (defaul value: 1.0) */
- Width = HB_TAG ('w','d','t','h'),
- /* Percent width relative to regular width.
- * (default value: 1.0) */
- Slant = HB_TAG ('s','l','n','t'),
- /* Angle of slant in degrees, where positive
- * is clockwise from straight up.
- * (default value: 0.0) */
- OpticalSize = HB_TAG ('o','p','s','z'),
- /* Point size the font was designed for.
- * (default value: 12.0) */
- NonAlphabetic= HB_TAG ('n','a','l','f')
- /* These values are treated as integers,
- * not fixed32s. 0 means alphabetic, and greater
- * integers mean the font is non-alphabetic (e.g. symbols).
- * (default value: 0) */
- };
-
- const FontDescriptor &get_descriptor (hb_tag_t style) const
- { return descriptors.lsearch (style); }
-
- bool sanitize (hb_sanitize_context_t *c) const
- {
- TRACE_SANITIZE (this);
- return_trace (c->check_struct (this) &&
- descriptors.sanitize (c));
- }
-
- protected:
- Fixed version; /* Version number of the font descriptors
- * table (0x00010000 for the current version). */
- LArrayOf
- descriptors; /* List of tagged-coordinate pairs style descriptors
- * that will be included to characterize this font.
- * Each descriptor consists of a pair.
- * These pairs are located in the gxFontDescriptor
- * array that follows. */
- public:
- DEFINE_SIZE_ARRAY (8, descriptors);
-};
-
-} /* namespace AAT */
-
-
-#endif /* HB_AAT_FDSC_TABLE_HH */
diff --git a/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-ankr-table.hh b/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-ankr-table.hh
index f8495f384b9..90dd949a50a 100644
--- a/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-ankr-table.hh
+++ b/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-ankr-table.hh
@@ -66,7 +66,7 @@ struct ankr
{
const NNOffsetTo *offset = (this+lookupTable).get_value (glyph_id, num_glyphs);
if (!offset)
- return Null(Anchor);
+ return Null (Anchor);
const GlyphAnchors &anchors = &(this+anchorData) + *offset;
return anchors[i];
}
@@ -76,13 +76,14 @@ struct ankr
TRACE_SANITIZE (this);
return_trace (likely (c->check_struct (this) &&
version == 0 &&
+ c->check_range (this, anchorData) &&
lookupTable.sanitize (c, this, &(this+anchorData))));
}
protected:
HBUINT16 version; /* Version number (set to zero) */
HBUINT16 flags; /* Flags (currently unused; set to zero) */
- LOffsetTo > >
+ LOffsetTo>>
lookupTable; /* Offset to the table's lookup table */
LNNOffsetTo
anchorData; /* Offset to the glyph data table */
diff --git a/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-bsln-table.hh b/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-bsln-table.hh
index 746da3ae5bc..7dcf1c3bd9d 100644
--- a/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-bsln-table.hh
+++ b/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-bsln-table.hh
@@ -82,7 +82,7 @@ struct BaselineTableFormat2Part
}
protected:
- GlyphID stdGlyph; /* The specific glyph index number in this
+ HBGlyphID stdGlyph; /* The specific glyph index number in this
* font that is used to set the baseline values.
* This is the standard glyph.
* This glyph must contain a set of control points
@@ -101,11 +101,11 @@ struct BaselineTableFormat3Part
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return_trace (c->check_struct (this) && lookupTable.sanitize (c));
+ return_trace (likely (c->check_struct (this) && lookupTable.sanitize (c)));
}
protected:
- GlyphID stdGlyph; /* ditto */
+ HBGlyphID stdGlyph; /* ditto */
HBUINT16 ctlPoints[32]; /* ditto */
Lookup
lookupTable; /* Lookup table that maps glyphs to their
diff --git a/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-common.hh b/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-common.hh
index 7c8e3cec16f..e1dcd6f7102 100644
--- a/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-common.hh
+++ b/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-common.hh
@@ -93,8 +93,8 @@ struct LookupSegmentSingle
return_trace (c->check_struct (this) && value.sanitize (c, base));
}
- GlyphID last; /* Last GlyphID in this segment */
- GlyphID first; /* First GlyphID in this segment */
+ HBGlyphID last; /* Last GlyphID in this segment */
+ HBGlyphID first; /* First GlyphID in this segment */
T value; /* The lookup value (only one) */
public:
DEFINE_SIZE_STATIC (4 + T::static_size);
@@ -125,7 +125,7 @@ struct LookupFormat2
protected:
HBUINT16 format; /* Format identifier--format = 2 */
- VarSizedBinSearchArrayOf >
+ VarSizedBinSearchArrayOf>
segments; /* The actual segments. These must already be sorted,
* according to the first word in each one (the last
* glyph in each segment). */
@@ -153,18 +153,18 @@ struct LookupSegmentArray
first <= last &&
valuesZ.sanitize (c, base, last - first + 1));
}
- template
- bool sanitize (hb_sanitize_context_t *c, const void *base, T2 user_data) const
+ template
+ bool sanitize (hb_sanitize_context_t *c, const void *base, Ts&&... ds) const
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) &&
first <= last &&
- valuesZ.sanitize (c, base, last - first + 1, user_data));
+ valuesZ.sanitize (c, base, last - first + 1, hb_forward (ds)...));
}
- GlyphID last; /* Last GlyphID in this segment */
- GlyphID first; /* First GlyphID in this segment */
- NNOffsetTo >
+ HBGlyphID last; /* Last GlyphID in this segment */
+ HBGlyphID first; /* First GlyphID in this segment */
+ NNOffsetTo>
valuesZ; /* A 16-bit offset from the start of
* the table to the data. */
public:
@@ -196,7 +196,7 @@ struct LookupFormat4
protected:
HBUINT16 format; /* Format identifier--format = 4 */
- VarSizedBinSearchArrayOf >
+ VarSizedBinSearchArrayOf>
segments; /* The actual segments. These must already be sorted,
* according to the first word in each one (the last
* glyph in each segment). */
@@ -222,7 +222,7 @@ struct LookupSingle
return_trace (c->check_struct (this) && value.sanitize (c, base));
}
- GlyphID glyph; /* Last GlyphID */
+ HBGlyphID glyph; /* Last GlyphID */
T value; /* The lookup value (only one) */
public:
DEFINE_SIZE_STATIC (2 + T::static_size);
@@ -253,7 +253,7 @@ struct LookupFormat6
protected:
HBUINT16 format; /* Format identifier--format = 6 */
- VarSizedBinSearchArrayOf >
+ VarSizedBinSearchArrayOf>
entries; /* The actual entries, sorted by glyph index. */
public:
DEFINE_SIZE_ARRAY (8, entries);
@@ -284,7 +284,7 @@ struct LookupFormat8
protected:
HBUINT16 format; /* Format identifier--format = 8 */
- GlyphID firstGlyph; /* First glyph index included in the trimmed array. */
+ HBGlyphID firstGlyph; /* First glyph index included in the trimmed array. */
HBUINT16 glyphCount; /* Total number of glyphs (equivalent to the last
* glyph minus the value of firstGlyph plus 1). */
UnsizedArrayOf
@@ -303,7 +303,7 @@ struct LookupFormat10
const typename T::type get_value_or_null (hb_codepoint_t glyph_id) const
{
if (!(firstGlyph <= glyph_id && glyph_id - firstGlyph < glyphCount))
- return Null(T);
+ return Null (T);
const HBUINT8 *p = &valueArrayZ[(glyph_id - firstGlyph) * valueSize];
@@ -326,7 +326,7 @@ struct LookupFormat10
protected:
HBUINT16 format; /* Format identifier--format = 8 */
HBUINT16 valueSize; /* Byte size of each value. */
- GlyphID firstGlyph; /* First glyph index included in the trimmed array. */
+ HBGlyphID firstGlyph; /* First glyph index included in the trimmed array. */
HBUINT16 glyphCount; /* Total number of glyphs (equivalent to the last
* glyph minus the value of firstGlyph plus 1). */
UnsizedArrayOf
@@ -358,7 +358,7 @@ struct Lookup
case 10: return u.format10.get_value_or_null (glyph_id);
default:
const T *v = get_value (glyph_id, num_glyphs);
- return v ? *v : Null(T);
+ return v ? *v : Null (T);
}
}
@@ -418,15 +418,11 @@ struct Lookup
} /* Close namespace. */
/* Ugly hand-coded null objects for template Lookup<> :(. */
extern HB_INTERNAL const unsigned char _hb_Null_AAT_Lookup[2];
-template <>
-/*static*/ inline const AAT::Lookup& Null > ()
-{ return *reinterpret_cast *> (_hb_Null_AAT_Lookup); }
-template <>
-/*static*/ inline const AAT::Lookup& Null > ()
-{ return *reinterpret_cast *> (_hb_Null_AAT_Lookup); }
-template <>
-/*static*/ inline const AAT::Lookup >& Null > > ()
-{ return *reinterpret_cast > *> (_hb_Null_AAT_Lookup); }
+template
+struct Null> {
+ static AAT::Lookup const & get_null ()
+ { return *reinterpret_cast *> (_hb_Null_AAT_Lookup); }
+};
namespace AAT {
enum { DELETED_GLYPH = 0xFFFF };
@@ -514,7 +510,7 @@ struct StateTable
const Entry &get_entry (int state, unsigned int klass) const
{
if (unlikely (klass >= nClasses))
- klass = StateTable >::CLASS_OUT_OF_BOUNDS;
+ klass = StateTable>::CLASS_OUT_OF_BOUNDS;
const HBUSHORT *states = (this+stateArrayTable).arrayZ;
const Entry *entries = (this+entryTable).arrayZ;
@@ -580,7 +576,7 @@ struct StateTable
if (unlikely (stop > states))
return_trace (false);
for (const HBUSHORT *p = states; stop < p; p--)
- num_entries = MAX (num_entries, *(p - 1) + 1);
+ num_entries = hb_max (num_entries, *(p - 1) + 1);
state_neg = min_state;
}
}
@@ -601,7 +597,7 @@ struct StateTable
if (unlikely (stop < states))
return_trace (false);
for (const HBUSHORT *p = &states[state_pos * num_classes]; p < stop; p++)
- num_entries = MAX (num_entries, *p + 1);
+ num_entries = hb_max (num_entries, *p + 1);
state_pos = max_state + 1;
}
}
@@ -615,8 +611,8 @@ struct StateTable
for (const Entry *p = &entries[entry]; p < stop; p++)
{
int newState = new_state (p->newState);
- min_state = MIN (min_state, newState);
- max_state = MAX (max_state, newState);
+ min_state = hb_min (min_state, newState);
+ max_state = hb_max (max_state, newState);
}
entry = num_entries;
}
@@ -635,7 +631,7 @@ struct StateTable
classTable; /* Offset to the class table. */
NNOffsetTo, HBUINT>
stateArrayTable;/* Offset to the state array. */
- NNOffsetTo >, HBUINT>
+ NNOffsetTo>, HBUINT>
entryTable; /* Offset to the entry array. */
public:
@@ -662,7 +658,7 @@ struct ClassTable
return_trace (c->check_struct (this) && classArray.sanitize (c));
}
protected:
- GlyphID firstGlyph; /* First glyph index included in the trimmed array. */
+ HBGlyphID firstGlyph; /* First glyph index included in the trimmed array. */
ArrayOf classArray; /* The class codes (indexed by glyph index minus
* firstGlyph). */
public:
@@ -682,7 +678,7 @@ struct ObsoleteTypes
const void *base,
const T *array)
{
- return (offset - ((const char *) array - (const char *) base)) / sizeof (T);
+ return (offset - ((const char *) array - (const char *) base)) / T::static_size;
}
template
static unsigned int byteOffsetToIndex (unsigned int offset,
@@ -824,12 +820,11 @@ struct hb_aat_apply_context_t :
/* Unused. For debug tracing only. */
unsigned int lookup_index;
- unsigned int debug_depth;
HB_INTERNAL hb_aat_apply_context_t (const hb_ot_shape_plan_t *plan_,
hb_font_t *font_,
hb_buffer_t *buffer_,
- hb_blob_t *blob = const_cast (&Null(hb_blob_t)));
+ hb_blob_t *blob = const_cast (&Null (hb_blob_t)));
HB_INTERNAL ~hb_aat_apply_context_t ();
diff --git a/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-feat-table.hh b/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-feat-table.hh
index 910a94f0bc3..06c48d2f64a 100644
--- a/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-feat-table.hh
+++ b/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-feat-table.hh
@@ -47,17 +47,16 @@ struct SettingName
hb_aat_layout_feature_selector_t get_selector () const
{ return (hb_aat_layout_feature_selector_t) (unsigned) setting; }
- void get_info (hb_aat_layout_feature_selector_info_t *s,
- hb_aat_layout_feature_selector_t default_selector) const
+ hb_aat_layout_feature_selector_info_t get_info (hb_aat_layout_feature_selector_t default_selector) const
{
- s->name_id = nameIndex;
-
- s->enable = (hb_aat_layout_feature_selector_t) (unsigned int) setting;
- s->disable = default_selector == HB_AAT_LAYOUT_FEATURE_SELECTOR_INVALID ?
- (hb_aat_layout_feature_selector_t) (s->enable + 1) :
- default_selector;
-
- s->reserved = 0;
+ return {
+ nameIndex,
+ (hb_aat_layout_feature_selector_t) (unsigned int) setting,
+ default_selector == HB_AAT_LAYOUT_FEATURE_SELECTOR_INVALID
+ ? (hb_aat_layout_feature_selector_t) (setting + 1)
+ : default_selector,
+ 0
+ };
}
bool sanitize (hb_sanitize_context_t *c) const
@@ -117,9 +116,10 @@ struct FeatureName
if (selectors_count)
{
- hb_array_t arr = settings_table.sub_array (start_offset, selectors_count);
- for (unsigned int i = 0; i < arr.length; i++)
- settings_table[start_offset + i].get_info (&selectors[i], default_selector);
+ + settings_table.sub_array (start_offset, selectors_count)
+ | hb_map ([=] (const SettingName& setting) { return setting.get_info (default_selector); })
+ | hb_sink (hb_array (selectors, *selectors_count))
+ ;
}
return settings_table.length;
}
@@ -129,6 +129,11 @@ struct FeatureName
hb_ot_name_id_t get_feature_name_id () const { return nameIndex; }
+ bool is_exclusive () const { return featureFlags & Exclusive; }
+
+ /* A FeatureName with no settings is meaningless */
+ bool has_data () const { return nSettings; }
+
bool sanitize (hb_sanitize_context_t *c, const void *base) const
{
TRACE_SANITIZE (this);
@@ -139,7 +144,7 @@ struct FeatureName
protected:
HBUINT16 feature; /* Feature type. */
HBUINT16 nSettings; /* The number of records in the setting name array. */
- LOffsetTo, false>
+ LNNOffsetTo>
settingTableZ; /* Offset in bytes from the beginning of this table to
* this feature's setting name array. The actual type of
* record this offset refers to will depend on the
@@ -162,21 +167,21 @@ struct feat
unsigned int *count,
hb_aat_layout_feature_type_t *features) const
{
- unsigned int feature_count = featureNameCount;
- if (count && *count)
+ if (count)
{
- unsigned int len = MIN (feature_count - start_offset, *count);
- for (unsigned int i = 0; i < len; i++)
- features[i] = namesZ[i + start_offset].get_feature_type ();
- *count = len;
+ + namesZ.as_array (featureNameCount).sub_array (start_offset, count)
+ | hb_map (&FeatureName::get_feature_type)
+ | hb_sink (hb_array (features, *count))
+ ;
}
return featureNameCount;
}
+ bool exposes_feature (hb_aat_layout_feature_type_t feature_type) const
+ { return get_feature (feature_type).has_data (); }
+
const FeatureName& get_feature (hb_aat_layout_feature_type_t feature_type) const
- {
- return namesZ.bsearch (featureNameCount, feature_type);
- }
+ { return namesZ.bsearch (featureNameCount, feature_type); }
hb_ot_name_id_t get_feature_name_id (hb_aat_layout_feature_type_t feature) const
{ return get_feature (feature).get_feature_name_id (); }
@@ -209,7 +214,7 @@ struct feat
SortedUnsizedArrayOf
namesZ; /* The feature name array. */
public:
- DEFINE_SIZE_STATIC (24);
+ DEFINE_SIZE_ARRAY (12, namesZ);
};
} /* namespace AAT */
diff --git a/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-just-table.hh b/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-just-table.hh
index c3817ea0b9c..7ebd6a5ec5e 100644
--- a/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-just-table.hh
+++ b/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-just-table.hh
@@ -70,9 +70,9 @@ struct DecompositionAction
ActionSubrecordHeader
header;
- Fixed lowerLimit; /* If the distance factor is less than this value,
+ HBFixed lowerLimit; /* If the distance factor is less than this value,
* then the ligature is decomposed. */
- Fixed upperLimit; /* If the distance factor is greater than this value,
+ HBFixed upperLimit; /* If the distance factor is greater than this value,
* then the ligature is decomposed. */
HBUINT16 order; /* Numerical order in which this ligature will
* be decomposed; you may want infrequent ligatures
@@ -100,7 +100,7 @@ struct UnconditionalAddGlyphAction
protected:
ActionSubrecordHeader
header;
- GlyphID addGlyph; /* Glyph that should be added if the distance factor
+ HBGlyphID addGlyph; /* Glyph that should be added if the distance factor
* is growing. */
public:
@@ -118,14 +118,14 @@ struct ConditionalAddGlyphAction
protected:
ActionSubrecordHeader
header;
- Fixed substThreshold; /* Distance growth factor (in ems) at which
+ HBFixed substThreshold; /* Distance growth factor (in ems) at which
* this glyph is replaced and the growth factor
* recalculated. */
- GlyphID addGlyph; /* Glyph to be added as kashida. If this value is
+ HBGlyphID addGlyph; /* Glyph to be added as kashida. If this value is
* 0xFFFF, no extra glyph will be added. Note that
* generally when a glyph is added, justification
* will need to be redone. */
- GlyphID substGlyph; /* Glyph to be substituted for this glyph if the
+ HBGlyphID substGlyph; /* Glyph to be substituted for this glyph if the
* growth factor equals or exceeds the value of
* substThreshold. */
public:
@@ -146,13 +146,13 @@ struct DuctileGlyphAction
HBUINT32 variationAxis; /* The 4-byte tag identifying the ductile axis.
* This would normally be 0x64756374 ('duct'),
* but you may use any axis the font contains. */
- Fixed minimumLimit; /* The lowest value for the ductility axis tha
+ HBFixed minimumLimit; /* The lowest value for the ductility axis tha
* still yields an acceptable appearance. Normally
* this will be 1.0. */
- Fixed noStretchValue; /* This is the default value that corresponds to
+ HBFixed noStretchValue; /* This is the default value that corresponds to
* no change in appearance. Normally, this will
* be 1.0. */
- Fixed maximumLimit; /* The highest value for the ductility axis that
+ HBFixed maximumLimit; /* The highest value for the ductility axis that
* still yields an acceptable appearance. */
public:
DEFINE_SIZE_STATIC (22);
@@ -170,7 +170,7 @@ struct RepeatedAddGlyphAction
ActionSubrecordHeader
header;
HBUINT16 flags; /* Currently unused; set to 0. */
- GlyphID glyph; /* Glyph that should be added if the distance factor
+ HBGlyphID glyph; /* Glyph that should be added if the distance factor
* is growing. */
public:
DEFINE_SIZE_STATIC (10);
@@ -271,14 +271,14 @@ struct JustWidthDeltaEntry
};
protected:
- Fixed beforeGrowLimit;/* The ratio by which the advance width of the
+ HBFixed beforeGrowLimit;/* The ratio by which the advance width of the
* glyph is permitted to grow on the left or top side. */
- Fixed beforeShrinkLimit;
+ HBFixed beforeShrinkLimit;
/* The ratio by which the advance width of the
* glyph is permitted to shrink on the left or top side. */
- Fixed afterGrowLimit; /* The ratio by which the advance width of the glyph
+ HBFixed afterGrowLimit; /* The ratio by which the advance width of the glyph
* is permitted to shrink on the left or top side. */
- Fixed afterShrinkLimit;
+ HBFixed afterShrinkLimit;
/* The ratio by which the advance width of the glyph
* is at most permitted to shrink on the right or
* bottom side. */
@@ -371,7 +371,7 @@ struct JustificationHeader
* of postcompensation subtable (set to zero if none).
*
* The postcompensation subtable, if present in the font. */
- Lookup >
+ Lookup>
lookupTable; /* Lookup table associating glyphs with width delta
* clusters. See the description of Width Delta Clusters
* table for details on how to interpret the lookup values. */
diff --git a/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh b/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh
index b5519480e23..76e1da06f3e 100644
--- a/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh
+++ b/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-kerx-table.hh
@@ -82,8 +82,8 @@ struct KernPair
}
protected:
- GlyphID left;
- GlyphID right;
+ HBGlyphID left;
+ HBGlyphID right;
FWORD value;
public:
DEFINE_SIZE_STATIC (6);
@@ -229,9 +229,7 @@ struct KerxSubTableFormat1
bool is_actionable (StateTableDriver *driver HB_UNUSED,
const Entry &entry)
- {
- return Format1EntryT::performAction (entry);
- }
+ { return Format1EntryT::performAction (entry); }
void transition (StateTableDriver *driver,
const Entry &entry)
{
@@ -251,7 +249,7 @@ struct KerxSubTableFormat1
if (Format1EntryT::performAction (entry) && depth)
{
- unsigned int tuple_count = MAX (1u, table->header.tuple_count ());
+ unsigned int tuple_count = hb_max (1u, table->header.tuple_count ());
unsigned int kern_idx = Format1EntryT::kernActionIndex (entry);
kern_idx = Types::byteOffsetToIndex (kern_idx, &table->machine, kernAction.arrayZ);
@@ -281,35 +279,28 @@ struct KerxSubTableFormat1
hb_glyph_position_t &o = buffer->pos[idx];
- /* Testing shows that CoreText only applies kern (cross-stream or not)
- * if none has been applied by previous subtables. That is, it does
- * NOT seem to accumulate as otherwise implied by specs. */
-
- /* The following flag is undocumented in the spec, but described
- * in the 'kern' table example. */
- if (v == -0x8000)
- {
- o.attach_type() = ATTACH_TYPE_NONE;
- o.attach_chain() = 0;
- o.x_offset = o.y_offset = 0;
- }
- else if (HB_DIRECTION_IS_HORIZONTAL (buffer->props.direction))
+ if (HB_DIRECTION_IS_HORIZONTAL (buffer->props.direction))
{
if (crossStream)
{
- if (buffer->pos[idx].attach_type() && !buffer->pos[idx].y_offset)
+ /* The following flag is undocumented in the spec, but described
+ * in the 'kern' table example. */
+ if (v == -0x8000)
{
- o.y_offset = c->font->em_scale_y (v);
+ o.attach_type() = ATTACH_TYPE_NONE;
+ o.attach_chain() = 0;
+ o.y_offset = 0;
+ }
+ else if (o.attach_type())
+ {
+ o.y_offset += c->font->em_scale_y (v);
buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT;
}
}
else if (buffer->info[idx].mask & kern_mask)
{
- if (!buffer->pos[idx].x_offset)
- {
- buffer->pos[idx].x_advance += c->font->em_scale_x (v);
- buffer->pos[idx].x_offset += c->font->em_scale_x (v);
- }
+ o.x_advance += c->font->em_scale_x (v);
+ o.x_offset += c->font->em_scale_x (v);
}
}
else
@@ -317,19 +308,22 @@ struct KerxSubTableFormat1
if (crossStream)
{
/* CoreText doesn't do crossStream kerning in vertical. We do. */
- if (buffer->pos[idx].attach_type() && !buffer->pos[idx].x_offset)
+ if (v == -0x8000)
{
- o.x_offset = c->font->em_scale_x (v);
+ o.attach_type() = ATTACH_TYPE_NONE;
+ o.attach_chain() = 0;
+ o.x_offset = 0;
+ }
+ else if (o.attach_type())
+ {
+ o.x_offset += c->font->em_scale_x (v);
buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT;
}
}
else if (buffer->info[idx].mask & kern_mask)
{
- if (!buffer->pos[idx].y_offset)
- {
- buffer->pos[idx].y_advance += c->font->em_scale_y (v);
- buffer->pos[idx].y_offset += c->font->em_scale_y (v);
- }
+ o.y_advance += c->font->em_scale_y (v);
+ o.y_offset += c->font->em_scale_y (v);
}
}
}
@@ -392,7 +386,7 @@ struct KerxSubTableFormat2
const UnsizedArrayOf &arrayZ = this+array;
unsigned int kern_idx = l + r;
- kern_idx = Types::offsetToIndex (kern_idx, this, &arrayZ);
+ kern_idx = Types::offsetToIndex (kern_idx, this, arrayZ.arrayZ);
const FWORD *v = &arrayZ[kern_idx];
if (unlikely (!v->sanitize (&c->sanitizer))) return 0;
@@ -488,7 +482,7 @@ struct KerxSubTableFormat4
};
driver_context_t (const KerxSubTableFormat4 *table,
- hb_aat_apply_context_t *c_) :
+ hb_aat_apply_context_t *c_) :
c (c_),
action_type ((table->flags & ActionType) >> 30),
ankrData ((HBUINT16 *) ((const char *) &table->machine + (table->flags & Offset))),
@@ -497,9 +491,7 @@ struct KerxSubTableFormat4
bool is_actionable (StateTableDriver *driver HB_UNUSED,
const Entry &entry)
- {
- return entry.data.ankrActionIndex != 0xFFFF;
- }
+ { return entry.data.ankrActionIndex != 0xFFFF; }
void transition (StateTableDriver *driver,
const Entry &entry)
{
@@ -512,11 +504,13 @@ struct KerxSubTableFormat4
{
case 0: /* Control Point Actions.*/
{
- /* indexed into glyph outline. */
- const HBUINT16 *data = &ankrData[entry.data.ankrActionIndex];
+ /* Indexed into glyph outline. */
+ /* Each action (record in ankrData) contains two 16-bit fields, so we must
+ double the ankrActionIndex to get the correct offset here. */
+ const HBUINT16 *data = &ankrData[entry.data.ankrActionIndex * 2];
if (!c->sanitizer.check_array (data, 2)) return;
- HB_UNUSED unsigned int markControlPoint = *data++;
- HB_UNUSED unsigned int currControlPoint = *data++;
+ unsigned int markControlPoint = *data++;
+ unsigned int currControlPoint = *data++;
hb_position_t markX = 0;
hb_position_t markY = 0;
hb_position_t currX = 0;
@@ -538,8 +532,10 @@ struct KerxSubTableFormat4
case 1: /* Anchor Point Actions. */
{
- /* Indexed into 'ankr' table. */
- const HBUINT16 *data = &ankrData[entry.data.ankrActionIndex];
+ /* Indexed into 'ankr' table. */
+ /* Each action (record in ankrData) contains two 16-bit fields, so we must
+ double the ankrActionIndex to get the correct offset here. */
+ const HBUINT16 *data = &ankrData[entry.data.ankrActionIndex * 2];
if (!c->sanitizer.check_array (data, 2)) return;
unsigned int markAnchorPoint = *data++;
unsigned int currAnchorPoint = *data++;
@@ -557,7 +553,9 @@ struct KerxSubTableFormat4
case 2: /* Control Point Coordinate Actions. */
{
- const FWORD *data = (const FWORD *) &ankrData[entry.data.ankrActionIndex];
+ /* Each action contains four 16-bit fields, so we multiply the ankrActionIndex
+ by 4 to get the correct offset for the given action. */
+ const FWORD *data = (const FWORD *) &ankrData[entry.data.ankrActionIndex * 4];
if (!c->sanitizer.check_array (data, 4)) return;
int markX = *data++;
int markY = *data++;
@@ -628,7 +626,7 @@ struct KerxSubTableFormat6
bool is_long () const { return flags & ValuesAreLong; }
int get_kerning (hb_codepoint_t left, hb_codepoint_t right,
- hb_aat_apply_context_t *c) const
+ hb_aat_apply_context_t *c) const
{
unsigned int num_glyphs = c->sanitizer.get_num_glyphs ();
if (is_long ())
@@ -712,18 +710,18 @@ struct KerxSubTableFormat6
{
struct Long
{
- LNNOffsetTo > rowIndexTable;
- LNNOffsetTo > columnIndexTable;
- LNNOffsetTo > array;
+ LNNOffsetTo> rowIndexTable;
+ LNNOffsetTo> columnIndexTable;
+ LNNOffsetTo> array;
} l;
struct Short
{
- LNNOffsetTo > rowIndexTable;
- LNNOffsetTo > columnIndexTable;
- LNNOffsetTo > array;
+ LNNOffsetTo> rowIndexTable;
+ LNNOffsetTo> columnIndexTable;
+ LNNOffsetTo> array;
} s;
} u;
- LNNOffsetTo > vector;
+ LNNOffsetTo> vector;
public:
DEFINE_SIZE_STATIC (KernSubTableHeader::static_size + 24);
};
@@ -733,8 +731,8 @@ struct KerxSubTableHeader
{
typedef ExtendedTypes Types;
- unsigned int tuple_count () const { return tupleCount; }
- bool is_horizontal () const { return !(coverage & Vertical); }
+ unsigned tuple_count () const { return tupleCount; }
+ bool is_horizontal () const { return !(coverage & Vertical); }
enum Coverage
{
@@ -771,17 +769,17 @@ struct KerxSubTable
unsigned int get_size () const { return u.header.length; }
unsigned int get_type () const { return u.header.coverage & u.header.SubtableType; }
- template
- typename context_t::return_t dispatch (context_t *c) const
+ template
+ typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
{
unsigned int subtable_type = get_type ();
TRACE_DISPATCH (this, subtable_type);
switch (subtable_type) {
- case 0: return_trace (c->dispatch (u.format0));
- case 1: return_trace (c->dispatch (u.format1));
- case 2: return_trace (c->dispatch (u.format2));
- case 4: return_trace (c->dispatch (u.format4));
- case 6: return_trace (c->dispatch (u.format6));
+ case 0: return_trace (c->dispatch (u.format0, hb_forward (ds)...));
+ case 1: return_trace (c->dispatch (u.format1, hb_forward (ds)...));
+ case 2: return_trace (c->dispatch (u.format2, hb_forward (ds)...));
+ case 4: return_trace (c->dispatch (u.format4, hb_forward (ds)...));
+ case 6: return_trace (c->dispatch (u.format6, hb_forward (ds)...));
default: return_trace (c->default_return_value ());
}
}
@@ -891,7 +889,7 @@ struct KerxTable
reverse = bool (st->u.header.coverage & st->u.header.Backwards) !=
HB_DIRECTION_IS_BACKWARD (c->buffer->props.direction);
- if (!c->buffer->message (c->font, "start %c%c%c%c subtable %d", HB_UNTAG (thiz()->tableTag), c->lookup_index))
+ if (!c->buffer->message (c->font, "start subtable %d", c->lookup_index))
goto skip;
if (!seenCrossStream &&
@@ -923,7 +921,7 @@ struct KerxTable
if (reverse)
c->buffer->reverse ();
- (void) c->buffer->message (c->font, "end %c%c%c%c subtable %d", HB_UNTAG (thiz()->tableTag), c->lookup_index);
+ (void) c->buffer->message (c->font, "end subtable %d", c->lookup_index);
skip:
st = &StructAfter (*st);
diff --git a/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-lcar-table.hh b/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-lcar-table.hh
deleted file mode 100644
index 58f1ee02fce..00000000000
--- a/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-lcar-table.hh
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright © 2018 Ebrahim Byagowi
- *
- * This is part of HarfBuzz, a text shaping library.
- *
- * Permission is hereby granted, without written agreement and without
- * license or royalty fees, to use, copy, modify, and distribute this
- * software and its documentation for any purpose, provided that the
- * above copyright notice and the following two paragraphs appear in
- * all copies of this software.
- *
- * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
- * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
- * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
- * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
- * DAMAGE.
- *
- * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
- * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
- * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
- * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- */
-#ifndef HB_AAT_LAYOUT_LCAR_TABLE_HH
-#define HB_AAT_LAYOUT_LCAR_TABLE_HH
-
-#include "hb-open-type.hh"
-#include "hb-aat-layout-common.hh"
-
-/*
- * lcar -- Ligature caret
- * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6lcar.html
- */
-#define HB_AAT_TAG_lcar HB_TAG('l','c','a','r')
-
-
-namespace AAT {
-
-typedef ArrayOf LigCaretClassEntry;
-
-struct lcar
-{
- static constexpr hb_tag_t tableTag = HB_AAT_TAG_lcar;
-
- unsigned int get_lig_carets (hb_font_t *font,
- hb_direction_t direction,
- hb_codepoint_t glyph,
- unsigned int start_offset,
- unsigned int *caret_count /* IN/OUT */,
- hb_position_t *caret_array /* OUT */) const
- {
- const OffsetTo* entry_offset = lookup.get_value (glyph,
- font->face->get_num_glyphs ());
- const LigCaretClassEntry& array = entry_offset ? this+*entry_offset : Null (LigCaretClassEntry);
- if (caret_count)
- {
- hb_array_t arr = array.sub_array (start_offset, caret_count);
- unsigned int count = arr.length;
- for (unsigned int i = 0; i < count; ++i)
- switch (format)
- {
- case 0: caret_array[i] = font->em_scale_dir (arr[i], direction); break;
- case 1:
- hb_position_t x, y;
- font->get_glyph_contour_point_for_origin (glyph, arr[i], direction, &x, &y);
- caret_array[i] = HB_DIRECTION_IS_HORIZONTAL (direction) ? x : y;
- break;
- }
- }
- return array.len;
- }
-
- bool sanitize (hb_sanitize_context_t *c) const
- {
- TRACE_SANITIZE (this);
- return_trace (likely (c->check_struct (this) &&
- version.major == 1 &&
- lookup.sanitize (c, this)));
- }
-
- protected:
- FixedVersion<>version; /* Version number of the ligature caret table */
- HBUINT16 format; /* Format of the ligature caret table. */
- Lookup >
- lookup; /* data Lookup table associating glyphs */
-
- public:
- DEFINE_SIZE_MIN (8);
-};
-
-} /* namespace AAT */
-
-#endif /* HB_AAT_LAYOUT_LCAR_TABLE_HH */
diff --git a/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-morx-table.hh b/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-morx-table.hh
index f52d2ab301b..a0d137836b1 100644
--- a/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-morx-table.hh
+++ b/src/java.desktop/share/native/libharfbuzz/hb-aat-layout-morx-table.hh
@@ -88,7 +88,7 @@ struct RearrangementSubtable
start = buffer->idx;
if (flags & MarkLast)
- end = MIN (buffer->idx + 1, buffer->len);
+ end = hb_min (buffer->idx + 1, buffer->len);
if ((flags & Verb) && start < end)
{
@@ -117,14 +117,14 @@ struct RearrangementSubtable
};
unsigned int m = map[flags & Verb];
- unsigned int l = MIN (2, m >> 4);
- unsigned int r = MIN (2, m & 0x0F);
+ unsigned int l = hb_min (2u, m >> 4);
+ unsigned int r = hb_min (2u, m & 0x0F);
bool reverse_l = 3 == (m >> 4);
bool reverse_r = 3 == (m & 0x0F);
if (end - start >= l + r)
{
- buffer->merge_clusters (start, MIN (buffer->idx + 1, buffer->len));
+ buffer->merge_clusters (start, hb_min (buffer->idx + 1, buffer->len));
buffer->merge_clusters (start, end);
hb_glyph_info_t *info = buffer->info;
@@ -240,46 +240,46 @@ struct ContextualSubtable
if (buffer->idx == buffer->len && !mark_set)
return;
- const GlyphID *replacement;
+ const HBGlyphID *replacement;
replacement = nullptr;
if (Types::extended)
{
if (entry.data.markIndex != 0xFFFF)
{
- const Lookup &lookup = subs[entry.data.markIndex];
+ const Lookup &lookup = subs[entry.data.markIndex];
replacement = lookup.get_value (buffer->info[mark].codepoint, driver->num_glyphs);
}
}
else
{
unsigned int offset = entry.data.markIndex + buffer->info[mark].codepoint;
- const UnsizedArrayOf &subs_old = (const UnsizedArrayOf &) subs;
+ const UnsizedArrayOf &subs_old = (const UnsizedArrayOf &) subs;
replacement = &subs_old[Types::wordOffsetToIndex (offset, table, subs_old.arrayZ)];
if (!replacement->sanitize (&c->sanitizer) || !*replacement)
replacement = nullptr;
}
if (replacement)
{
- buffer->unsafe_to_break (mark, MIN (buffer->idx + 1, buffer->len));
+ buffer->unsafe_to_break (mark, hb_min (buffer->idx + 1, buffer->len));
buffer->info[mark].codepoint = *replacement;
ret = true;
}
replacement = nullptr;
- unsigned int idx = MIN (buffer->idx, buffer->len - 1);
+ unsigned int idx = hb_min (buffer->idx, buffer->len - 1);
if (Types::extended)
{
if (entry.data.currentIndex != 0xFFFF)
{
- const Lookup &lookup = subs[entry.data.currentIndex];
+ const Lookup &lookup = subs[entry.data.currentIndex];
replacement = lookup.get_value (buffer->info[idx].codepoint, driver->num_glyphs);
}
}
else
{
unsigned int offset = entry.data.currentIndex + buffer->info[idx].codepoint;
- const UnsizedArrayOf &subs_old = (const UnsizedArrayOf &) subs;
+ const UnsizedArrayOf &subs_old = (const UnsizedArrayOf &) subs;
replacement = &subs_old[Types::wordOffsetToIndex (offset, table, subs_old.arrayZ)];
if (!replacement->sanitize (&c->sanitizer) || !*replacement)
replacement = nullptr;
@@ -304,7 +304,7 @@ struct ContextualSubtable
bool mark_set;
unsigned int mark;
const ContextualSubtable *table;
- const UnsizedOffsetListOf, HBUINT, false> &subs;
+ const UnsizedOffsetListOf, HBUINT, false> &subs;
};
bool apply (hb_aat_apply_context_t *c) const
@@ -337,9 +337,9 @@ struct ContextualSubtable
const EntryData &data = entries[i].data;
if (data.markIndex != 0xFFFF)
- num_lookups = MAX (num_lookups, 1 + data.markIndex);
+ num_lookups = hb_max (num_lookups, 1 + data.markIndex);
if (data.currentIndex != 0xFFFF)
- num_lookups = MAX (num_lookups, 1 + data.currentIndex);
+ num_lookups = hb_max (num_lookups, 1 + data.currentIndex);
}
return_trace (substitutionTables.sanitize (c, this, num_lookups));
@@ -348,7 +348,7 @@ struct ContextualSubtable
protected:
StateTable
machine;
- NNOffsetTo, HBUINT, false>, HBUINT>
+ NNOffsetTo, HBUINT, false>, HBUINT>
substitutionTables;
public:
DEFINE_SIZE_STATIC (20);
@@ -520,7 +520,7 @@ struct LigatureSubtable
if (action & (LigActionStore | LigActionLast))
{
ligature_idx = Types::offsetToIndex (ligature_idx, table, ligature.arrayZ);
- const GlyphID &ligatureData = ligature[ligature_idx];
+ const HBGlyphID &ligatureData = ligature[ligature_idx];
if (unlikely (!ligatureData.sanitize (&c->sanitizer))) break;
hb_codepoint_t lig = ligatureData;
@@ -554,7 +554,7 @@ struct LigatureSubtable
const LigatureSubtable *table;
const UnsizedArrayOf &ligAction;
const UnsizedArrayOf &component;
- const UnsizedArrayOf &ligature;
+ const UnsizedArrayOf &ligature;
unsigned int match_length;
unsigned int match_positions[HB_MAX_CONTEXT_LENGTH];
};
@@ -586,7 +586,7 @@ struct LigatureSubtable
ligAction; /* Offset to the ligature action table. */
NNOffsetTo, HBUINT>
component; /* Offset to the component table. */
- NNOffsetTo, HBUINT>
+ NNOffsetTo, HBUINT>
ligature; /* Offset to the actual ligature lists. */
public:
DEFINE_SIZE_STATIC (28);
@@ -606,7 +606,7 @@ struct NoncontextualSubtable
unsigned int count = c->buffer->len;
for (unsigned int i = 0; i < count; i++)
{
- const GlyphID *replacement = substitute.get_value (info[i].codepoint, num_glyphs);
+ const HBGlyphID *replacement = substitute.get_value (info[i].codepoint, num_glyphs);
if (replacement)
{
info[i].codepoint = *replacement;
@@ -624,7 +624,7 @@ struct NoncontextualSubtable
}
protected:
- Lookup substitute;
+ Lookup substitute;
public:
DEFINE_SIZE_MIN (2);
};
@@ -725,8 +725,9 @@ struct InsertionSubtable
if (entry.data.markedInsertIndex != 0xFFFF)
{
unsigned int count = (flags & MarkedInsertCount);
+ if (unlikely ((buffer->max_ops -= count) <= 0)) return;
unsigned int start = entry.data.markedInsertIndex;
- const GlyphID *glyphs = &insertionAction[start];
+ const HBGlyphID *glyphs = &insertionAction[start];
if (unlikely (!c->sanitizer.check_array (glyphs, count))) count = 0;
bool before = flags & MarkedInsertBefore;
@@ -744,7 +745,7 @@ struct InsertionSubtable
buffer->move_to (end + count);
- buffer->unsafe_to_break_from_outbuffer (mark, MIN (buffer->idx + 1, buffer->len));
+ buffer->unsafe_to_break_from_outbuffer (mark, hb_min (buffer->idx + 1, buffer->len));
}
if (flags & SetMark)
@@ -753,8 +754,9 @@ struct InsertionSubtable
if (entry.data.currentInsertIndex != 0xFFFF)
{
unsigned int count = (flags & CurrentInsertCount) >> 5;
+ if (unlikely ((buffer->max_ops -= count) <= 0)) return;
unsigned int start = entry.data.currentInsertIndex;
- const GlyphID *glyphs = &insertionAction[start];
+ const HBGlyphID *glyphs = &insertionAction[start];
if (unlikely (!c->sanitizer.check_array (glyphs, count))) count = 0;
bool before = flags & CurrentInsertBefore;
@@ -793,7 +795,7 @@ struct InsertionSubtable
private:
hb_aat_apply_context_t *c;
unsigned int mark;
- const UnsizedArrayOf &insertionAction;
+ const UnsizedArrayOf &insertionAction;
};
bool apply (hb_aat_apply_context_t *c) const
@@ -819,7 +821,7 @@ struct InsertionSubtable
protected:
StateTable
machine;
- NNOffsetTo, HBUINT>
+ NNOffsetTo, HBUINT>
insertionAction; /* Byte offset from stateHeader to the start of
* the insertion glyph table. */
public:
@@ -883,17 +885,17 @@ struct ChainSubtable
Insertion = 5
};
- template
- typename context_t::return_t dispatch (context_t *c) const
+ template
+ typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
{
unsigned int subtable_type = get_type ();
TRACE_DISPATCH (this, subtable_type);
switch (subtable_type) {
- case Rearrangement: return_trace (c->dispatch (u.rearrangement));
- case Contextual: return_trace (c->dispatch (u.contextual));
- case Ligature: return_trace (c->dispatch (u.ligature));
- case Noncontextual: return_trace (c->dispatch (u.noncontextual));
- case Insertion: return_trace (c->dispatch (u.insertion));
+ case Rearrangement: return_trace (c->dispatch (u.rearrangement, hb_forward (ds)...));
+ case Contextual: return_trace (c->dispatch (u.contextual, hb_forward (ds)...));
+ case Ligature: return_trace (c->dispatch (u.ligature, hb_forward (ds)...));
+ case Noncontextual: return_trace (c->dispatch (u.noncontextual, hb_forward (ds)...));
+ case Insertion: return_trace (c->dispatch (u.insertion, hb_forward (ds)...));
default: return_trace (c->default_return_value ());
}
}
@@ -948,8 +950,10 @@ struct Chain
hb_aat_layout_feature_type_t type = (hb_aat_layout_feature_type_t) (unsigned int) feature.featureType;
hb_aat_layout_feature_selector_t setting = (hb_aat_layout_feature_selector_t) (unsigned int) feature.featureSetting;
retry:
- const hb_aat_map_builder_t::feature_info_t *info = map->features.bsearch (type);
- if (info && info->setting == setting)
+ // Check whether this type/setting pair was requested in the map, and if so, apply its flags.
+ // (The search here only looks at the type and setting fields of feature_info_t.)
+ hb_aat_map_builder_t::feature_info_t info = { type, setting, false, 0 };
+ if (map->features.bsearch (info))
{
flags &= feature.disableFlags;
flags |= feature.enableFlags;
@@ -967,9 +971,9 @@ struct Chain
}
void apply (hb_aat_apply_context_t *c,
- hb_mask_t flags) const
+ hb_mask_t flags) const
{
- const ChainSubtable *subtable = &StructAfter > (featureZ.as_array (featureCount));
+ const ChainSubtable *subtable = &StructAfter> (featureZ.as_array (featureCount));
unsigned int count = subtableCount;
for (unsigned int i = 0; i < count; i++)
{
@@ -1015,7 +1019,7 @@ struct Chain
bool (subtable->get_coverage () & ChainSubtable::Backwards) !=
HB_DIRECTION_IS_BACKWARD (c->buffer->props.direction);
- if (!c->buffer->message (c->font, "start chain subtable %d", c->lookup_index))
+ if (!c->buffer->message (c->font, "start chainsubtable %d", c->lookup_index))
goto skip;
if (reverse)
@@ -1026,12 +1030,12 @@ struct Chain
if (reverse)
c->buffer->reverse ();
- (void) c->buffer->message (c->font, "end chain subtable %d", c->lookup_index);
+ (void) c->buffer->message (c->font, "end chainsubtable %d", c->lookup_index);
if (unlikely (!c->buffer->successful)) return;
skip:
- subtable = &StructAfter > (*subtable);
+ subtable = &StructAfter> (*subtable);
c->set_lookup_index (c->lookup_index + 1);
}
}
@@ -1049,13 +1053,13 @@ struct Chain
if (!c->check_array (featureZ.arrayZ, featureCount))
return_trace (false);
- const ChainSubtable *subtable = &StructAfter > (featureZ.as_array (featureCount));
+ const ChainSubtable *subtable = &StructAfter> (featureZ.as_array (featureCount));
unsigned int count = subtableCount;
for (unsigned int i = 0; i < count; i++)
{
if (!subtable->sanitize (c))
return_trace (false);
- subtable = &StructAfter > (*subtable);
+ subtable = &StructAfter