java-15 Questions

6

Solved

Since I am using Java 14 and 15 preview features. Trying to find the string interpolation in java. The closest answer I found is String.format("u1=%s;u2=%s;u3=%s;u4=%s;", u1, u2, u3, u4) ...
Pencel asked 24/8, 2020 at 10:27

4

I am trying to run a scala program, in which there are errors with Java 16. My colleague is using Java 15, and all is fine. When i type java -version in my terminal it says i am using Java 15. Howe...
Suspicion asked 1/7, 2021 at 12:6

3

Solved

Since Ed25519 has not been around for long (in JDK), there are very few resources on how to use it. While their example is very neat and useful, I have some trouble understanding what am I doing wr...
Murtagh asked 18/1, 2021 at 18:37

3

Solved

I have the following sealed interface (Java 15): public sealed interface Animal permits Cat, Duck { String makeSound(); } This interface is implemented by 2 classes: public final class Cat imple...
Simmers asked 19/9, 2020 at 18:34

2

Solved

I am trying to compile and load dynamically generated Java code during runtime. Since both ClassLoader::defineClass and Unsafe::defineAnonymousClass have serious drawbacks in this scenario, I tried...
Lillylillywhite asked 22/2, 2022 at 16:26

7

Solved

Sealed classes and sealed interfaces were a preview feature in Java 15, with a second preview in Java 16, and now proposed delivery in Java 17. They have provided classic examples like Shape -> ...
Undoing asked 3/10, 2020 at 19:16

4

Solved

I don't really understand why there is a non-sealed keyword in JEP-360 / Java 15. For me, an extension of a sealed-class should only be final or a sealed-class itself. Providing the non-sealed keyw...
Ragland asked 12/9, 2020 at 12:3

1

Solved

I was previously using this contrived code record Foo(int bar[]) {} which is making use of the C-style array-notation. And it compiled fine in Java 15. Now, all of the sudden, with the official re...
Ecumenism asked 4/9, 2021 at 15:38

1

My problem is that the HttpClient never makes its way to the target. The target is on the same network (so I need no proxy) and it is definitely up. And the timeout was set quite high (120 seconds)...
Absolve asked 25/4, 2021 at 8:42

1

Solved

I am running several hundred functions with runAsync(). All of the functions modify some statically available list and thus do not need to return anything. I want to make sure they all finish befor...
Olwen asked 16/4, 2021 at 1:6

2

Solved

In my Java application a small put important feature is to be able to rename audio files based on their metadata (e.g album/artist -title) and the mask is specified using Javascript, this makes for...
Rhombencephalon asked 8/6, 2020 at 9:58

2

Records are a new language feature since Java 14 (first preview) and Java 15 (second preview). As per my understanding they will be used to reduce boilerplate code in immutable data objects. ...
Attire asked 16/2, 2021 at 9:7

1

Solved

Suppose I have this simple method: static final Integer me = Integer.parseInt("2"); static int go() { return me * 2; } For javac, me is not a constant (according to the JLS rules), but...
Wearisome asked 31/1, 2021 at 16:4

0

I have a best practices question with regards to mapping Instant to PostgreSQL TIMESTAMP. We've updated our app to Java 15 and the new enhancement of the system clock to nanosecond precision ...
Odawa asked 6/1, 2021 at 11:23

3

Solved

I have an existing Spring Boot application that is non-modular and uses Nashorn. The application works well on Java 14. After adding the Maven coordinates of the new Nashorn available for Java 15, ...
Perla asked 12/12, 2020 at 13:46

3

Solved

I am using Java 15 preview feature record in my code, and defined the record as follow public record ProductViewModel ( String id, String name, String description, float price ) { } In the c...
Roister asked 11/12, 2020 at 15:10

1

Solved

Java 15 introduced (non-preview) text blocks feature. It allows to define multi-lined string literals without breaking code indentation, by stripping the common white space prefix from the lines. T...
Adriene asked 3/11, 2020 at 12:0

1

Solved

I'm trying to run the new Java 15 features under Eclipse 2020-09. I have installed OpenJDK 15 and set it under "Installed JRE": Nevertheless I cannot set this version as compiler version...
Term asked 29/9, 2020 at 12:43

1

Solved

I have just read that Java 15 should have sealed classes. jep360 says: Sealed classes and interfaces restrict which other classes or interfaces may extend or implement them. I thought that ...
Niple asked 25/9, 2020 at 9:44

1

Solved

Oracle recently released JDK 15, and I'm wondering if Apache NetBeans 12.1, the latest version of the NetBeans IDE, supports JDK 15. I understand that NetBeans doesn't officially support JDK 15, bu...
Parenteau asked 18/9, 2020 at 11:26

2

Solved

I've just tried upgrading my project to Java 15, and now I get the following error: both interface org.jooq.Record in org.jooq and class java.lang.Record in java.lang match Does anybody have some...
Leslileslie asked 17/9, 2020 at 12:57

1

Solved

I have a simple sealed class, MyShape: public sealed class MyShape permits MyCircle { private final int width; private final int height; public MyShape(int width, int height) { this.width = w...
Succedaneum asked 17/9, 2020 at 21:44

4

Solved

Just came across a new feature in Java 15 i.e. "TEXT BLOCKS". I can assume that a variable can be added inside a text block by concatenating with a "+" operator as below: ...
Woodsy asked 1/9, 2020 at 12:22

1

Solved

Accidentally I have stumbled into a change in Java 15 that I was not aware of. Suppose I have a very simple question: what is the size of an array of 3 integers? For this, I use JOL. The code is fa...
Illnatured asked 13/7, 2020 at 15:29
1

© 2022 - 2024 — McMap. All rights reserved.