< prev index next >

src/java.base/share/classes/java/lang/constant/AsTypeMethodHandleDesc.java

Print this page

        

@@ -22,13 +22,16 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
 package java.lang.constant;
 
+import jdk.internal.lang.annotation.Foldable;
+
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
+import java.util.Optional;
 
 import static java.lang.constant.ConstantDescs.BSM_INVOKE;
 import static java.lang.constant.ConstantDescs.CD_MethodHandle;
 import static java.util.Objects.requireNonNull;
 

@@ -49,10 +52,11 @@
         this.underlying = requireNonNull(underlying);
         this.type = requireNonNull(type);
     }
 
     @Override
+    @Foldable
     public MethodTypeDesc invocationType() {
         return type;
     }
 
     @Override

@@ -65,6 +69,11 @@
 
     @Override
     public String toString() {
         return  String.format("%s.asType%s", underlying.toString(), type.displayDescriptor());
     }
+
+    @Override
+    public Optional<? extends ConstantDesc> describeConstable() {
+        return Optional.empty();
+    }
 }
< prev index next >