Parallel flatMap always sequential

There are two different aspects. First, there is only a single pipeline which is either sequential or parallel. The choice of sequential or parallel at the inner stream is irrelevant. Note that the downstream consumer you see in the cited code snippet represents the entire subsequent stream pipeline, so in your code, ending with .collect(Collectors.toSet());, … Read more

Where do resource files go in a Gradle project that builds a Java 9 module?

Update (25 March 2020): There has been significant progress towards proper JPMS support. A nightly build of Gradle 6.4 now includes options to develop with Java 9 modules natively. See https://github.com/gradle/gradle/issues/890#issuecomment-603289940 . Update (29 September 2020): Since Gradle 6.4 (current release as of this update is 6.6.1) you can now support JPMS modules natively in … Read more

How to resolve module reads package error in java9

The problem is that your module path contains the same package (javax.annotation) in different modules (java.xml.ws.annotation and tomcat.embed.core), which the module system forbids in order to make configurations more reliable. This is called a split package. The module system tells you as much when listing all the modules that read (i.e. “see”) that package twice. … Read more

Create Java DateTime Instant from microseconds

long timeMicros = 1_565_245_051_795_306L; Instant i = Instant.EPOCH.plus(timeMicros, ChronoUnit.MICROS); System.out.println(i); Output is: 2019-08-08T06:17:31.795306Z Edit: Rather than dividing and multiplying to convert microseconds to milliseconds and/or seconds I preferred to use the built-in support for microseconds. Also when explicitly adding them to the epoch feels a little hand-held. You already know how to convert Instant to … Read more

java 9 module reads package X from A and B

Excluding the transitive dependency made it work and adjusting the module-info.java too!!! compile(“org.springframework.boot:spring-boot-starter:1.5.3.RELEASE”) { exclude group: ‘commons-logging’, module: ‘commons-logging’ } compile(“org.springframework.boot:spring-boot-starter-web:1.5.3.RELEASE”){ exclude group: ‘commons-logging’, module: ‘commons-logging’ }