1
mirror of https://github.com/CarmJos/EasySQL.git synced 2024-09-19 21:35:47 +00:00

[v0.3.1] 修复一些小的规范问题

This commit is contained in:
Carm Jos 2022-01-26 15:00:05 +08:00
parent 36a23af450
commit ba4731c331
3 changed files with 6 additions and 4 deletions

View File

@ -28,7 +28,7 @@ public enum ForeignKeyRule {
*/
CASCADE("CASCADE");
String ruleName;
final String ruleName;
ForeignKeyRule(String ruleName) {
this.ruleName = ruleName;

View File

@ -29,7 +29,7 @@ public enum IndexType {
FULLTEXT_INDEX("FULLTEXT");
String name;
final String name;
IndexType(String name) {
this.name = name;

View File

@ -9,12 +9,14 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;
import java.lang.reflect.InvocationTargetException;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Scanner;
import java.util.Set;
@TestOnly
@SuppressWarnings("all")
public class Main {
public static void main(String[] args) {
@ -85,8 +87,8 @@ public class Main {
public static @Nullable EasySQLTest cast(@NotNull Class<?> value) {
if (!EasySQLTest.class.isAssignableFrom(value)) return null;
try {
return (EasySQLTest) value.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
return (EasySQLTest) value.getDeclaredConstructor().newInstance();
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
return null;
}