VerifyError (in Eclipse) with ExtensionMethod #509

Closed
lombokissues opened this Issue Jul 14, 2015 · 5 comments

Projects

None yet

1 participant

@lombokissues
Collaborator

Migrated from Google Code (issue 436)

@lombokissues
Collaborator

👤 majoorj@yahoo.com   🕗 Dec 12, 2012 at 18:15 UTC

What steps will reproduce the problem?

  1. Import the attached Eclipse project
  2. Run the Test.java class as a Java application

What is the expected output? What do you see instead?
Expected is a system print statement (false), but I get a VerifyError.

What version of the product are you using? On what operating system?
Lombok version 11.6
Eclipse Juno (but also fails on Indigo)
Java 7 on Windows

Please provide any additional information below.
I attached a complete Java Eclipse project, but otherwise the following standalone test case will reproduce it as well (in Eclipse that is).
Exception in thread "main" java.lang.VerifyError: Bad type on operand stack in method Test.main([Ljava/lang/String;)V at offset 18

Example:

import lombok.experimental.ExtensionMethod;
import java.util.AbstractMap.SimpleEntry;

@ ExtensionMethod({Test.TestExtensions.class})
public class Test {
public static void main(String... args) {
SimpleEntry<String, String> entry = new SimpleEntry<String, String>(null, "hello");
System.out.println(entry.getKey().Test1());
}

public static class TestExtensions {
public static boolean Test1(String $this) {
return $this != null;
}
}
}

If I use the extension method directly with a string it works fine, but it fails with if the string comes from a generic type.

Using Javac there is no such problem, it occurs in Eclipse.

@lombokissues
Collaborator

👤 majoorj@yahoo.com   🕗 Dec 12, 2012 at 18:15 UTC

🔗 lomboktest.zip

@lombokissues
Collaborator

👤 reinierz   🕗 Mar 11, 2013 at 22:51 UTC

Test case reproduced. We're working on this now.

@lombokissues
Collaborator

👤 reinierz   🕗 Mar 11, 2013 at 23:28 UTC

Fixed in edge:

https://projectlombok.org/download-edge.html

@lombokissues lombokissues removed the accepted label Jul 14, 2015
@lombokissues
Collaborator

End of migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment