Skip to content

javac -parameters support #106

@jonpryor

Description

@jonpryor

Java 8's javac now supports storing method parameter name information within .class files, using the javac -parameters option. Consider the following Java code:

class f {
	public void m (String a, int b, int[] c) {
	}
}

If we compile with:

javac -parameters f.java

We can see that there's a new MethodParameters metadata blob:

$ mono class-parse.exe f.class --dump
...
        10: Utf8("MethodParameters")
...
        1: m (Ljava/lang/String;I[I)V Public
                Code(1, Unknown[LineNumberTable](6))
                Unknown[MethodParameters](13)

class-parse needs support for the new MethodParameters Attribute blob:

MethodParameters_attribute {
    u2 attribute_name_index;
    u4 attribute_length;
    u1 parameters_count;
    {   u2 name_index;
        u2 access_flags;
    } parameters[parameters_count];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions