-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for lambda expressions in an interface's constant initializer…
…; the lambda impl method will be moved to a companion class Fixes #42
- Loading branch information
Showing
6 changed files
with
53 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
10 changes: 9 additions & 1 deletion
10
retrolambda/src/main/java/net/orfjackal/retrolambda/util/Flags.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
// Copyright © 2013-2014 Esko Luontola <www.orfjackal.net> | ||
// Copyright © 2013-2015 Esko Luontola <www.orfjackal.net> | ||
// This software is released under the Apache License 2.0. | ||
// The license text is at http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
package net.orfjackal.retrolambda.util; | ||
|
||
import static org.objectweb.asm.Opcodes.ACC_STATIC; | ||
|
||
public class Flags { | ||
|
||
public static boolean hasFlag(int subject, int flag) { | ||
return (subject & flag) == flag; | ||
} | ||
|
||
public static boolean isClassInitializer(String name, String desc, int methodAccess) { | ||
return name.equals("<clinit>") && | ||
desc.equals("()V") && | ||
hasFlag(methodAccess, ACC_STATIC); | ||
} | ||
} |