Skip to content

Commit 6d70408

Browse files
authored
[JAVA-4584] Enabled core-java-12 module (#14926)
Enabled 12,13,15
1 parent b0dc3b2 commit 6d70408

9 files changed

Lines changed: 15 additions & 112 deletions

File tree

core-java-modules/core-java-12/pom.xml

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
<packaging>jar</packaging>
99

1010
<parent>
11-
<groupId>com.baeldung</groupId>
12-
<artifactId>parent-modules</artifactId>
13-
<version>1.0.0-SNAPSHOT</version>
11+
<groupId>com.baeldung.core-java-modules</groupId>
12+
<artifactId>core-java-modules</artifactId>
13+
<version>0.0.1-SNAPSHOT</version>
1414
</parent>
1515

1616
<dependencies>
@@ -21,30 +21,8 @@
2121
</dependency>
2222
</dependencies>
2323

24-
<build>
25-
<plugins>
26-
<plugin>
27-
<groupId>org.apache.maven.plugins</groupId>
28-
<artifactId>maven-compiler-plugin</artifactId>
29-
<version>${maven-compiler-plugin.version}</version>
30-
<configuration>
31-
<source>${maven.compiler.source.version}</source>
32-
<target>${maven.compiler.target.version}</target>
33-
<compilerArgs>--enable-preview</compilerArgs>
34-
</configuration>
35-
</plugin>
36-
<plugin>
37-
<artifactId>maven-surefire-plugin</artifactId>
38-
<configuration>
39-
<argLine>--enable-preview</argLine>
40-
</configuration>
41-
</plugin>
42-
</plugins>
43-
</build>
44-
4524
<properties>
46-
<maven.compiler.source.version>12</maven.compiler.source.version>
47-
<maven.compiler.target.version>12</maven.compiler.target.version>
25+
<java.version>17</java.version>
4826
</properties>
4927

5028
</project>

core-java-modules/core-java-12/src/test/java/com/baeldung/switchExpression/SwitchUnitTest.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,6 @@ public void switchJava12(){
1919
Assert.assertEquals(value, 2);
2020
}
2121

22-
@Test
23-
public void switchLocalVariable(){
24-
var month = Month.AUG;
25-
int i = switch (month){
26-
case JAN,JUN, JUL -> 3;
27-
case FEB,SEP, OCT, NOV, DEC -> 1;
28-
case MAR,MAY, APR, AUG -> {
29-
int j = month.toString().length() * 4;
30-
break j;
31-
}
32-
};
33-
Assert.assertEquals(12, i);
34-
}
3522

3623
enum Month {JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC}
3724
}

core-java-modules/core-java-13/pom.xml

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,13 @@
88
<packaging>jar</packaging>
99

1010
<parent>
11-
<groupId>com.baeldung</groupId>
12-
<artifactId>parent-modules</artifactId>
13-
<version>1.0.0-SNAPSHOT</version>
11+
<groupId>com.baeldung.core-java-modules</groupId>
12+
<artifactId>core-java-modules</artifactId>
13+
<version>0.0.1-SNAPSHOT</version>
1414
</parent>
1515

16-
<build>
17-
<plugins>
18-
<plugin>
19-
<groupId>org.apache.maven.plugins</groupId>
20-
<artifactId>maven-compiler-plugin</artifactId>
21-
<version>${maven-compiler-plugin.version}</version>
22-
<configuration>
23-
<source>${maven.compiler.source.version}</source>
24-
<target>${maven.compiler.target.version}</target>
25-
<release>13</release>
26-
<compilerArgs>--enable-preview</compilerArgs>
27-
</configuration>
28-
</plugin>
29-
<plugin>
30-
<groupId>org.apache.maven.plugins</groupId>
31-
<artifactId>maven-surefire-plugin</artifactId>
32-
<version>${surefire.plugin.version}</version>
33-
<configuration>
34-
<argLine>--enable-preview</argLine>
35-
</configuration>
36-
</plugin>
37-
</plugins>
38-
</build>
39-
4016
<properties>
41-
<maven.compiler.source.version>13</maven.compiler.source.version>
42-
<maven.compiler.target.version>13</maven.compiler.target.version>
43-
<surefire.plugin.version>3.0.0-M3</surefire.plugin.version>
17+
<java.version>17</java.version>
4418
</properties>
4519

4620
</project>

core-java-modules/core-java-13/src/test/java/com/baeldung/newfeatures/SwitchExpressionsWithYieldUnitTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
public class SwitchExpressionsWithYieldUnitTest {
88

99
@Test
10-
@SuppressWarnings("preview")
1110
public void whenSwitchingOnOperationSquareMe_thenWillReturnSquare() {
1211
var me = 4;
1312
var operation = "squareMe";

core-java-modules/core-java-13/src/test/java/com/baeldung/newfeatures/TextBlocksUnitTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ public class TextBlocksUnitTest {
88

99
private static final String JSON_STRING = "{\r\n" + "\"name\" : \"Baeldung\",\r\n" + "\"website\" : \"https://www.%s.com/\"\r\n" + "}";
1010

11-
@SuppressWarnings("preview")
1211
private static final String TEXT_BLOCK_JSON = """
1312
{
1413
"name" : "Baeldung",
@@ -25,7 +24,6 @@ public void whenTextBlocks_thenStringOperationsWork() {
2524

2625
}
2726

28-
@SuppressWarnings("removal")
2927
@Test
3028
public void whenTextBlocks_thenFormattedWorksAsFormat() {
3129
assertThat(TEXT_BLOCK_JSON.formatted("baeldung")

core-java-modules/core-java-13/src/test/java/com/baeldung/switchExpression/SwitchExpressionsUnitTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
public class SwitchExpressionsUnitTest {
1414

1515
@Test
16-
@SuppressWarnings ("preview")
1716
public void whenSwitchingOverMonthJune_thenWillReturn3() {
1817

1918
var month = JUNE;
@@ -29,7 +28,6 @@ public void whenSwitchingOverMonthJune_thenWillReturn3() {
2928
}
3029

3130
@Test
32-
@SuppressWarnings ("preview")
3331
public void whenSwitchingOverMonthAugust_thenWillReturn24() {
3432
var month = AUGUST;
3533

@@ -47,7 +45,6 @@ public void whenSwitchingOverMonthAugust_thenWillReturn24() {
4745
}
4846

4947
@Test
50-
@SuppressWarnings ("preview")
5148
public void whenSwitchingOverMonthJanuary_thenWillReturn3() {
5249

5350
Function<Month, Integer> func = (month) -> {
@@ -61,7 +58,6 @@ public void whenSwitchingOverMonthJanuary_thenWillReturn3() {
6158
}
6259

6360
@Test
64-
@SuppressWarnings ("preview")
6561
public void whenSwitchingOverMonthAugust_thenWillReturn2() {
6662
var month = AUGUST;
6763

core-java-modules/core-java-15/pom.xml

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
<packaging>jar</packaging>
99

1010
<parent>
11-
<groupId>com.baeldung</groupId>
12-
<artifactId>parent-modules</artifactId>
13-
<version>1.0.0-SNAPSHOT</version>
14-
<relativePath>../../pom.xml</relativePath>
11+
<groupId>com.baeldung.core-java-modules</groupId>
12+
<artifactId>core-java-modules</artifactId>
13+
<version>0.0.1-SNAPSHOT</version>
1514
</parent>
1615

1716
<dependencies>
@@ -27,33 +26,8 @@
2726
</dependency>
2827
</dependencies>
2928

30-
<build>
31-
<plugins>
32-
<plugin>
33-
<groupId>org.apache.maven.plugins</groupId>
34-
<artifactId>maven-compiler-plugin</artifactId>
35-
<version>${maven-compiler-plugin.version}</version>
36-
<configuration>
37-
<release>${maven.compiler.release}</release>
38-
<compilerArgs>--enable-preview</compilerArgs>
39-
<source>14</source>
40-
<target>14</target>
41-
</configuration>
42-
</plugin>
43-
<plugin>
44-
<groupId>org.apache.maven.plugins</groupId>
45-
<artifactId>maven-surefire-plugin</artifactId>
46-
<version>${surefire.plugin.version}</version>
47-
<configuration>
48-
<argLine>--enable-preview</argLine>
49-
</configuration>
50-
</plugin>
51-
</plugins>
52-
</build>
53-
5429
<properties>
55-
<maven.compiler.release>15</maven.compiler.release>
56-
<surefire.plugin.version>3.0.0-M3</surefire.plugin.version>
30+
<java.version>17</java.version>
5731
</properties>
5832

5933
</project>

core-java-modules/pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
<module>core-java-11</module>
3535
<module>core-java-11-2</module>
3636
<module>core-java-11-3</module>
37+
<module>core-java-12</module>
38+
<module>core-java-13</module>
39+
<module>core-java-15</module>
3740
<module>core-java-collections-array-list</module>
3841
<module>core-java-collections-array-list-2</module>
3942
<module>core-java-collections-list-4</module>

pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -770,10 +770,7 @@
770770

771771
<module>core-java-modules</module>
772772
<!-- <module>core-java-modules/core-java-9-new-features</module> --> <!-- uses preview features, to be decided how to handle -->
773-
<!-- <module>core-java-modules/core-java-12</module> --> <!-- uses preview features, to be decided how to handle -->
774-
<!-- <module>core-java-modules/core-java-13</module> --> <!-- uses preview features, to be decided how to handle -->
775773
<!-- <module>core-java-modules/core-java-14</module> --> <!-- uses preview features, to be decided how to handle -->
776-
<!-- <module>core-java-modules/core-java-15</module> --> <!-- uses preview features, to be decided how to handle -->
777774
<!-- <module>core-java-modules/core-java-16</module> --> <!-- uses preview features, to be decided how to handle -->
778775
<!-- <module>core-java-modules/core-java-17</module> --> <!-- uses preview features, to be decided how to handle -->
779776
<!-- <module>core-java-modules/core-java-19</module> --> <!-- uses preview features, to be decided how to handle -->
@@ -1051,10 +1048,7 @@
10511048
<module>core-java-modules</module>
10521049
<module>gcp-firebase</module>
10531050
<!-- <module>core-java-modules/core-java-9-new-features</module> --> <!-- uses preview features, to be decided how to handle -->
1054-
<!-- <module>core-java-modules/core-java-12</module> --> <!-- uses preview features, to be decided how to handle -->
1055-
<!-- <module>core-java-modules/core-java-13</module> --> <!-- uses preview features, to be decided how to handle -->
10561051
<!-- <module>core-java-modules/core-java-14</module> --> <!-- uses preview features, to be decided how to handle -->
1057-
<!-- <module>core-java-modules/core-java-15</module> --> <!-- uses preview features, to be decided how to handle -->
10581052
<!-- <module>core-java-modules/core-java-16</module> --> <!-- uses preview features, to be decided how to handle -->
10591053
<!-- <module>core-java-modules/core-java-17</module> --> <!-- uses preview features, to be decided how to handle -->
10601054
<!-- <module>core-java-modules/core-java-19</module> --> <!-- uses preview features, to be decided how to handle -->

0 commit comments

Comments
 (0)