Skip to content

Problems with backported default and static methods #48

Closed
@pietrodev

Description

@pietrodev

I'm trying to backport some default and static methods with new version 2.0.
PRE: The project I'm backporting is successfully backported with old version of retrolambda if I remove all default and static method. The project is also obfuscated with proguard 5.1 successfully.

When trying the new version I have two problems:

  1. Proguard enabled: I got a long series of warnings when obfuscating:
    [java] Warning: org.plibrary.test.TestLinq$$Lambda$55: can't find referenced method 'boolean lambda$negate$38(org.plibrary.compat.Predicate,java.lang.Object)' in program class org.plibrary.compat.Predicate$

Note that "negate" is the name of the default method but no class has been generated with that name

  1. Proguard disabled. I can compile but when I run tests I got:
    initializationError(org.plibrary.test.TestLinq)
    java.lang.ClassFormatError: Method lambda$and$27 in class org/plibrary/compat/Consumer has illegal modifiers: 0x1402

"and" is another default method and Consumer is an interface.

As an additional info these are the options I'm using as printed by retrolambda
[java] Retrolambda 2.0.0
[java] Bytecode version: 50 (Java 6)
[java] Default methods: true
[java] Input directory: build\classes
[java] Output directory: build\classes

I tried also with bytecode 51, nothing changes.

Any idea of what I can do?
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions