aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/javassist/SuperCallCase.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/javassist/SuperCallCase.java')
-rw-r--r--src/test/javassist/SuperCallCase.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/test/javassist/SuperCallCase.java b/src/test/javassist/SuperCallCase.java
new file mode 100644
index 00000000..8d5ea9e7
--- /dev/null
+++ b/src/test/javassist/SuperCallCase.java
@@ -0,0 +1,38 @@
+package javassist;
+
+class Animal {
+}
+
+class Bear extends Animal {
+}
+
+
+/**
+ * Base class has a method with precise type.
+ */
+class Man {
+ String feed(Bear bear) {
+ return "Man feed(Bear)";
+ }
+}
+
+/**
+ * Derived class has a method which has same name with base class's and more imprecise type.
+ */
+class Keeper extends Man {
+ String feed(Animal animal) {
+ return "Keeper feed(Animal)";
+ }
+}
+
+/**
+ * Derived class has a method which call super method with precise type.
+ */
+class BearKeeper extends Keeper {
+ public BearKeeper() {
+ }
+
+ String javacResult() {
+ return super.feed(new Bear());
+ }
+}