diff options
Diffstat (limited to 'src/test/java/cristophe2')
-rw-r--r-- | src/test/java/cristophe2/MethodRemovingClass.oj | 20 | ||||
-rw-r--r-- | src/test/java/cristophe2/Test.oj | 21 |
2 files changed, 41 insertions, 0 deletions
diff --git a/src/test/java/cristophe2/MethodRemovingClass.oj b/src/test/java/cristophe2/MethodRemovingClass.oj new file mode 100644 index 0000000..2041dec --- /dev/null +++ b/src/test/java/cristophe2/MethodRemovingClass.oj @@ -0,0 +1,20 @@ +package cristophe2; + +import io.devnulllabs.openjava.mop.*; +import io.devnulllabs.openjava.ptree.*; + +public class MethodRemovingClass instantiates Metaclass extends OJClass { + public ClassDeclaration translateDefinition( + Environment env, + ClassDeclaration decl) + throws MOPException { + OJMethod[] m = getDeclaredMethods(); + + if (m.length >= 1) { + System.out.println("Removing " + m[0].signature()); + removeMethod(m[0]); + } + + return decl; + } +} diff --git a/src/test/java/cristophe2/Test.oj b/src/test/java/cristophe2/Test.oj new file mode 100644 index 0000000..80ea445 --- /dev/null +++ b/src/test/java/cristophe2/Test.oj @@ -0,0 +1,21 @@ +pacakge cristophe2; + +public class Test instantiates MethodRemovingClass { + public void f() { + } + + public String g(String s, int i) { + return null; + } + +} + +class Test2 instantiates MethodRemovingClass { + public String g(String s, int i) { + return null; + } + + public void f() { + } + +} |