4 ms·
>it has left the “move fast and break things java never had that phase. If anything it had a full binary class (not even source, e.g. long and int are not comp
by xxs 2mo ago
>it has left the “move fast and break things
java never had that phase. If anything it had a full binary class (not even source, e.g. long and int are not compatible on binary level) compatibility. Generally you can take an application from '98 and run it nowadays.
It's only recent changes (jigsaw in java9 mostly) that were made them to drop some of that part.
- inigyou 2mo ago> (not even source, e.g. long and int are not compatible on binary level) What did you mean by this?
- xxs 2mo agoif you have a method "void x(int i)", and change it to "void x(long i)", it will cause NoSuchMethodError if the code is not recompiled, i.e. if it's a dependency on a jar file. Likewise when there were methods in URLConnection that returned (or take) int for content-length, it would not be possible to convert them to long by just changing the existing signatures. The same applies to having a method "void x(String s)", it cannot be changed to "void x(Object s)" (even though all the code would compile with auto downcast) but both methods have to co-exist being overloaded. There is more to the binary compatibility but I'd leave it here. The way to do it is keeping the existing public (and protected) methods (&fields), possibly deprecating them, along with introducing new ones. Effectively any removal of anything that has been made accessible, public mostly, is forbidden. Personally, whenever I had to maintain library code I stuck to the same principle, so folks could grab a new version w/o worrying or doing any changes on their own.