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
Slides of FOSDEM 2014 - Java Intrinsic |
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.util.OptionalLong; | |
public class TimeStat { | |
private long totalTime; | |
private long recordCount; | |
private long minimumTime; | |
public void record(long elapsedTime) { | |
totalTime += elapsedTime; | |
minimumTime = (recordCount == 0)? elapsedTime: Math.min(minimumTime, elapsedTime); |
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.io.Reader; | |
import java.io.StringReader; | |
import java.math.BigDecimal; | |
import java.time.LocalDate; | |
import java.util.Collections; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Objects; | |
import java.util.Spliterator; |
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.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.Objects; | |
import java.util.function.Function; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
import java.util.stream.Stream; |
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.util.Random; | |
import java.util.function.IntFunction; | |
import java.util.stream.Collectors; | |
public interface SayHi { | |
public static void main(String[] args) { | |
IntFunction<String> fun = s -> new Random(s) | |
.ints(6, 0, 27) | |
.filter(v -> v != 0) | |
.mapToObj(v -> "" + (char)('`' + v)) |
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
package java.lang.invoke; | |
import java.lang.invoke.MethodHandle; | |
import java.lang.invoke.MethodHandles.Lookup; | |
import java.lang.invoke.MethodType; | |
import java.lang.reflect.Method; | |
import java.util.Arrays; | |
import jdk.internal.org.objectweb.asm.ClassWriter; | |
import jdk.internal.org.objectweb.asm.FieldVisitor; |
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
comments of blog post 'The Selector Pattern' |
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.CallSite; | |
import java.lang.invoke.ConstantCallSite; | |
import java.lang.invoke.MethodHandle; | |
import java.lang.invoke.MethodHandles; | |
import java.lang.invoke.MethodHandles.Lookup; | |
import java.lang.invoke.MethodType; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.concurrent.atomic.AtomicInteger; |
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
package java.lang.invoke; | |
import java.lang.invoke.MethodHandles.Lookup; | |
import java.net.URI; | |
import java.net.URISyntaxException; | |
// compile with: | |
// /usr/jdk/jdk-9/bin/javac -Xmodule:java.base -d ../classes java/lang/invoke/FunPIC.java | |
// execute with: | |
// /usr/jdk/jdk-9/bin/java -Xpatch:java.base=../classes -m java.base/java.lang.invoke.FunPIC |
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
package java.lang.invoke; | |
import java.lang.invoke.MethodHandles.Lookup; | |
import java.net.URI; | |
import java.net.URISyntaxException; | |
// compile with: | |
// /usr/jdk/jdk-9/bin/javac -Xmodule:java.base -d ../classes java/lang/invoke/FunPIC.java | |
// execute with: | |
// /usr/jdk/jdk-9/bin/java -Xpatch:java.base=../classes -m java.base/java.lang.invoke.FunPIC |
OlderNewer