Create a gist now

Instantly share code, notes, and snippets.

int 1
int 2
int 3
int 4
int 5
package com.talios.test;
import java.util.Arrays;
import java.util.List;
public class TestJdk {
public static void main(String[] args) {
List<String> strings = Arrays.asList("1", "2", "3", "4", "5");
strings.stream()
.mapToInt(s -> new Integer(s))
.forEach(i -> System.out.println(String.format("int %d", i)));
}
}
/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bin/java -Didea.launcher.port=7535 -Didea.launcher.bin.path=/Applications/Cardea-IU-130.555.app/bin -Dfile.encoding=UTF-8 -classpath /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/htmlconverter.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/JObjC.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Users/amrk/Dropbox/jdk8test/out/production/jdk8test:/Applications/Cardea-IU-130.555.app/lib/idea_rt.jar com.intellij.rt.execution.application.AppMain com.talios.test.TestJdk
Exception in thread "main" java.lang.BootstrapMethodError: call site initialization exception
at java.lang.invoke.CallSite.makeSite(CallSite.java:298)
at java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:294)
at com.talios.test.TestJdk.main(TestJdk.java:12)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:491)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
com/talios/test/TestJdk$$Lambda$1.applyAsInt(Ljava/lang/Object;)I @11: ireturn
Reason:
Type 'java/lang/Integer' (current frame, stack[0]) is not assignable to integer
Current Frame:
bci: @11
flags: { }
locals: { 'com/talios/test/TestJdk$$Lambda$1', 'java/lang/Object' }
stack: { 'java/lang/Integer' }
Bytecode:
0000000: bb00 0e59 2bc0 0010 b700 13ac
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2536)
at java.lang.Class.getDeclaredConstructors(Class.java:1928)
at java.lang.invoke.InnerClassLambdaMetafactory$1.run(InnerClassLambdaMetafactory.java:147)
at java.lang.invoke.InnerClassLambdaMetafactory$1.run(InnerClassLambdaMetafactory.java:144)
at java.security.AccessController.doPrivileged(Native Method)
at java.lang.invoke.InnerClassLambdaMetafactory.buildCallSite(InnerClassLambdaMetafactory.java:143)
at java.lang.invoke.LambdaMetafactory.metaFactory(LambdaMetafactory.java:191)
at java.lang.invoke.CallSite.makeSite(CallSite.java:283)
... 7 more
Process finished with exit code 1
package com.talios.test;
import java.util.Arrays;
import java.util.List;
public class TestJdk {
public static void main(String[] args) {
List<String> strings = Arrays.asList("1", "2", "3", "4", "5");
strings.stream()
.mapToInt(Integer::new)
.forEach(i -> System.out.println(String.format("int %d", i)));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment