aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchibash <chiba@javassist.org>2018-09-02 23:50:56 +0900
committerchibash <chiba@javassist.org>2018-09-02 23:50:56 +0900
commit9ca1a7539c2967d00d1b81328b4d0bd13c51d2ac (patch)
tree841cec2382944355223b1604f30b31127cce4bde
parentc52b9c7100412288eecf2ed098c63a0ba1643000 (diff)
downloadjavassist-9ca1a7539c2967d00d1b81328b4d0bd13c51d2ac.tar.gz
javassist-9ca1a7539c2967d00d1b81328b4d0bd13c51d2ac.zip
adds test cases for NestHostAttribute and NestMembersAttribute.
-rw-r--r--build.xml8
-rw-r--r--javassist.jarbin763786 -> 763837 bytes
-rw-r--r--src/test/javassist/JvstTest5.java13
-rw-r--r--src/test/test5/NestHost.java11
-rw-r--r--src/test/test5/NestHost2.java11
5 files changed, 39 insertions, 4 deletions
diff --git a/build.xml b/build.xml
index 365aa604..ec805b0f 100644
--- a/build.xml
+++ b/build.xml
@@ -74,13 +74,13 @@
</javac>
</target>
- <target name="compile16" depends="prepare">
+ <target name="compile18" depends="prepare">
<javac srcdir="${src.dir}"
destdir="${build.classes.dir}"
debug="on"
deprecation="on"
- source="1.6"
- target="1.6"
+ source="1.8"
+ target="1.8"
optimize="off"
includeantruntime="true"
includes="**">
@@ -181,7 +181,7 @@
to ${build.classes.dir}.</echo>
</target>
- <target name="jar" depends="compile16">
+ <target name="jar" depends="compile18">
<jar jarfile="${target.jar}" update="true" manifest="${src.dir}/META-INF/MANIFEST.MF">
<fileset dir="${build.classes.dir}">
<include name="**/*.class"/>
diff --git a/javassist.jar b/javassist.jar
index 4ff2cc13..4c72e547 100644
--- a/javassist.jar
+++ b/javassist.jar
Binary files differ
diff --git a/src/test/javassist/JvstTest5.java b/src/test/javassist/JvstTest5.java
index b0cbbcca..ec8ff66a 100644
--- a/src/test/javassist/JvstTest5.java
+++ b/src/test/javassist/JvstTest5.java
@@ -440,4 +440,17 @@ public class JvstTest5 extends JvstTestRoot {
assertTrue(names[0].equals("test5.NestHost$Foo") || names[0].equals("test5.NestHost$Bar"));
assertTrue(names[1].equals("test5.NestHost$Foo") || names[1].equals("test5.NestHost$Bar"));
}
+
+ public void testNestMembersAttributeCopy() throws Exception {
+ CtClass cc = sloader.get("test5.NestHost2");
+ cc.getClassFile().compact();
+ cc.writeFile();
+ make(cc.getName());
+ }
+
+ public void testNestHostAttributeCopy() throws Exception {
+ CtClass cc = sloader.get("test5.NestHost2$Foo");
+ cc.getClassFile().compact();
+ cc.toClass();
+ }
}
diff --git a/src/test/test5/NestHost.java b/src/test/test5/NestHost.java
new file mode 100644
index 00000000..045d9d30
--- /dev/null
+++ b/src/test/test5/NestHost.java
@@ -0,0 +1,11 @@
+package test5;
+
+public class NestHost {
+ private int value;
+ public class Foo {
+ int foo() { return value++; }
+ }
+ public class Bar {
+ int bar() { return value++; }
+ }
+}
diff --git a/src/test/test5/NestHost2.java b/src/test/test5/NestHost2.java
new file mode 100644
index 00000000..571059be
--- /dev/null
+++ b/src/test/test5/NestHost2.java
@@ -0,0 +1,11 @@
+package test5;
+
+public class NestHost2 {
+ private int value;
+ public class Foo {
+ int foo() { return value++; }
+ }
+ public class Bar {
+ int bar() { return value++; }
+ }
+}