aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/javassist
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2012-06-06 14:34:02 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2012-06-06 14:34:02 +0000
commite75c12e0964f27abb798393473913307d24efe61 (patch)
tree49a585a8a8abe9b76556b516054d9a071b367136 /src/test/javassist
parent12d5a5f3ccaec717942009a56089eaf34d4783d7 (diff)
downloadjavassist-e75c12e0964f27abb798393473913307d24efe61.tar.gz
javassist-e75c12e0964f27abb798393473913307d24efe61.zip
fixed JASSIST-166
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@633 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/test/javassist')
-rw-r--r--src/test/javassist/JvstTest4.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/javassist/JvstTest4.java b/src/test/javassist/JvstTest4.java
index f7fcd968..f7319008 100644
--- a/src/test/javassist/JvstTest4.java
+++ b/src/test/javassist/JvstTest4.java
@@ -711,4 +711,17 @@ public class JvstTest4 extends JvstTestRoot {
assertTrue(javassist.runtime.Desc.getClazz("[Ljava.lang.String;") != null);
javassist.runtime.Desc.useContextClassLoader = old;
}
+
+ public void testJIRA166() throws Exception {
+ CtClass cc = sloader.get("test4.JIRA166");
+ cc.instrument(new ExprEditor() {
+ public void edit(FieldAccess fa) throws CannotCompileException {
+ if (fa.isReader() && fa.getFieldName().equals("length"))
+ fa.replace("length = self().length + \"!\"; $_ = ($r) this.length.substring(1);");
+ }
+ });
+ cc.writeFile();
+ Object obj = make(cc.getName());
+ assertEquals(1, invoke(obj, "run"));
+ }
}