equal
deleted
inserted
replaced
145 public Descriptor mDesc; |
145 public Descriptor mDesc; |
146 public int mParams; |
146 public int mParams; |
147 public int mAttrs; |
147 public int mAttrs; |
148 public int mNumParams; |
148 public int mNumParams; |
149 public boolean mSynthetic; |
149 public boolean mSynthetic; |
|
150 public boolean mIsLambda; |
150 public boolean mIsConstructor; |
151 public boolean mIsConstructor; |
151 public boolean mIsClinit; |
152 public boolean mIsClinit; |
152 public boolean mIsBridge; |
153 public boolean mIsBridge; |
153 public boolean isFinal; |
154 public boolean isFinal; |
154 public String prefix; |
155 public String prefix; |
163 mSynthetic = method.access_flags.is(AccessFlags.ACC_SYNTHETIC); |
164 mSynthetic = method.access_flags.is(AccessFlags.ACC_SYNTHETIC); |
164 mIsConstructor = mName.equals("<init>"); |
165 mIsConstructor = mName.equals("<init>"); |
165 mIsClinit = mName.equals("<clinit>"); |
166 mIsClinit = mName.equals("<clinit>"); |
166 prefix = cname + "." + mName + "() - "; |
167 prefix = cname + "." + mName + "() - "; |
167 mIsBridge = method.access_flags.is(AccessFlags.ACC_BRIDGE); |
168 mIsBridge = method.access_flags.is(AccessFlags.ACC_BRIDGE); |
|
169 mIsLambda = mSynthetic && mName.startsWith("lambda$"); |
168 |
170 |
169 if (mIsClinit) { |
171 if (mIsClinit) { |
170 sb = new StringBuilder(); // Discard output |
172 sb = new StringBuilder(); // Discard output |
171 } |
173 } |
172 sb.append(cname).append(".").append(mName).append("("); |
174 sb.append(cname).append(".").append(mName).append("("); |
223 return null; |
225 return null; |
224 } |
226 } |
225 |
227 |
226 // IMPL: Whether MethodParameters attributes will be generated |
228 // IMPL: Whether MethodParameters attributes will be generated |
227 // for some synthetics is unresolved. For now, assume no. |
229 // for some synthetics is unresolved. For now, assume no. |
228 if (mSynthetic) { |
230 if (mSynthetic && !mIsLambda) { |
229 warn(prefix + "synthetic has MethodParameter attribute"); |
231 warn(prefix + "synthetic has MethodParameter attribute"); |
230 } |
232 } |
231 |
233 |
232 String sep = ""; |
234 String sep = ""; |
233 String userParam = null; |
235 String userParam = null; |
347 } |
349 } |
348 } |
350 } |
349 } else if (isEnum && mNumParams == 1 && index == 0 && mName.equals("valueOf")) { |
351 } else if (isEnum && mNumParams == 1 && index == 0 && mName.equals("valueOf")) { |
350 expect = "name"; |
352 expect = "name"; |
351 allowMandated = true; |
353 allowMandated = true; |
352 } else if (mIsBridge) { |
354 } else if (mIsBridge || mIsLambda) { |
353 allowSynthetic = true; |
355 allowSynthetic = true; |
354 /* you can't expect an special name for bridges' parameters. |
356 /* you can't expect an special name for bridges' parameters. |
355 * The name of the original parameters are now copied. |
357 * The name of the original parameters are now copied. Likewise |
|
358 * for a method encoding the lambda expression, names are derived |
|
359 * from source lambda's parameters and captured enclosing locals. |
356 */ |
360 */ |
357 expect = null; |
361 expect = null; |
358 } |
362 } |
359 if (mandated) sb.append("/*implicit*/"); |
363 if (mandated) sb.append("/*implicit*/"); |
360 if (synthetic) sb.append("/*synthetic*/"); |
364 if (synthetic) sb.append("/*synthetic*/"); |