summaryrefslogtreecommitdiffstats
path: root/src/main/javassist
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2003-07-11 06:24:57 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2003-07-11 06:24:57 +0000
commitf6c16db268e47c2202f6098f4fae5a4537238857 (patch)
tree016cd632c56ad01120f54dd7052bfa31d54a2ada /src/main/javassist
parentabef4b9fb6d0490c8a8f41d976133239228f679e (diff)
downloadjavassist-f6c16db268e47c2202f6098f4fae5a4537238857.tar.gz
javassist-f6c16db268e47c2202f6098f4fae5a4537238857.zip
added ClassPool#removeCached so that subclasses of ClassPool can do
their own caching. A bug in CtClassType#setName was fixed. git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@29 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main/javassist')
-rw-r--r--src/main/javassist/ClassPool.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main/javassist/ClassPool.java b/src/main/javassist/ClassPool.java
index 61314777..509cf8d8 100644
--- a/src/main/javassist/ClassPool.java
+++ b/src/main/javassist/ClassPool.java
@@ -86,12 +86,25 @@ public class ClassPool {
/**
* Provide a hook so that subclasses can do their own
* caching of classes
+ *
+ * @see #removeCached(String)
*/
protected CtClass getCached(String classname)
{
return (CtClass)classes.get(classname);
}
+ /**
+ * Provide a hook so that subclasses can do their own
+ * caching of classes
+ *
+ * @see #getCached(String)
+ */
+ protected void removeCached(String classname)
+ {
+ classes.remove(classname);
+ }
+
/**
* Creates a class pool.
*
@@ -480,7 +493,7 @@ public class ClassPool {
synchronized void classNameChanged(String oldname, CtClass clazz) {
CtClass c = (CtClass)getCached(oldname);
if (c == clazz) // must check this equation
- classes.remove(c);
+ removeCached(oldname);
String newName = clazz.getName();
checkNotFrozen(newName, "the class with the new name is frozen.");