diff options
author | Shigeru Chiba <chibash@users.noreply.github.com> | 2023-12-10 00:47:26 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-10 00:47:26 +0900 |
commit | 310fb8fe71b1d6950ac35219358dda6ffcacc69f (patch) | |
tree | 0ce0674728ec2a0b4a2c1d35d33dfa81a5cea3cc /src/test/javassist/SuperCallCase.java | |
parent | 158294371e39b24f003f15933bd74f2b26bbf3aa (diff) | |
parent | c04c375e813597eaeb305a641f58a89fe665ea54 (diff) | |
download | javassist-310fb8fe71b1d6950ac35219358dda6ffcacc69f.tar.gz javassist-310fb8fe71b1d6950ac35219358dda6ffcacc69f.zip |
Merge pull request #466 from shifujun/pr-fix-lookupMethod
Fix MemberResolver.lookupMethod bug when super class has more preciseā¦
Diffstat (limited to 'src/test/javassist/SuperCallCase.java')
-rw-r--r-- | src/test/javassist/SuperCallCase.java | 38 |
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()); + } +} |