Load Java parameter names correctly in BinaryJavaMethod

PSI-based implementation (accessible via
`-Xuse-old-class-files-reading`) loads parameter names from the
"MethodParameters" attribute if it's present, so our own implementation
should as well.

This metadata doesn't seem supported in the java.lang.model.element API
though, so SymbolBasedValueParameter (which is used in `-Xuse-javac`)
will continue to have incorrect behavior for now

 #KT-25193 Fixed
This commit is contained in:
Alexander Udalov
2018-07-17 14:55:59 +02:00
parent 0f0602230a
commit 1464a4ac58
13 changed files with 181 additions and 16 deletions

View File

@@ -0,0 +1,21 @@
// JAVAC_OPTIONS: -parameters
package test;
public class ParameterNames {
public ParameterNames(long longConstructorParam, String stringConstructorParam) {}
public void foo(long longMethodParam, int intMethodParam) {}
static void bar(ParameterNames staticMethodParam) {}
class Inner {
public Inner(double doubleInnerParam, Object objectInnerParam) {}
}
enum Enum {
E(0.0, "");
Enum(double doubleEnumParam, String stringEnumParam) {}
}
}