Skip to content

Commit 05e47e0

Browse files
author
saurabh.kumar
committed
update to jdk 23
1 parent bda6758 commit 05e47e0

File tree

6 files changed

+46
-52
lines changed

6 files changed

+46
-52
lines changed

.github/workflows/maven.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v4
19-
- name: Set up JDK 22
19+
- name: Set up JDK 23
2020
uses: actions/setup-java@v4
2121
with:
22-
java-version: 22
22+
java-version: 23
2323
distribution: 'temurin'
2424
- name: Build with Maven JavaCon
2525
run: mvn -B package --file JavaCon/pom.xml
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package map;
2+
3+
import java.util.HashMap;
4+
5+
public class MapWithChangedKey {
6+
7+
public static void main(String[] args) {
8+
sb();
9+
string2();
10+
}
11+
12+
private static void sb() {
13+
final var map = new HashMap<StringBuilder, String>();
14+
final var key1 = new StringBuilder("key1");
15+
final var key2 = new StringBuilder("key2");
16+
17+
map.put(key1, "value1");
18+
map.put(key2, "value2");
19+
20+
key1.append("__changed");
21+
22+
System.out.println("sb value for key1: " + map.get(key1));
23+
System.out.println("sb value for key1: " + map.get(new StringBuilder("key1__changed")));
24+
System.out.println("sb value for key2: " + map.get(new StringBuilder("key2")));
25+
}
26+
27+
private static void string2() {
28+
final var map = new HashMap<String, String>();
29+
var key1 = "key1";
30+
final var key2 = "key2";
31+
32+
map.put(key1, "value1");
33+
map.put(key2, "value2");
34+
35+
key1 += "__changed";
36+
37+
System.out.println("sb value for key1: " + map.get(key1));
38+
System.out.println("sb value for key1: " + map.get("key1__changed"));
39+
System.out.println("sb value for key2: " + map.get("key2"));
40+
}
41+
}

JavaCon/Java25Features/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<groupId>org.apache.maven.plugins</groupId>
1818
<artifactId>maven-compiler-plugin</artifactId>
1919
<configuration>
20-
<release>22</release>
20+
<release>23</release>
2121
<compilerArgs>--enable-preview</compilerArgs>
2222
</configuration>
2323
</plugin>

JavaCon/Java25Features/src/main/java/com/saurabh/java/StringLiteralJDK21.java

Lines changed: 0 additions & 47 deletions
This file was deleted.

JavaCon/Java25Features/src/main/java/com/saurabh/java/UnnamedPatternVariable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static void main(String[] args) {
1515
try {
1616
throw new IllegalArgumentException("test");
1717
} catch (IllegalStateException _) {
18-
System.out.println(STR."Got an illegal state exception for: \{car.name()}");
18+
// System.out.println("Got an illegal state exception for: \{car.name()}");
1919
} catch (RuntimeException _) {
2020
System.out.println("Got a runtime exception!");
2121
}

JavaCon/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<properties>
1717
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18-
<maven.compiler.release>22</maven.compiler.release>
18+
<maven.compiler.release>23</maven.compiler.release>
1919

2020
<!-- testing -->
2121
<junit-jupiter.version>5.11.3</junit-jupiter.version>

0 commit comments

Comments
 (0)