< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java

Print this page
*** 798,25 ***
      }
  
      /**
       * Common supertype for all functional expression trees (lambda and method references)
       */
!     public abstract static class JCFunctionalExpression extends JCPolyExpression {
  
          public JCFunctionalExpression() {
              //a functional expression is always a 'true' poly
              polyKind = PolyKind.POLY;
          }
  
          /** list of target types inferred for this functional expression. */
          public Type target;
          /** The owner of this functional expression. */
          public Symbol owner;
  
          public Type getDescriptorType(Types types) {
              return target != null ? types.findDescriptorType(target) : types.createErrorType(null);
          }
      }
  
      /**
       * A class definition.
       */
--- 798,30 ---
      }
  
      /**
       * Common supertype for all functional expression trees (lambda and method references)
       */
!     public abstract static sealed class JCFunctionalExpression extends JCPolyExpression
+                                                                permits JCLambda, JCMemberReference {
  
          public JCFunctionalExpression() {
              //a functional expression is always a 'true' poly
              polyKind = PolyKind.POLY;
          }
  
          /** list of target types inferred for this functional expression. */
          public Type target;
          /** The owner of this functional expression. */
          public Symbol owner;
+         /** code reflection specific metadata. */
+         public CodeReflectionInfo codeReflectionInfo;
  
          public Type getDescriptorType(Types types) {
              return target != null ? types.findDescriptorType(target) : types.createErrorType(null);
          }
+ 
+         public record CodeReflectionInfo(MethodSymbol codeModel, Type reflectableLambdaMetafactory) { }
      }
  
      /**
       * A class definition.
       */

*** 2012,11 ***
      }
  
      /**
       * A lambda expression.
       */
!     public static class JCLambda extends JCFunctionalExpression implements LambdaExpressionTree {
  
          public enum ParameterKind {
              IMPLICIT,
              EXPLICIT
          }
--- 2017,11 ---
      }
  
      /**
       * A lambda expression.
       */
!     public static final class JCLambda extends JCFunctionalExpression implements LambdaExpressionTree {
  
          public enum ParameterKind {
              IMPLICIT,
              EXPLICIT
          }

*** 2601,11 ***
      }
  
      /**
       * Selects a member expression.
       */
!     public static class JCMemberReference extends JCFunctionalExpression implements MemberReferenceTree {
  
          public ReferenceMode mode;
          public ReferenceKind kind;
          public Name name;
          public JCExpression expr;
--- 2606,11 ---
      }
  
      /**
       * Selects a member expression.
       */
!     public static non-sealed class JCMemberReference extends JCFunctionalExpression implements MemberReferenceTree {
  
          public ReferenceMode mode;
          public ReferenceKind kind;
          public Name name;
          public JCExpression expr;
< prev index next >