Skip to content

Commit

Permalink
Merge branch '6.2' into 7.0
Browse files Browse the repository at this point in the history
# Conflicts:
#	loader/build.xml
#	loader/pom.xml
  • Loading branch information
michaeloffner committed Dec 10, 2024
2 parents 448e3b6 + ed47cae commit 0dfdde7
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public class ClazzDynamic extends Clazz {
private static Map<ClassLoader, String> clids = new IdentityHashMap<>();
private static String systemId;

private static Map<String, SoftReference<ClazzDynamic>> classes = new ConcurrentHashMap<>();
private static Map<Class, SoftReference<ClazzDynamic>> classes = new IdentityHashMap<>();
// private static Map<String, SoftReference<ClazzDynamic>> classes = new ConcurrentHashMap<>();

/*
* private static double generateClassLoderId = 0; private static double path = 0; private static
Expand All @@ -77,13 +78,12 @@ public static ClazzDynamic getInstance(Class clazz, Resource dir, Log log) throw
*/

ClazzDynamic cd = null;
String id = generateClassLoderId(clazz);
String key = id + ":" + clazz.getName();
Reference<ClazzDynamic> sr = classes.get(key);
Reference<ClazzDynamic> sr = classes.get(clazz);
if (sr == null || (cd = sr.get()) == null) {
synchronized (clazz) {
sr = classes.get(key);
sr = classes.get(clazz);
if (sr == null || (cd = sr.get()) == null) {
String id = generateClassLoderId(clazz);
// generateClassLoderId += (SystemUtil.millis() - start);
// start = SystemUtil.millis();
StringBuilder sbClassPath = new StringBuilder();
Expand All @@ -102,7 +102,7 @@ public static ClazzDynamic getInstance(Class clazz, Resource dir, Log log) throw
// deserialize += (SystemUtil.millis() - start);
// start = SystemUtil.millis();
if (log != null) log.info("dynamic", "loaded metadata for [" + clazz.getName() + "] from serialized file:" + ser);
classes.put(key, new SoftReference<ClazzDynamic>(cd));
classes.put(clazz, new SoftReference<ClazzDynamic>(cd));
// put += (SystemUtil.millis() - start);
// start = SystemUtil.millis();
}
Expand Down

0 comments on commit 0dfdde7

Please sign in to comment.