Use this tag for questions specific to Java 8 which is version 8 (internal number 1.8) of the Java platform, released on 18 March 2014. In most cases you should also specify the java tag.

learn more…| top users | synonyms (3)|java 8 jobs

2
votes
5answers
45 views

Java streams vs Iterators

I have been playing with the new and shiny functional part of Java and one of the things that puzzle me the most are streams? What is their use? On Google I mostly found explanations of how to use ...
0
votes
0answers
6 views

Hystrix fallback executed even though run() was successful

I'm using Hystrix via Tenacity, a dropwizard module for hystrix https://github.com/yammer/tenacity, and I'm noticing that fallback() is called even though the run() method successfully runs.Here's ...
0
votes
0answers
11 views

grakn 1.0.0 cannot start queue on debian/wheezy with jdk8

I installed grakn 1.0.0 on debian/wheezy with jdk8while starting grakn server it says STORAGE .... STARTEDQUEUE ..... FAILEDI found nothing useful in the log directory.any clues where I could ...
0
votes
1answer
50 views

CHECKCAST is necessary or not?

package p;public class X {private int x;public X supp(Function<Integer, X> f){return f.apply( 1);}}And bytecode for the supp:public supp(Ljava/util/function/...
11
votes
3answers
190 views

Serialization and deserialization of lambda

This code below throws Exception in thread "main" java.lang.ClassCastException: test.Subclass2 cannot be cast to test.Subclass1at test.LambdaTest.main(LambdaTest.java:17)public class LambdaTest {...
0
votes
1answer
19 views

Java SpEL EL1043E: Unexpected token. Expected 'rparen())' but was 'comma(,)'

I try to learn SpEL but one of my script doesn't work.My script is:changePages(#{T(StoryContent).pages}, (x, y) -> x.replaceAll(y, x.substring(0, 1) + '...' + x.substring(x.length() - 1, x....
0
votes
1answer
65 views

Get average value entry from Map

I am trying to get the average value from a Map using Java 8, but instead of getting the value itself I want to get the Map.Entry.double average=totals.entrySet().stream()...
4
votes
1answer
86 views

Spring Expression Language - Java 8 forEach or stream on list

Is it possible for stream or forEach on list in SpEL?e.g.List<String> x=new LinkedList<>(Arrays.asList("A","AAB"));ExpressionParser parser=new SpelExpressionParser();...
-1
votes
0answers
21 views

Java 8 has removed header from linkedlist implementation

java 6 had header element:public E More getFirst() {return header.next.element; }Java 8 gets rid of header instead first element has value and instantiated with null previous node.what ...
2
votes
3answers
49 views

Java8 Streams - Compare Two List's object values and add value to sub object of first list?

I have two objects:public class ObjectOne {private String id;private String name;private String school;private String score; //Default score is null..getters and setters..}public ...
1
vote
0answers
36 views

java 8 - Way to filter list of values from a map?

I have a mapMap<Integer, List<Person>> personsByIdand a predicate function callbak(person) -> person.getPersonID() > 10 && person.blabla() !=nullI need to filter the ...
9
votes
6answers
127 views

How to join two Optional<String> with a delimiter in Java 8

I have two Optional strings, name1 and name2. I want to join the two such that the result is also an Optional with:If either one is non-empty, the result should be the non-empty name.If both are ...
0
votes
0answers
24 views

javax.xml.ws.Endpoint.publish(String address) throws NPE (Java 8u162 )

After upgrading java from 8u151 to 8u162, it started to throw NPE in javax.xml.ws.Endpoint.publish(String address). With 8u151 everything was fine and now it publishes only one (the first) endpoint at ...
11
votes
5answers
585 views

Sorting and sub listing from lambda expression

I'm having a array list with bellow elements.List<Record> list=new ArrayList<>();list.add(new Record(3, "32"));list.add(new Record(4, "42"));list.add(new Record(1, "12"));list.add(...
4
votes
0answers
42 views

Observable emitter generates too much pressure for HystrixCommands

I have an Observable that emits file lines (many GBs read from GCS).return StringObservable.byLine(Observable.using(() -> storage.get(blobId).reader(),reader -> ...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,