Skip to main content

Questions tagged [java8]

Java 8 refers to the version of the Java platform released in March 2014.

Filter by
Sorted by
Tagged with
1 vote
2 answers
281 views

I asked this questions on StackOverflow but it's definitely a bit too broad. Even for this website, although the question is about software design, it might not be enough "focused". I am ...
lux_piromani's user avatar
1 vote
1 answer
2k views

I have a jar file, for example foo.jar. My code contains a lot of libraries (almost 75 jar dependencies). I am not using anything like maven or gradle, I'm just using pure java with pure jar files as ...
Day Trip's user avatar
0 votes
1 answer
1k views

I have an existing microservice that talks to a Natural Language Processing (NLP) product and fetches around 50 fields. I need to create domain objects in Java now from these fields. I read about ...
Akash Sharma's user avatar
-1 votes
1 answer
603 views

This problem statement is around one UI component, 3 service components. The current design of the application is like: UI makes request to Service-A to get data Service-A first makes a call to ...
G.G.'s user avatar
  • 115
2 votes
4 answers
2k views

I mean the question in the sense of: Should the occurrence of simple loops on collections in code in Java 8 and higher be regarded as code smell (except in justified exceptions)? When it came to Java ...
Matthias Ronge's user avatar
1 vote
0 answers
60 views

We have 800-900 services we expose via an ESB. Each service is a web app hosted on Tomcat servers. We have 4 tomcat servers per group of services. Our services are split into 4 groups. Each service (...
Kelvin Wayne's user avatar
0 votes
3 answers
1k views

I have the following common pattern that I need to use in an application: Given a list of keys, call a function with a parameter to find values for the keys. The function may return null for a given ...
James's user avatar
  • 285
3 votes
2 answers
2k views

So I've been coding in Java for a decent amount of time, but recently, I've started a class that cares about my coding design. In the past, if I had two methods inside a class that needed to edit the ...
Tyler M's user avatar
  • 89
128 votes
11 answers
91k views

We have recently moved to Java 8. Now, I see applications flooded with Optional objects. Before Java 8 (Style 1) Employee employee = employeeServive.getEmployee(); if(employee!=null){ System....
user3198603's user avatar
  • 1,896
7 votes
1 answer
4k views

I have a usecase where I am supposed to store entire payload from a third party API in addition to the DTO, say XYZDto, its translated to. There are two ways to achieve that - Translate the payload ...
comiventor's user avatar
0 votes
1 answer
3k views

What are the gains in actual computing speed (verbosity of code being put aside) and for which case would each be recommended for, as a good design pattern? I would like to know the above in general ...
Leon's user avatar
  • 207
6 votes
1 answer
2k views

The functional interfaces in java.util.function cover the vast majority of common strategies one might want to apply, but it's also possible to define your own @FunctionalInterface instead. In cases ...
dimo414's user avatar
  • 403
4 votes
2 answers
1k views

As a beginner in both java8 and functional programming, I think I'm missing something when reading about function composition since I cannot find a reason why there are two methods that do this, ...
Ioanna's user avatar
  • 163
4 votes
2 answers
5k views

We have an application that allows users to enter conditionals in the form bound op x op bound2, we store this as a string, and then parse it at runtime to evaluate it. It is a decent amount of work, ...
soandos's user avatar
  • 313
19 votes
1 answer
3k views

I'm wondering whether measuring conditional code coverage by current tools for Java are not obsolete since Java 8 came up. With Java 8's Optional and Stream we can often avoid code branches/loops, ...
Karol Lewandowski's user avatar
4 votes
2 answers
822 views

I was reading through design philosophy of java and this line struck me: "The VM checks whether the signature of the Java code is valid and would refuse to interpret if any change of the code is ...
Sudip Bhandari's user avatar
11 votes
2 answers
32k views

My string is of type"abacsdsdvvsg" or"a a a a a a a" And I use String[] stringArray = s.split(""); or String[] stringArray = s.split(" "); I'm wondering what would be the complexity(in O(string length)...
tezz's user avatar
  • 221
6 votes
1 answer
4k views

I am new to the Java 8 time package, and am trying to better understand it and make sure that I am making good use of it. Is there a specific reason that LocalDateTime's truncatedTo(TemporalUnit) ...
anonymous's user avatar
  • 161
0 votes
1 answer
1k views

I'm working my way (slowly, but surely) through a book: Introduction to Java Programming, 10th edition, Comprehensive, by J. Liang (ISBN10: 0133761312) It explains the idea of a reference variable ...
silenceislife's user avatar
1 vote
1 answer
1k views

here my Question it is said that "Java is not actually a pure object oriented programming language since it needs primitives" I want to know that how data types can affect to java be an pure object ...
Shraddha's user avatar
2 votes
1 answer
149 views

I have class GameState laid out to basically hold an Array of Players, an Array of StarSystems, and a few other fields that need to persist from save to save. Each GameObject keeps track of its own id,...
Jax's user avatar
  • 123
1 vote
3 answers
2k views

I have 2 modules (containing multiple classes). Let's call them Module A and Module B. Module B has a dependency on Module A: Module B -> Module A. Now, I have created an utility class C, which A ...
sceiler's user avatar
  • 111
1 vote
1 answer
1k views

I am in the process of standing up my first OSS Java lib (GitHub/Maven) that an open source hardware community will be making fair/moderate use of. I am writing this library with Java 8 and managing ...
smeeb's user avatar
  • 4,970
28 votes
9 answers
35k views

Take the two code examples: if(optional.isPresent()) { //do your thing } if(variable != null) { //do your thing } As far as I can tell the most obvious difference is that the Optional ...
Will's user avatar
  • 829
0 votes
1 answer
89 views

Traditionally, a function that want to skip certain items during processing will accept a Collection or var-args argument, but in the Java 8 world I think I should switch to Predicates. Now, since ...
billc.cn's user avatar
  • 630