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
@Target({ TYPE, METHOD }) @Retention(RUNTIME) @ScopeAnnotation | |
public @interface FXMLLoadingScoped { | |
} |
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
import java.awt.Color; | |
import java.awt.Graphics; | |
import java.awt.GraphicsConfiguration; | |
import java.awt.GraphicsDevice; | |
import java.awt.GraphicsEnvironment; | |
import java.awt.Image; | |
import java.awt.Transparency; | |
import java.awt.image.BufferedImage; | |
import java.io.File; |
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
import java.lang.invoke.MethodHandle; | |
import java.lang.invoke.MethodHandles; | |
import java.lang.invoke.MethodType; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
public class MethodHandleTest | |
{ | |
private static final String METHOD_NAME = "increment"; |
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
public class Math { | |
public static boolean isPrime(final long number) { | |
if (number == 2) | |
return true; | |
if (number < 2) | |
return false; | |
if(number % 2 == 0) | |
return false; | |
long maxCheck = (long) Math.sqrt(number); |
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
@BookScoped | |
public class Hobbit implements Hero | |
{ | |
public Hobbit() | |
{ | |
System.out.println("created " + toString()); | |
} | |
} |
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
public class MiddleEarthModule extends AbstractModule | |
{ | |
private final EnterableScope scope; | |
public MiddleEarthModule() | |
{ | |
scope = new EnterableScope(); | |
} | |
@Override |
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
public interface Hero | |
{ | |
} |
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
@Target({ TYPE, METHOD }) @Retention(RUNTIME) @ScopeAnnotation | |
public @interface BookScoped | |
{ | |
} | |
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
public class Main | |
{ | |
public static void main(String[] args) | |
{ | |
MiddleEarthModule module; | |
module = new MiddleEarthModule(); | |
Injector injector; | |
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
All specifications and documentation for | |
this software--even those required for | |
customer sign off--are entirely fictional. | |
All code is tested... poorly. | |
The following program contains leaky | |
abstractions and should not be reused by anyone. |