Questions tagged [java-13]

Use this tag for questions specific to Java 13, which is version 13 of the Java platform, released on September 17, 2019. In most cases you should also specify the java tag.

This is the Reference Implementation of version 13 of the Java SE Platform, as specified by JSR 388 in the Java Community Process.

105 questions
81
votes
4 answers

What does the new keyword "yield" mean in Java 13?

Java 13 introduced the yield keyword for switch expressions. How can I use it and what's the difference to a default return or break value?
zerocewl
  • 11,401
  • 6
  • 27
  • 53
21
votes
3 answers

OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release

I'm starting a new Spring 5 project with Java 14. It compiled, but gave me a warning: OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release Any ideas how to…
Ruslan B.
  • 313
  • 1
  • 2
  • 5
18
votes
1 answer

Return outside of enclosing switch expression

I'm using a switch expression¹ in Java 12 to convert a string to a HTTP method: static Optional parseRequestMethod(String methodStr) { return Optional.ofNullable( switch (methodStr.strip().toUpperCase(Locale.ROOT)) { …
Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
9
votes
2 answers

How can I suppress Javac warning about preview features?

I'm using Java 13 (13.0.1.hs-adpt) and I enabled the preview language features (mainly because of text blocks). My code is properly annotated with @SuppressWarnings("preview") wherever relevant, but I still get Note: Some input files use preview…
giorgiga
  • 1,758
  • 12
  • 29
9
votes
2 answers

How to set up a spring-boot application with java 13

I am creating a spring-boot application, which is running and performing well with openJdk12. The application: https://github.com/jactor-rises/jactor-persistence I am looking for how to set it up with openJdk13. I tried with spring-boot…
jactor-rises
  • 2,395
  • 2
  • 22
  • 44
8
votes
1 answer

Programmatically detect --preview Mode in JRE

Since Java 11, a PREVIEW-MODE on the Java Compiler and Runtime can be enabled. It allows to preview new features. (JEP 12) java --enable-preview How can I detect from within Java whether the JVM has been started with preview-mode enabled? The…
alfonx
  • 6,936
  • 2
  • 49
  • 58
8
votes
1 answer

is there any compatible version of SonarQube with Java 13

I am currently using SonarQube Community Edition version 7.7 on Java 8 JDK using Maven, Iwant to start evaluating OpenJDK 13 . Sonarqube doesn't support OpenJDK 13
7
votes
5 answers

Can there be multiple value assignments for the enhanced switch statement?

I'm trying to initialize two variables with an enhanced switch statement: int num = //something boolean val1; String val2; val1, val2 = switch(num) { case 0 -> (true, "zero!"); case 1 -> (true, "one!"); default -> (false, "unknown…
Allen Liao
  • 91
  • 5
7
votes
1 answer

JDK 11 vs JDK 13 performance

UPDATE Throughout comments it turned out that the approach for benchmark I taken was incorrect, therefore results were misleading. After correcting my approach (as in accepted answer) results are as one would expect - JDK 13 performance is just as…
Googie
  • 5,742
  • 2
  • 19
  • 31
7
votes
2 answers

JDK-13 Unsupported class file major version for surefire plugin

I'm trying to create Java module project with Java-13 and Maven. My pom.xml is:
Kirill
  • 7,580
  • 6
  • 44
  • 95
7
votes
2 answers

illegal text block open delimiter sequence, missing line terminator

Java 13 is coming, so I started studying its new features, one of which is text blocks. I wrote a simple program public final class Example { public static void main(String[] args) { final String greeting = """Hello It's me,…
Andrew Tobilko
  • 48,120
  • 14
  • 91
  • 142
6
votes
1 answer

UseCompressedOops UseCompressedClassPointers in jdk-13 and jdk-15

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 fairly trivial: import…
Eugene
  • 117,005
  • 15
  • 201
  • 306
6
votes
2 answers

Is there a class for encoding a local time of week in Java?

I'm wanting to create a schedule that wraps around week by week. Because the schedule is the same from one week to the next, the only information I need to store is the day of the week, and the time it occurs. eg. Monday 2:30pm. The actual date…
6
votes
2 answers

Is caching of boxed Byte objects not required by Java 13 SE spec?

Reading the JAVA 13 SE specification, I found in chapter 5, section 5.1.7. Boxing Conversion the following guarantee: If the value p being boxed is the result of evaluating a constant expression (§15.28) of type boolean, char, short, int, or…
lpetru
  • 117
  • 5
6
votes
2 answers

Files.isHidden C:\\ changed between JDK12 and JDK13 on windows

Files.isHidden(Path.of("c:\\")) returns true on Windows 10, JDK 13 but returns false on JDK 12 same machine. Anyone know why this is?
J Shattu
  • 121
  • 6
1
2 3 4 5 6 7