Browse Source

fixed JASSIST-188

tags/log
chibash 11 years ago
parent
commit
f81b1ae4ed

+ 1
- 1
Readme.html View File

@@ -285,7 +285,7 @@ see javassist.Dump.
<ul>
<li>The source code repository has been moved to <a href="https://github.com/jboss-javassist/javassist">GitHub</a></li>.

<li>JIRA JASSIST-181, 183, 184, 189, 162, 185, 186, 190, 199.
<li>JIRA JASSIST-181, 183, 184, 189, 162, 185, 186, 188, 190, 195, 199, 201.
</ul>

<p>-version 3.17.1 on December 3, 2012

+ 1
- 1
src/main/javassist/ClassPool.java View File

@@ -936,7 +936,7 @@ public class ClassPool {
/**
* Detatches the <code>ClassPath</code> object from the search path.
* The detached <code>ClassPath</code> object cannot be added
* to the pathagain.
* to the path again.
*/
public void removeClassPath(ClassPath cp) {
source.removeClassPath(cp);

+ 5
- 2
src/main/javassist/compiler/MemberResolver.java View File

@@ -399,7 +399,10 @@ public class MemberResolver implements TokenId {
if (found == INVALID)
throw new CompileError("no such class: " + name);
else if (found != null)
return (CtClass)found;
try {
return classPool.get((String)found);
}
catch (NotFoundException e) {}

CtClass cc = null;
try {
@@ -409,7 +412,7 @@ public class MemberResolver implements TokenId {
cc = searchImports(name);
}

cache.put(name, cc);
cache.put(name, cc.getName());
return cc;
}


+ 20
- 0
src/test/javassist/JvstTest4.java View File

@@ -875,4 +875,24 @@ public class JvstTest4 extends JvstTestRoot {
Object obj = make(cc.getName());
assertEquals(4, invoke(obj, "run"));
}

public void testJIRA188() throws Exception {
CtClass cc = sloader.makeClass("test4.JIRA188");
CtField f = new CtField(CtClass.intType, "f", cc);
f.setModifiers(Modifier.PRIVATE);
cc.addField(f);
cc.addMethod(CtNewMethod.make(
"public int getf(test4.JIRA188 p){ return p.f; }", cc));
cc.detach();
// System.gc();
try {
cc = sloader.get("test4.JIRA188");
fail("test4.JIRA188 found");
}
catch (NotFoundException e) {}
cc = sloader.makeClass("test4.JIRA188");
cc.addField(new CtField(CtClass.intType, "g", cc));
cc.addMethod(CtNewMethod.make(
"public int getf(test4.JIRA188 p){ return p.g; }", cc));
}
}

Loading…
Cancel
Save