|
|
|
@ -2,6 +2,7 @@ package com.fr.env.detect.impl.converter;
|
|
|
|
|
|
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
import com.fr.env.detect.base.DetectorConstants; |
|
|
|
|
import com.fr.env.detect.base.DetectorUtil; |
|
|
|
|
import com.fr.env.detect.bean.DetectorResult; |
|
|
|
|
import com.fr.env.detect.bean.DetectorType; |
|
|
|
|
import com.fr.env.detect.bean.ExceptionLog; |
|
|
|
@ -9,7 +10,6 @@ import com.fr.env.detect.bean.ExceptionSolution;
|
|
|
|
|
import com.fr.env.detect.bean.ExceptionTips; |
|
|
|
|
import com.fr.env.detect.thowable.ThrowableConverter; |
|
|
|
|
import com.fr.stable.resource.ResourceLoader; |
|
|
|
|
import com.fr.third.org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
|
|
|
|
|
|
import javax.el.MethodNotFoundException; |
|
|
|
@ -83,6 +83,10 @@ public class ClassConflictConvertor implements ThrowableConverter {
|
|
|
|
|
sign = sign.getCause(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Map<String, List<String>> libMap = new HashMap<>(); |
|
|
|
|
libMap.put(DetectorConstants.FR_HOME_LIB, new ArrayList<>()); |
|
|
|
|
libMap.put(DetectorConstants.WEB_LIB_PATH, new ArrayList<>()); |
|
|
|
|
|
|
|
|
|
Set<String> allPath = new HashSet<>(); |
|
|
|
|
for (String className : classNames) { |
|
|
|
|
String classFile = convertClass2Path(className); |
|
|
|
@ -98,12 +102,14 @@ public class ClassConflictConvertor implements ThrowableConverter {
|
|
|
|
|
Matcher matcher = JAR_NAME_PATTERN.matcher(url.getFile()); |
|
|
|
|
if (matcher.find()) { |
|
|
|
|
String jar = matcher.group(); |
|
|
|
|
allPath.add(jar); |
|
|
|
|
} else { |
|
|
|
|
boolean containsClasses = file.contains(CLASSES); |
|
|
|
|
if (containsClasses) { |
|
|
|
|
allPath.add(CLASSES); |
|
|
|
|
List<String> libPath = null; |
|
|
|
|
if (file.contains("WEB-INF")) { |
|
|
|
|
libPath = libMap.get(DetectorConstants.WEB_LIB_PATH); |
|
|
|
|
} else { |
|
|
|
|
libPath = libMap.get(DetectorConstants.FR_HOME_LIB); |
|
|
|
|
} |
|
|
|
|
libPath.add(jar); |
|
|
|
|
allPath.add(jar); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} catch (IOException ignore) { |
|
|
|
@ -115,7 +121,7 @@ public class ClassConflictConvertor implements ThrowableConverter {
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String msg = StringUtils.join(allPath, SEPARATOR); |
|
|
|
|
String msg = DetectorUtil.concatLibFormatMsg(libMap); |
|
|
|
|
|
|
|
|
|
DetectorType type = DetectorType.JAR_CONFLICT; |
|
|
|
|
return DetectorResult.exception(type, |
|
|
|
|