mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8143133: Wrong MethodParameters on capturing local class with multiple constructors
MethodParameters attribute not always generated for local classes constructors Reviewed-by: jlahoda
This commit is contained in:
parent
ec26043caf
commit
de127a784a
5 changed files with 52 additions and 12 deletions
|
@ -279,7 +279,7 @@ class ClassFileVisitor extends Tester.Visitor {
|
|||
userParam = param;
|
||||
}
|
||||
}
|
||||
if (expect != null && !param.equals(expect)) {
|
||||
if (check > 0 && expect != null && !param.equals(expect)) {
|
||||
error(prefix + "param[" + x + "]='"
|
||||
+ param + "' expected '" + expect + "'");
|
||||
return null;
|
||||
|
@ -346,6 +346,17 @@ class ClassFileVisitor extends Tester.Visitor {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (synthetic && !mandated && !allowSynthetic) {
|
||||
//patch treatment for local captures
|
||||
if (isAnon || (isInner & !isStatic)) {
|
||||
expect = "val\\$.*";
|
||||
allowSynthetic = true;
|
||||
if (isFinal) {
|
||||
expect = "final val\\$.*";
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (isEnum && mNumParams == 1 && index == 0 && mName.equals("valueOf")) {
|
||||
expect = "name";
|
||||
allowMandated = true;
|
||||
|
@ -411,7 +422,6 @@ class ClassFileVisitor extends Tester.Visitor {
|
|||
if (mSynthetic) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Otherwise, do check test parameter naming convention.
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue