diff --git a/mybatis-flex-annotation/src/main/java/com/mybatisflex/processer/QueryEntityProcesser.java b/mybatis-flex-annotation/src/main/java/com/mybatisflex/processer/QueryEntityProcessor.java similarity index 99% rename from mybatis-flex-annotation/src/main/java/com/mybatisflex/processer/QueryEntityProcesser.java rename to mybatis-flex-annotation/src/main/java/com/mybatisflex/processer/QueryEntityProcessor.java index 7179e460..e5127182 100644 --- a/mybatis-flex-annotation/src/main/java/com/mybatisflex/processer/QueryEntityProcesser.java +++ b/mybatis-flex-annotation/src/main/java/com/mybatisflex/processer/QueryEntityProcessor.java @@ -40,7 +40,7 @@ import java.util.*; import java.util.function.BiConsumer; import java.util.function.Consumer; -public class QueryEntityProcesser extends AbstractProcessor { +public class QueryEntityProcessor extends AbstractProcessor { private static final List defaultSupportColumnTypes = Arrays.asList( int.class.getName(), Integer.class.getName(), @@ -339,7 +339,7 @@ public class QueryEntityProcesser extends AbstractProcessor { if (writer != null) { try { writer.close(); - } catch (IOException e) { + } catch (IOException ignored) { } } } @@ -409,7 +409,7 @@ public class QueryEntityProcesser extends AbstractProcessor { if (writer != null) { try { writer.close(); - } catch (IOException e) { + } catch (IOException ignored) { } } } diff --git a/mybatis-flex-annotation/src/main/resources/META-INF/services/javax.annotation.processing.Processor b/mybatis-flex-annotation/src/main/resources/META-INF/services/javax.annotation.processing.Processor index 27352fa0..1ba3560b 100644 --- a/mybatis-flex-annotation/src/main/resources/META-INF/services/javax.annotation.processing.Processor +++ b/mybatis-flex-annotation/src/main/resources/META-INF/services/javax.annotation.processing.Processor @@ -1 +1 @@ -com.mybatisflex.processer.QueryEntityProcesser \ No newline at end of file +com.mybatisflex.processer.QueryEntityProcessor \ No newline at end of file diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/BaseMapper.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/BaseMapper.java index ede1975e..bfc3d88f 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/BaseMapper.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/BaseMapper.java @@ -201,11 +201,7 @@ public interface BaseMapper { */ default T selectOneByQuery(@Param(FlexConsts.QUERY) QueryWrapper queryWrapper) { List entities = selectListByQuery(queryWrapper.limit(1)); - if (entities == null || entities.isEmpty()) { - return null; - } else { - return entities.get(0); - } + return (entities == null || entities.isEmpty()) ? null : entities.get(0); } /** diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/MybatisFlexBootstrap.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/MybatisFlexBootstrap.java index bdba6a67..122479f2 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/MybatisFlexBootstrap.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/MybatisFlexBootstrap.java @@ -65,7 +65,7 @@ public class MybatisFlexBootstrap { protected SqlSessionFactory sqlSessionFactory; protected Class logImpl; - private Map, Object> mapperObjects = new ConcurrentHashMap<>(); + private final Map, Object> mapperObjects = new ConcurrentHashMap<>(); /** * 虽然提供了 getInstance,但也允许用户进行实例化,