mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 08:31:29 +00:00
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:
21
compiler/testData/loadJava8/compiledJava/ParameterNames.java
vendored
Normal file
21
compiler/testData/loadJava8/compiledJava/ParameterNames.java
vendored
Normal 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) {}
|
||||
}
|
||||
}
|
||||
29
compiler/testData/loadJava8/compiledJava/ParameterNames.javac.txt
vendored
Normal file
29
compiler/testData/loadJava8/compiledJava/ParameterNames.javac.txt
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
package test
|
||||
|
||||
public open class ParameterNames {
|
||||
public constructor ParameterNames(/*0*/ p0: kotlin.Long, /*1*/ p1: kotlin.String!)
|
||||
public open fun foo(/*0*/ p0: kotlin.Long, /*1*/ p1: kotlin.Int): kotlin.Unit
|
||||
|
||||
public/*package*/ final enum class Enum : kotlin.Enum<test.ParameterNames.Enum!> {
|
||||
enum entry E
|
||||
|
||||
private constructor Enum(/*0*/ p0: kotlin.Double, /*1*/ p1: kotlin.String!)
|
||||
public final override /*1*/ /*fake_override*/ val name: kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ val ordinal: kotlin.Int
|
||||
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.ParameterNames.Enum!): kotlin.Int
|
||||
protected/*protected and package*/ final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun finalize(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun getDeclaringClass(): java.lang.Class<test.ParameterNames.Enum!>!
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): test.ParameterNames.Enum
|
||||
public final /*synthesized*/ fun values(): kotlin.Array<test.ParameterNames.Enum>
|
||||
}
|
||||
|
||||
public/*package*/ open inner class Inner {
|
||||
public constructor Inner(/*0*/ p0: kotlin.Double, /*1*/ p1: kotlin.Any!)
|
||||
}
|
||||
|
||||
// Static members
|
||||
public/*package*/ open fun bar(/*0*/ p0: test.ParameterNames!): kotlin.Unit
|
||||
}
|
||||
29
compiler/testData/loadJava8/compiledJava/ParameterNames.txt
vendored
Normal file
29
compiler/testData/loadJava8/compiledJava/ParameterNames.txt
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
package test
|
||||
|
||||
public open class ParameterNames {
|
||||
public constructor ParameterNames(/*0*/ longConstructorParam: kotlin.Long, /*1*/ stringConstructorParam: kotlin.String!)
|
||||
public open fun foo(/*0*/ longMethodParam: kotlin.Long, /*1*/ intMethodParam: kotlin.Int): kotlin.Unit
|
||||
|
||||
public/*package*/ final enum class Enum : kotlin.Enum<test.ParameterNames.Enum!> {
|
||||
enum entry E
|
||||
|
||||
private constructor Enum(/*0*/ doubleEnumParam: kotlin.Double, /*1*/ stringEnumParam: kotlin.String!)
|
||||
public final override /*1*/ /*fake_override*/ val name: kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ val ordinal: kotlin.Int
|
||||
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.ParameterNames.Enum!): kotlin.Int
|
||||
protected/*protected and package*/ final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun finalize(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun getDeclaringClass(): java.lang.Class<test.ParameterNames.Enum!>!
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): test.ParameterNames.Enum
|
||||
public final /*synthesized*/ fun values(): kotlin.Array<test.ParameterNames.Enum>
|
||||
}
|
||||
|
||||
public/*package*/ open inner class Inner {
|
||||
public constructor Inner(/*0*/ doubleInnerParam: kotlin.Double, /*1*/ objectInnerParam: kotlin.Any!)
|
||||
}
|
||||
|
||||
// Static members
|
||||
public/*package*/ open fun bar(/*0*/ staticMethodParam: test.ParameterNames!): kotlin.Unit
|
||||
}
|
||||
Reference in New Issue
Block a user