Skip to content

Instantly share code, notes, and snippets.

@oehme
Last active December 11, 2015 10:39
Show Gist options
  • Save oehme/4588719 to your computer and use it in GitHub Desktop.
Save oehme/4588719 to your computer and use it in GitHub Desktop.
Active Annotations finally bring the preciseness of the specification into my code.
Xtend:
@Usually
def doStuff() {
println("This usually doesn't fail")
}
generated Java:
public void doStuff() {
if (System.currentTimeMillis() % 42 == 0) {
throw new IllegalStateException("Well, usually...");
}
System.out.println("This usually doesn't fail");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment