Package gw.internal.gosu.parser
Class ClassCache
java.lang.Object
gw.internal.gosu.parser.ClassCache
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
A non-instantiable marker class to help us store misses in this typeloader -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate LockingLazyVar<Set<String>>
private AsmClassLoader
private LockingLazyVar<ClassPath>
private IModule
private Set<CharSequence>
private boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addFoundPackages
(Class<?> aClass) boolean
classFileExists
(String className) void
void
dispose()
getTypeNames
(String namespace) boolean
hasNamespace
(String namespace) private boolean
isPackage
(StringBuilder s, int i) Short-circuit the case where com.foo.Fred is not a class name, but com.foo is a package.loadAsmClass
(String className) private Class
loadClassImplImpl
(String type) private static String
normalizeArrayNotation
(String type) Normalizes a class name string to the appropriate java class name.void
Called in Single module mode.void
private Class
tryToLoadClass
(CharSequence name)
-
Field Details
-
_classMap
-
_packages
-
_module
-
_classPathCache
-
_allTypeNamesCache
-
_asmClassLoader
-
ignoreTheCache
private boolean ignoreTheCache
-
-
Constructor Details
-
ClassCache
-
-
Method Details
-
tryToLoadClass
-
addFoundPackages
-
classFileExists
-
loadAsmClass
-
loadClass
-
isPackage
Short-circuit the case where com.foo.Fred is not a class name, but com.foo is a package. Avoid the expensive test for com.foo$Fred as an inner class (and then com$foo$Fred).Yes, java supports a package and a class having the same name, but in this case we are checking for an inner class of a class having the same name as a package... Let's just not support references to those in Gosu in the name of both sanity and performance.
Warning this design decision was not vetted through various committees, architect round tables, community processes, or guys with beards.
-
loadClassImplImpl
-
normalizeArrayNotation
Normalizes a class name string to the appropriate java class name. For example: java.lang.String -> java.lang.String java.lang.String[] -> [Ljava.lang.String; java.lang.String[][] -> [[Ljava.lang.String;- Parameters:
type
- Name of type- Returns:
- ormalizes a class name string to the appropriate java class name
-
getAllTypeNames
-
clearClasspathInfo
public void clearClasspathInfo() -
remove
-
dispose
public void dispose() -
reassignClassLoader
public void reassignClassLoader()Called in Single module mode. If the parent loader of the ModuleClassLoader is the GosuPluginContainer, we drop the ModuleClassLoader and its parent, the GosuPluginContainer. New ones are created and assigned here. Note, this is a giant hack among many gianter hacks that keep the old test framework floating. -
hasNamespace
-
getTypeNames
-