langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java
changeset 17575 7693e6ff0d7d
parent 17550 567df1379253
child 17578 46ac954e4a84
equal deleted inserted replaced
17574:044c7e1e4d53 17575:7693e6ff0d7d
  1762                 if (syntheticParams != null) {
  1762                 if (syntheticParams != null) {
  1763                     return;
  1763                     return;
  1764                 }
  1764                 }
  1765                 boolean inInterface = translatedSym.owner.isInterface();
  1765                 boolean inInterface = translatedSym.owner.isInterface();
  1766                 boolean thisReferenced = !getSymbolMap(CAPTURED_THIS).isEmpty();
  1766                 boolean thisReferenced = !getSymbolMap(CAPTURED_THIS).isEmpty();
  1767                 boolean needInstance = thisReferenced || inInterface;
  1767 
  1768 
  1768                 // If instance access isn't needed, make it static.
  1769                 // If instance access isn't needed, make it static
  1769                 // Interface instance methods must be default methods.
  1770                 // Interface methods much be public default methods, otherwise make it private
  1770                 // Awaiting VM channges, default methods are public
  1771                 translatedSym.flags_field = SYNTHETIC | (needInstance? 0 : STATIC) |
  1771                 translatedSym.flags_field = SYNTHETIC |
  1772                         (inInterface? PUBLIC | DEFAULT : PRIVATE);
  1772                         ((inInterface && thisReferenced)? PUBLIC : PRIVATE) |
       
  1773                         (thisReferenced? (inInterface? DEFAULT : 0) : STATIC);
  1773 
  1774 
  1774                 //compute synthetic params
  1775                 //compute synthetic params
  1775                 ListBuffer<JCVariableDecl> params = ListBuffer.lb();
  1776                 ListBuffer<JCVariableDecl> params = ListBuffer.lb();
  1776 
  1777 
  1777                 // The signature of the method is augmented with the following
  1778                 // The signature of the method is augmented with the following