mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 02:16:18 +00:00
[java8] Support in delombok for default methods in interfaces
This commit is contained in:
1 parent
c7bfba873e
commit
e890428077
3 files changed
+23
-1
No files matched your search
@@ -126,6 +126,9 @@ public class PrettyCommentsPrinter extends JCTree.Visitor {
|
||||
|
||||
private static final Map<TreeTag, String> OPERATORS;
|
||||
|
||||
// StandardFlags | DEFAULT
|
||||
private static final long EXTENDED_STANDARD_FLAGS = 0x0fffL | 1L<<43;
|
||||
|
||||
static {
|
||||
Map<TreeTag, String> map = new HashMap<TreeTag, String>();
|
||||
|
||||
@@ -493,7 +496,7 @@ public class PrettyCommentsPrinter extends JCTree.Visitor {
|
||||
suppressFinalAndSemicolonsInTry = false;
|
||||
}
|
||||
print(TreeInfo.flagNames(flags));
|
||||
if ((flags & StandardFlags) != 0) print(" ");
|
||||
if ((flags & EXTENDED_STANDARD_FLAGS) != 0) print(" ");
|
||||
if ((flags & ANNOTATION) != 0) print("@");
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
interface DefaultMethod {
|
||||
int size();
|
||||
default boolean isEmpty() {
|
||||
return size() == 0;
|
||||
}
|
||||
default strictfp void run() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// version 8:
|
||||
interface DefaultMethod {
|
||||
int size();
|
||||
|
||||
default boolean isEmpty() {
|
||||
return size() == 0;
|
||||
}
|
||||
|
||||
default strictfp void run() {
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user