< prev index next >

src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java

Print this page

        

*** 2048,2067 **** tSym.setTypeAttributes(lambdaIdent.sym.getRawTypeAttributes()); return t; } break; case CAPTURED_OUTER_THIS: ! if (lambdaIdent.sym.owner.kind == TYP && m.containsKey(lambdaIdent.sym.owner)) { // Transform outer instance variable references anchoring them to the captured synthetic. - Symbol tSym = m.get(lambdaIdent.sym.owner); JCExpression t = make.Ident(tSym).setType(lambdaIdent.sym.owner.type); tSym.setTypeAttributes(lambdaIdent.sym.owner.getRawTypeAttributes()); t = make.Select(t, lambdaIdent.name); t.setType(lambdaIdent.type); TreeInfo.setSymbol(t, lambdaIdent.sym); return t; } break; } } return null; } --- 2048,2082 ---- tSym.setTypeAttributes(lambdaIdent.sym.getRawTypeAttributes()); return t; } break; case CAPTURED_OUTER_THIS: ! if (lambdaIdent.sym.owner.kind == TYP) { ! Symbol tSym = null; ! found_proxy: for (Symbol out:m.keySet()) { ! Symbol p = out; ! while (true) { ! if (lambdaIdent.sym.owner.equals(p)) { ! tSym = m.get(out); ! break found_proxy; ! } ! Type t2 = ((Symbol.ClassSymbol)p).getSuperclass(); ! if (!t2.hasTag(CLASS) || t2.isErroneous()) ! break; ! p = t2.tsym; ! } ! } ! if (tSym != null) { // Transform outer instance variable references anchoring them to the captured synthetic. JCExpression t = make.Ident(tSym).setType(lambdaIdent.sym.owner.type); tSym.setTypeAttributes(lambdaIdent.sym.owner.getRawTypeAttributes()); t = make.Select(t, lambdaIdent.name); t.setType(lambdaIdent.type); TreeInfo.setSymbol(t, lambdaIdent.sym); return t; } + } break; } } return null; }
< prev index next >