< prev index next >

src/java.base/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 2012, 2021, 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
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this
--- 1,7 ---
  /*
!  * Copyright (c) 2012, 2022, 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
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this

*** 269,11 ***
  
              // check receiver type
              if (!implClass.isAssignableFrom(receiverClass)) {
                  throw new LambdaConversionException(
                          String.format("Invalid receiver type %s; not a subtype of implementation type %s",
!                                       receiverClass, implClass));
              }
          } else {
              // no receiver
              capturedStart = 0;
              samStart = capturedArity;
--- 269,11 ---
  
              // check receiver type
              if (!implClass.isAssignableFrom(receiverClass)) {
                  throw new LambdaConversionException(
                          String.format("Invalid receiver type %s; not a subtype of implementation type %s",
!                                       receiverClass.descriptorString(), implClass.descriptorString()));
              }
          } else {
              // no receiver
              capturedStart = 0;
              samStart = capturedArity;

*** 369,11 ***
                  } else {
                      // must be convertible to primitive
                      return !strict;
                  }
              } else {
!                 // both are reference types: fromType should be a superclass of toType.
                  return !strict || toType.isAssignableFrom(fromType);
              }
          }
      }
  
--- 369,11 ---
                  } else {
                      // must be convertible to primitive
                      return !strict;
                  }
              } else {
!                 // fromType should be a superclass of toType
                  return !strict || toType.isAssignableFrom(fromType);
              }
          }
      }
  
< prev index next >