diff --git a/muyu-rule-server/src/main/java/com/muyu/rule/load/JavaBinaryClassLoader.java b/muyu-rule-server/src/main/java/com/muyu/rule/load/JavaBinaryClassLoader.java index 188a045..6351101 100644 --- a/muyu-rule-server/src/main/java/com/muyu/rule/load/JavaBinaryClassLoader.java +++ b/muyu-rule-server/src/main/java/com/muyu/rule/load/JavaBinaryClassLoader.java @@ -1,16 +1,16 @@ package com.muyu.rule.load; - import com.muyu.rule.scan.JavaCodeScan; -import io.jsonwebtoken.io.IOException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.FileNotFoundException; +import java.io.IOException; import java.nio.file.Files; import java.util.HashMap; import java.util.Map; + /** * @ClassName Java java字节码加载器 * @Description 加载 @@ -80,18 +80,10 @@ public class JavaBinaryClassLoader extends ClassLoader { public byte[] loadClassData(String name, File location)throws IOException { File classFile = new File(location, name + ".class"); if (!classFile.exists()) { - try { - throw new FileNotFoundException("找不到类文件: " + classFile.getAbsolutePath()); - } catch (FileNotFoundException e) { - throw new RuntimeException(e); - } - } - //FileNotFoundException - try { - return Files.readAllBytes(classFile.toPath()); - } catch (java.io.IOException e) { - throw new RuntimeException(e); + throw new FileNotFoundException("找不到类文件: " + classFile.getAbsolutePath()); + } + return Files.readAllBytes(classFile.toPath()); } } diff --git a/muyu-rule-server/src/main/java/com/muyu/rule/service/impl/RuleEditionServiceImpl.java b/muyu-rule-server/src/main/java/com/muyu/rule/service/impl/RuleEditionServiceImpl.java index 603e5f0..c2818ea 100644 --- a/muyu-rule-server/src/main/java/com/muyu/rule/service/impl/RuleEditionServiceImpl.java +++ b/muyu-rule-server/src/main/java/com/muyu/rule/service/impl/RuleEditionServiceImpl.java @@ -25,7 +25,8 @@ import rule.domain.RuleEdition; public class RuleEditionServiceImpl extends ServiceImpl implements RuleEditionService { @Autowired private RuleServiceImpl ruleServiceImpl; - +// @Autowired +// private RuleService ruleService;; /** * 禁用规则版本 @@ -61,7 +62,8 @@ public class RuleEditionServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); // queryWrapper.eq(RuleEdition::getRuleKind, ruleEdition.getRuleKind()); -// long count = ruleEditionServiceImpl.count(queryWrapper); +// +// long count = ruleService.count(queryWrapper); // if (count > 0) { // throw new ServiceException("版本类名称重复"); // }