Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.7, 2.1.9, 2.2.0-rc-3
-
None
-
None
Description
When extending java.lang.BigInteger, using an obj of that child class as argument to a method with BigInteger parameter causes a MissingMethodException. Similar variations with BigDecimal or Number work fine.
Sample:
public class MyDecimal extends java.math.BigDecimal { public MyDecimal(String s) {super(s);} } public class MyInteger extends java.math.BigInteger { public MyInteger(String s) {super(s);} } class Expression { public int takeNumber(Number a) {return 1;} public int takeBigDecimal(BigDecimal a) {return 2;} public int takeBigInteger(BigInteger a) {return 3;} } Expression exp = new Expression(); assert 1 == exp.takeNumber(new MyInteger("3")); //works fine: 1 assert 2 == exp.takeBigDecimal(new MyDecimal("3.0")); //works fine: 2 assert 3 == exp.takeBigInteger(new MyInteger("3")); //MissingMethodException