Skip to content

Commit 0f08b44

Browse files
authored
Create test class for Java 23 ... (#23)
- Markdown Documentation Comments - Deprecated sun.misc.Unsafe - Update README.md
1 parent c7f31d1 commit 0f08b44

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ This project includes unit tests for key functionalities introduced in each Java
3434
- [Java 20](src/test/java/pl/mperor/lab/java/Java20.java)
3535
- [Java 21](src/test/java/pl/mperor/lab/java/Java21.java)
3636
- [Java 22](src/test/java/pl/mperor/lab/java/Java22.java)
37+
- [Java 23](src/test/java/pl/mperor/lab/java/Java23.java)
3738

3839
For detailed examples and tests of each feature, please refer to the individual source files linked above.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package pl.mperor.lab.java;
2+
3+
import org.junit.jupiter.api.Assertions;
4+
import org.junit.jupiter.api.Test;
5+
import sun.misc.Unsafe;
6+
7+
/// Java 23 (September 2024)
8+
/// [JDK 23](https://openjdk.org/projects/jdk/23)
9+
///
10+
/// - STANDARD FEATURES:
11+
/// - 467: Markdown Documentation Comments
12+
/// - 471: Deprecate the Memory-Access Methods in sun.misc.Unsafe for Removal
13+
/// - 474: ZGC: Generational Mode by Default
14+
///
15+
/// - PREVIEW & INCUBATOR:
16+
/// - 476: Module Import Declarations (Preview)
17+
/// - 455: Primitive Types in Patterns, instanceof, and switch (Preview)
18+
/// - 466: Class-File API (Second Preview)
19+
/// - 473: Stream Gatherers (Second Preview)
20+
/// - 482: Flexible Constructor Bodies (Second Preview)
21+
/// - 477: Implicitly Declared Classes and Instance Main Methods (Third Preview)
22+
/// - 480: Structured Concurrency (Third Preview)
23+
/// - 481: Scoped Values (Third Preview)
24+
/// - 469: Vector API (Eighth Incubator)
25+
public class Java23 {
26+
27+
/// This is a **Markdown** JavaDoc (starts with ///).
28+
/// Markdown Documentation Comments are described in this [JEP](https://openjdk.org/jeps/467).
29+
/// It supports *italic*, **bold**, and `code` formatting.
30+
///
31+
/// As well:
32+
/// - code block:
33+
/// ```java
34+
/// void main(){
35+
/// println("Unnamed entry point!");
36+
///}
37+
///```
38+
/// - table:
39+
///
40+
/// | JDK | Year |
41+
/// |------|------|
42+
/// | 17 | 2021 |
43+
/// | 21 | 2023 |
44+
/// | 25 | 2025 |
45+
@Test
46+
public void testMarkdownDocumentationComments() {
47+
}
48+
49+
@Test
50+
public void testSunMiscUnsafeDeprecated() {
51+
Assertions.assertThrows(SecurityException.class, Unsafe::getUnsafe);
52+
}
53+
54+
}

0 commit comments

Comments
 (0)