Created
July 16, 2012 15:05
-
-
Save cb372/3123204 to your computer and use it in GitHub Desktop.
Project Lombok bug 399 - @ExtensionMethod fails unless extensions class is in root package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.cb372.lombok; // <-- Note: not the root package | |
import lombok.experimental.ExtensionMethod; | |
@ExtensionMethod({ Extensions.class }) | |
public class Main { | |
public static void main(String[] args) { | |
System.out.println("Hello, %s".format("World.")); // => "Hello, World." | |
} | |
} | |
class Extensions { | |
public static String format(String format, Object ... args) { | |
return String.format(format, args); | |
} | |
} | |
/* | |
* javac: | |
* | |
* error: cannot find symbol | |
* symbol : variable com.github.cb372.lombok.Extensions | |
* location: class com.github.cb372.lombok.Main | |
*/ | |
/* | |
* Cause: http://code.google.com/p/projectlombok/issues/detail?id=399 | |
* Fix: https://github.com/rzwitserloot/lombok/commit/06826342f3be58cfb422f291f89e29be2cfde7f0 | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// <-- Note: root package | |
import lombok.experimental.ExtensionMethod; | |
@ExtensionMethod({ Extensions.class }) | |
public class Main { | |
public static void main(String[] args) { | |
System.out.println("Hello, %s".format("World.")); // => "Hello, World." | |
} | |
} | |
class Extensions { | |
public static String format(String format, Object ... args) { | |
return String.format(format, args); | |
} | |
} | |
/* | |
* Compiles fine with javac. | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment