|
|
@ -26,27 +26,18 @@ class ClassPath( |
|
|
|
return classes |
|
|
|
return classes |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
operator fun get(name: String): ClassMetadata { |
|
|
|
operator fun get(name: String): ClassMetadata = cache.computeIfAbsent(name) { |
|
|
|
var metadata = cache[name] |
|
|
|
|
|
|
|
if (metadata != null) { |
|
|
|
|
|
|
|
return metadata |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (library in libraries) { |
|
|
|
for (library in libraries) { |
|
|
|
val clazz = library[name] |
|
|
|
val clazz = library[name] |
|
|
|
if (clazz != null) { |
|
|
|
if (clazz != null) { |
|
|
|
metadata = AsmClassMetadata(this, clazz, false) |
|
|
|
return@computeIfAbsent AsmClassMetadata(this, clazz, false) |
|
|
|
cache[name] = metadata |
|
|
|
|
|
|
|
return metadata |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (library in dependencies) { |
|
|
|
for (library in dependencies) { |
|
|
|
val clazz = library[name] |
|
|
|
val clazz = library[name] |
|
|
|
if (clazz != null) { |
|
|
|
if (clazz != null) { |
|
|
|
metadata = AsmClassMetadata(this, clazz, true) |
|
|
|
return@computeIfAbsent AsmClassMetadata(this, clazz, true) |
|
|
|
cache[name] = metadata |
|
|
|
|
|
|
|
return metadata |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -58,9 +49,7 @@ class ClassPath( |
|
|
|
throw IllegalArgumentException("Unknown class $name") |
|
|
|
throw IllegalArgumentException("Unknown class $name") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
metadata = ReflectionClassMetadata(this, clazz) |
|
|
|
return@computeIfAbsent ReflectionClassMetadata(this, clazz) |
|
|
|
cache[name] = metadata |
|
|
|
|
|
|
|
return metadata |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun getNode(name: String): ClassNode? { |
|
|
|
fun getNode(name: String): ClassNode? { |
|
|
|