When I read Java Language Specification (JLS8) > Binary Compatibility, one of a set changes that doesn't break binary compatibility is:
Changing methods or constructors to return values on inputs for which they previously either threw exceptions that normally should not occur or failed by going into an infinite loop or causing a deadlock
I don't understand this idea.
Please help clarify and give an example to demonstrate it.
Existing code:
Example of a compatible change that satisfies above rule:
Example of an incompatible change:
Before:
Example of a compatible change that satisfies above rule:
I think you get the picture.
The practical meaning of the statements is:
It's a fancy way of saying something that make a lot of common sense.