remove pattern matching in switch syntax and remove --enable-preview completely. It is too onerous for users at runtime.

This commit is contained in:
Jonathan Shook 2022-06-02 17:12:36 -05:00
parent 5aaae15592
commit 1437029eb3
2 changed files with 24 additions and 32 deletions

View File

@ -54,8 +54,8 @@ public class CQLD4PreparedStmtDiagnostics {
public static BoundStatement bindStatement(BoundStatement bound, CqlIdentifier colname, Object colval, DataType coltype) {
return switch (coltype) {
case PrimitiveType pt -> switch (pt.getProtocolCode()) {
if (coltype instanceof PrimitiveType pt) {
return switch (pt.getProtocolCode()) {
case CUSTOM -> throw new OpConfigError("Error with Custom DataType");
case ASCII, VARCHAR -> bound.setString(colname, (String) colval);
case BIGINT, COUNTER -> bound.setLong(colname, (long) colval);
@ -102,9 +102,8 @@ public class CQLD4PreparedStmtDiagnostics {
}
default -> throw new RuntimeException("Unknown CQL type for diagnostic (type:'" + coltype + "',code:'" + coltype.getProtocolCode() + "'");
};
default -> throw new IllegalStateException("Unexpected value: " + coltype);
};
}
throw new IllegalStateException("Unexpected value: " + coltype);
}

View File

@ -462,10 +462,9 @@
<source>17</source>
<release>17</release>
<compilerArgs>
--enable-preview
<!-- <compilerArg>-Xdoclint:all</compilerArg>-->
<!-- <compilerArg>-Xlint:all</compilerArg>-->
</compilerArgs>
<!--<compilerArgument>-Xdoclint:all</compilerArgument>-->
<!-- <compilerArgument>-Xlint:all</compilerArgument>-->
</configuration>
</plugin>
@ -474,9 +473,6 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M6</version>
<configuration>
<argLine>--enable-preview</argLine>
<!-- <argLine>&#45;&#45;enable-preview</argLine>-->
<excludes>
<exclude>**/*Integrated*Test*.java</exclude>
<exclude>**/*IntegrationTest.java</exclude>
@ -505,8 +501,6 @@
</execution>
</executions>
<configuration>
<argLine>--enable-preview</argLine>
<!-- <argLine>&#45;&#45;enable-preview</argLine>-->
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
<includes>
@ -537,9 +531,8 @@
<!-- <additionalparam>-Xdoclint:none</additionalparam>-->
<additionalOptions>
<additionalOption>-Xdoclint:none</additionalOption>
<additionalOption>--enable-preview</additionalOption>
</additionalOptions>
<!-- <additionalJOption>-Xdoclint:none &#45;&#45;enable-preview</additionalJOption>-->
<!-- <additionalJOption>-Xdoclint:none</additionalJOption>-->
<doclint>none</doclint>
</configuration>
<executions>