// new method
protected String constructScalar(ScalarNode node) {
return node.getValue();
}
// old method
protected Object constructScalar(ScalarNode node) {
return node.getValue();
}
in an old program, the return value type in the old method, signature is Object, and the class in the dependent library is new. Only when new method, is called, the program call will report java.lang.NoSuchMethodError
. How to insert both the new and old methods into it, so that the old program can be called correctly.