Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
lvjing2 committed Dec 29, 2023
1 parent 839440a commit d15217e
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public Class<?> preFindClass(String name, ClassLoaderService classLoaderService,
@Override
public Class<?> postFindClass(String name, ClassLoaderService classLoaderService, Biz biz)
throws ClassNotFoundException {
ClassLoader bizClassLoader = ArkClient.getMasterBiz().getBizClassLoader();
if (biz == null || (biz.getBizClassLoader() == bizClassLoader)) {
ClassLoader masterClassLoader = ArkClient.getMasterBiz().getBizClassLoader();
if (biz == null || (biz.getBizClassLoader() == masterClassLoader)) {
return null;
}
// The cglib proxy class cannot be delegate to the master, it must be created by the biz's own defineClass
Expand All @@ -60,15 +60,15 @@ public Class<?> postFindClass(String name, ClassLoaderService classLoaderService
return null;
}
// if Master Biz contains same class in multi jar, need to check each whether is provided
Class<?> clazz = bizClassLoader.loadClass(name);
Class<?> clazz = masterClassLoader.loadClass(name);
if (clazz != null) {
if (biz.isDeclared(clazz.getProtectionDomain().getCodeSource().getLocation(), "")) {
return clazz;
}

try {
String classResourceName = name.replace('.', '/') + ".class";
Enumeration<URL> urls = bizClassLoader.getResources(classResourceName);
Enumeration<URL> urls = masterClassLoader.getResources(classResourceName);
while (urls.hasMoreElements()) {
URL resourceUrl = urls.nextElement();
if (resourceUrl != null && biz.isDeclared(resourceUrl, classResourceName)) {
Expand Down Expand Up @@ -97,12 +97,12 @@ public URL postFindResource(String name, ClassLoaderService classLoaderService,
return null;
}

ClassLoader bizClassLoader = ArkClient.getMasterBiz().getBizClassLoader();
if (biz.getBizClassLoader() == bizClassLoader) {
ClassLoader masterClassLoader = ArkClient.getMasterBiz().getBizClassLoader();
if (biz.getBizClassLoader() == masterClassLoader) {
return null;
}
try {
URL resourceUrl = bizClassLoader.getResource(name);
URL resourceUrl = masterClassLoader.getResource(name);
if (resourceUrl != null && biz.isDeclared(resourceUrl, name)) {
return resourceUrl;
}
Expand All @@ -124,12 +124,12 @@ public Enumeration<URL> postFindResources(String name, ClassLoaderService classL
if (biz == null || (!biz.isDeclaredMode() && shouldSkip(name))) {
return null;
}
ClassLoader bizClassLoader = ArkClient.getMasterBiz().getBizClassLoader();
if (biz.getBizClassLoader() == bizClassLoader) {
ClassLoader masterClassLoader = ArkClient.getMasterBiz().getBizClassLoader();
if (biz.getBizClassLoader() == masterClassLoader) {
return null;
}
try {
Enumeration<URL> resourceUrls = bizClassLoader.getResources(name);
Enumeration<URL> resourceUrls = masterClassLoader.getResources(name);
List<URL> matchedResourceUrls = new ArrayList<>();
while (resourceUrls.hasMoreElements()) {
URL resourceUrl = resourceUrls.nextElement();
Expand Down

0 comments on commit d15217e

Please sign in to comment.