changeset 50747:a4c04fa88c1a condy-folding

Automatic merge with jep-334
author mcimadamore
date Wed, 30 May 2018 19:25:28 +0200
parents 2df2582d6ad0 1cc4bc0f03e9
children ad2dac9ef560
files src/java.base/share/classes/java/lang/Class.java src/java.base/share/classes/java/lang/Double.java src/java.base/share/classes/java/lang/Enum.java src/java.base/share/classes/java/lang/Float.java src/java.base/share/classes/java/lang/Integer.java src/java.base/share/classes/java/lang/Long.java src/java.base/share/classes/java/lang/String.java src/java.base/share/classes/java/lang/invoke/MethodHandle.java src/java.base/share/classes/java/lang/invoke/MethodType.java src/java.base/share/classes/java/lang/invoke/VarHandle.java src/java.base/share/classes/java/lang/invoke/constant/AsTypeMethodHandleDesc.java src/java.base/share/classes/java/lang/invoke/constant/Constable.java src/java.base/share/classes/java/lang/invoke/constant/ConstantClassDesc.java src/java.base/share/classes/java/lang/invoke/constant/ConstantMethodHandleDesc.java src/java.base/share/classes/java/lang/invoke/constant/ConstantMethodTypeDesc.java src/java.base/share/classes/java/lang/invoke/constant/DynamicConstantDesc.java src/java.base/share/classes/java/lang/invoke/constant/PrimitiveClassDesc.java
diffstat 17 files changed, 33 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/lang/Class.java	Fri May 25 07:08:57 2018 -0700
+++ b/src/java.base/share/classes/java/lang/Class.java	Wed May 30 19:25:28 2018 +0200
@@ -26,9 +26,9 @@
 package java.lang;
 
 import java.lang.annotation.Annotation;
-import java.lang.invoke.MethodHandles;
 import java.lang.invoke.constant.ClassDesc;
 import java.lang.invoke.FieldTypeDescriptor;
+import java.lang.invoke.constant.ConstantDesc;
 import java.lang.module.ModuleReader;
 import java.lang.ref.SoftReference;
 import java.io.IOException;
@@ -136,7 +136,7 @@
                               Type,
                               AnnotatedElement,
                               FieldTypeDescriptor<Class<?>>,
-                              Constable<Class<T>> {
+                              Constable<Class<?>> {
     private static final int ANNOTATION= 0x00002000;
     private static final int ENUM      = 0x00004000;
     private static final int SYNTHETIC = 0x00001000;
--- a/src/java.base/share/classes/java/lang/Double.java	Fri May 25 07:08:57 2018 -0700
+++ b/src/java.base/share/classes/java/lang/Double.java	Wed May 30 19:25:28 2018 +0200
@@ -1083,7 +1083,7 @@
      * @return an {@link Optional} describing the {@linkplain Double} instance
      */
     @Override
-    public Optional<ConstantDesc<Double>> describeConstable() {
+    public Optional<Double> describeConstable() {
         return Optional.of(this);
     }
 
--- a/src/java.base/share/classes/java/lang/Enum.java	Fri May 25 07:08:57 2018 -0700
+++ b/src/java.base/share/classes/java/lang/Enum.java	Wed May 30 19:25:28 2018 +0200
@@ -319,8 +319,8 @@
         }
 
         @Override
-        public Optional<? extends ConstantDesc<? super ConstantDesc<E>>> describeConstable() {
-            return Optional.of(DynamicConstantDesc.of(BSM_ENUMDESC, CR_EnumDesc)
+        public Optional<? extends ConstantDesc<ConstantDesc<E>>> describeConstable() {
+            return Optional.of(DynamicConstantDesc.<ConstantDesc<E>>of(BSM_ENUMDESC, CR_EnumDesc)
                                                   .withArgs(constantType().descriptorString(), constantName()));
         }
 
--- a/src/java.base/share/classes/java/lang/Float.java	Fri May 25 07:08:57 2018 -0700
+++ b/src/java.base/share/classes/java/lang/Float.java	Wed May 30 19:25:28 2018 +0200
@@ -995,7 +995,7 @@
      * @return an {@link Optional} describing the {@linkplain Float} instance
      */
     @Override
-    public Optional<ConstantDesc<Float>> describeConstable() {
+    public Optional<Float> describeConstable() {
         return Optional.of(this);
     }
 
--- a/src/java.base/share/classes/java/lang/Integer.java	Fri May 25 07:08:57 2018 -0700
+++ b/src/java.base/share/classes/java/lang/Integer.java	Wed May 30 19:25:28 2018 +0200
@@ -1830,7 +1830,7 @@
      * @return an {@link Optional} describing the {@linkplain Integer} instance
      */
     @Override
-    public Optional<ConstantDesc<Integer>> describeConstable() {
+    public Optional<Integer> describeConstable() {
         return Optional.of(this);
     }
 
--- a/src/java.base/share/classes/java/lang/Long.java	Fri May 25 07:08:57 2018 -0700
+++ b/src/java.base/share/classes/java/lang/Long.java	Wed May 30 19:25:28 2018 +0200
@@ -1976,7 +1976,7 @@
      * @return an {@link Optional} describing the {@linkplain Long} instance
      */
     @Override
-    public Optional<ConstantDesc<Long>> describeConstable() {
+    public Optional<Long> describeConstable() {
         return Optional.of(this);
     }
 
--- a/src/java.base/share/classes/java/lang/String.java	Fri May 25 07:08:57 2018 -0700
+++ b/src/java.base/share/classes/java/lang/String.java	Wed May 30 19:25:28 2018 +0200
@@ -3286,7 +3286,7 @@
      * @return an {@link Optional} describing the {@linkplain String} instance
      */
     @Override
-    public Optional<ConstantDesc<String>> describeConstable() {
+    public Optional<String> describeConstable() {
         return Optional.of(this);
     }
 
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandle.java	Fri May 25 07:08:57 2018 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandle.java	Wed May 30 19:25:28 2018 +0200
@@ -30,6 +30,7 @@
 
 import java.lang.invoke.constant.ClassDesc;
 import java.lang.invoke.constant.Constable;
+import java.lang.invoke.constant.ConstantDesc;
 import java.lang.invoke.constant.MethodHandleDesc;
 import java.lang.invoke.constant.MethodTypeDesc;
 import java.util.Arrays;
@@ -1516,7 +1517,7 @@
     }
 
     @Override
-    public Optional<MethodHandleDesc> describeConstable() {
+    public Optional<? extends ConstantDesc<MethodHandle>> describeConstable() {
         MethodHandleInfo info;
         ClassDesc owner;
         String name;
--- a/src/java.base/share/classes/java/lang/invoke/MethodType.java	Fri May 25 07:08:57 2018 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/MethodType.java	Wed May 30 19:25:28 2018 +0200
@@ -25,16 +25,12 @@
 
 package java.lang.invoke;
 
-import jdk.internal.vm.annotation.Stable;
-import sun.invoke.util.Wrapper;
-
-import java.lang.invoke.MethodTypeDescriptor;
+import java.lang.invoke.constant.ClassDesc;
+import java.lang.invoke.constant.Constable;
 import java.lang.invoke.constant.MethodTypeDesc;
-import java.lang.ref.WeakReference;
 import java.lang.ref.Reference;
 import java.lang.ref.ReferenceQueue;
-import java.lang.invoke.constant.ClassDesc;
-import java.lang.invoke.constant.Constable;
+import java.lang.ref.WeakReference;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
@@ -42,13 +38,17 @@
 import java.util.Objects;
 import java.util.Optional;
 import java.util.StringJoiner;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.stream.Stream;
 
+import jdk.internal.vm.annotation.Stable;
 import sun.invoke.util.BytecodeDescriptor;
-import static java.lang.invoke.MethodHandleStatics.*;
 import sun.invoke.util.VerifyType;
+import sun.invoke.util.Wrapper;
+
+import static java.lang.invoke.MethodHandleStatics.UNSAFE;
+import static java.lang.invoke.MethodHandleStatics.newIllegalArgumentException;
 
 /**
  * A method type represents the arguments and return type accepted and
--- a/src/java.base/share/classes/java/lang/invoke/VarHandle.java	Fri May 25 07:08:57 2018 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/VarHandle.java	Wed May 30 19:25:28 2018 +0200
@@ -2269,7 +2269,7 @@
         }
 
         @Override
-        public Optional<? extends ConstantDesc<? super ConstantDesc<VarHandle>>> describeConstable() {
+        public Optional<? extends ConstantDesc<ConstantDesc<VarHandle>>> describeConstable() {
             Constable<?>[] args =
                     (kind == Kind.ARRAY)
                     ? new Constable<?>[] { declaringClass }
--- a/src/java.base/share/classes/java/lang/invoke/constant/AsTypeMethodHandleDesc.java	Fri May 25 07:08:57 2018 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/constant/AsTypeMethodHandleDesc.java	Wed May 30 19:25:28 2018 +0200
@@ -68,7 +68,7 @@
     }
 
     @Override
-    public Optional<? extends ConstantDesc<? super ConstantDesc<MethodHandle>>> describeConstable() {
+    public Optional<? extends ConstantDesc<ConstantDesc<MethodHandle>>> describeConstable() {
         return ConstantUtils.symbolizeHelper(ConstantDescs.MHR_METHODHANDLEDESC_ASTYPE, ConstantDescs.CR_MethodHandleDesc,
                                              underlying, type);
     }
--- a/src/java.base/share/classes/java/lang/invoke/constant/Constable.java	Fri May 25 07:08:57 2018 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/constant/Constable.java	Wed May 30 19:25:28 2018 +0200
@@ -69,5 +69,5 @@
      * @return An {@link Optional} containing the resulting nominal descriptor,
      * or an empty {@link Optional} if one cannot be constructed.
      */
-    Optional<? extends ConstantDesc<? super T>> describeConstable();
+    Optional<? extends ConstantDesc<T>> describeConstable();
 }
--- a/src/java.base/share/classes/java/lang/invoke/constant/ConstantClassDesc.java	Fri May 25 07:08:57 2018 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/constant/ConstantClassDesc.java	Wed May 30 19:25:28 2018 +0200
@@ -86,8 +86,9 @@
     }
 
     @Override
-    public Optional<? extends ConstantDesc<? super ConstantDesc<Class<?>>>> describeConstable() {
-        return Optional.of(DynamicConstantDesc.of(BSM_CLASSDESC, CR_ClassDesc).withArgs(descriptor));
+    public Optional<? extends ConstantDesc<ConstantDesc<Class<?>>>> describeConstable() {
+        return Optional.of(DynamicConstantDesc.<ConstantDesc<Class<?>>>of(BSM_CLASSDESC, CR_ClassDesc)
+                                   .withArgs(descriptor));
     }
 
     /**
--- a/src/java.base/share/classes/java/lang/invoke/constant/ConstantMethodHandleDesc.java	Fri May 25 07:08:57 2018 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/constant/ConstantMethodHandleDesc.java	Wed May 30 19:25:28 2018 +0200
@@ -186,8 +186,8 @@
     }
 
     @Override
-    public Optional<? extends ConstantDesc<? super ConstantDesc<MethodHandle>>> describeConstable() {
-        return Optional.of(DynamicConstantDesc.of(BSM_METHODHANDLEDESC, CR_ConstantMethodHandleDesc)
+    public Optional<? extends ConstantDesc<ConstantDesc<MethodHandle>>> describeConstable() {
+        return Optional.of(DynamicConstantDesc.<ConstantDesc<MethodHandle>>of(BSM_METHODHANDLEDESC, CR_ConstantMethodHandleDesc)
                                               .withArgs(kind.toString(), owner.descriptorString(), name, type.descriptorString()));
     }
 
--- a/src/java.base/share/classes/java/lang/invoke/constant/ConstantMethodTypeDesc.java	Fri May 25 07:08:57 2018 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/constant/ConstantMethodTypeDesc.java	Wed May 30 19:25:28 2018 +0200
@@ -150,8 +150,9 @@
     }
 
     @Override
-    public Optional<? extends ConstantDesc<? super ConstantDesc<MethodType>>> describeConstable() {
-        return Optional.of(DynamicConstantDesc.of(BSM_METHODTYPEDESC, CR_ConstantMethodTypeDesc).withArgs(descriptorString()));
+    public Optional<? extends ConstantDesc<ConstantDesc<MethodType>>> describeConstable() {
+        return Optional.of(DynamicConstantDesc.<ConstantDesc<MethodType>>of(BSM_METHODTYPEDESC, CR_ConstantMethodTypeDesc)
+                                   .withArgs(descriptorString()));
     }
 
     /**
--- a/src/java.base/share/classes/java/lang/invoke/constant/DynamicConstantDesc.java	Fri May 25 07:08:57 2018 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/constant/DynamicConstantDesc.java	Wed May 30 19:25:28 2018 +0200
@@ -375,7 +375,7 @@
     }
 
     @Override
-    public Optional<? extends ConstantDesc<? super ConstantDesc<T>>> describeConstable() {
+    public Optional<? extends ConstantDesc<ConstantDesc<T>>> describeConstable() {
         ConstantDesc<?>[] args = new ConstantDesc<?>[bootstrapArgs.length + 5];
         args[0] = bootstrapMethod.owner().descriptorString();
         args[1] = bootstrapMethod.methodName();
--- a/src/java.base/share/classes/java/lang/invoke/constant/PrimitiveClassDesc.java	Fri May 25 07:08:57 2018 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/constant/PrimitiveClassDesc.java	Wed May 30 19:25:28 2018 +0200
@@ -68,7 +68,7 @@
     }
 
     @Override
-    public Optional<? extends ConstantDesc<? super ConstantDesc<Class<?>>>> describeConstable() {
+    public Optional<? extends ConstantDesc<ConstantDesc<Class<?>>>> describeConstable() {
         return ConstantUtils.symbolizeHelper(ConstantDescs.MHR_CLASSDESC_FACTORY, ConstantDescs.CR_ClassDesc, descriptorString());
     }