Skip to content

target_method directive fails to apply when synthetic parameters are present #47

Description

@Lulu13022002

Given the following definitions in v4 applied to the following source:

unpick v4

group int spliterator_characteristics
	@flags
	java.util.Spliterator.ORDERED
	java.util.Spliterator.DISTINCT
	java.util.Spliterator.SORTED
	java.util.Spliterator.SIZED
	java.util.Spliterator.NONNULL
	java.util.Spliterator.IMMUTABLE
	java.util.Spliterator.CONCURRENT
	java.util.Spliterator.SUBSIZED

target_method java.util.Spliterators$AbstractSpliterator <init> (JI)V
	param 1 spliterator_characteristics
public static Spliterators.AbstractSpliterator<Integer> iterator(final boolean value) {
    return new Spliterators.AbstractSpliterator<>(10, Spliterator.SIZED) {

        @Override
        public boolean tryAdvance(Consumer<? super Integer> action) {
            boolean localVar = value;
            return true;
        }
    };
}

When the localVar var is commented the replacement works fine however when the anonymous class capture the parameter the descriptor of the constructor becomes (JIZ)V instead of the expected (JI)V in the INVOKESPECIAL instruction and so unpick fail.

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