Well...it depends on the policy Netbeans community uses towards backward compatibility like: - we never break the API (I suspect it is only done for most critical stuff) - we always break the API (like Windows and Linux breaking drives with every release); - we sometimes break the API (like Java deprecating stuff and then removing it 20 years later); - anything else ????
What policy Netbeans community uses? On Sun, May 1, 2022 at 12:34 AM Jaroslav Tulach <[email protected]> wrote: > The `wrapStringToArray` method is part of the module API > https://github.com/apache/netbeans/blob/master/platform/openide.util/ > nbproject/org-openide-util.sig#L525 > <https://github.com/apache/netbeans/blob/master/platform/openide.util/nbproject/org-openide-util.sig#L525> > as such anyone using NetBeans Platform may use it. > > The Practical Design Book tries to argue that APIs are like stars - http:// > wiki.apidesign.org/wiki/Star - you cannot know "who's watching". A star > cannot > "just disappear". A method in an API cannot be "just refactored". Not even > when it seems unused. > > -jt > > > Dne sobota 30. dubna 2022 1:38:16 CEST, Łukasz Bownik napsal(a): > > I was supplementing and refactoring unit tests for > > /platform/openide.util/src/org/openide/util/BaseUtilities.java > > < > https://github.com/apache/netbeans/blob/master/platform/openide.util/src/or > > g/openide/util/BaseUtilities.java> > > > > > > and I found a “*wrapStringToArray > > < > https://github.com/apache/netbeans/blob/71f182d6f160bcb3879c38c1f9f9a4925f1 > > > 8074f/platform/openide.util/src/org/openide/util/BaseUtilities.java#L306>*” > > method which is only used in platform\openide.util.ui\src\ > > < > https://github.com/apache/netbeans/blob/master/platform/openide.util.ui/src > > /org/openide/util/Utilities.java> org\openide\util\Utilities. > > < > https://github.com/apache/netbeans/blob/master/platform/openide.util.ui/src > > /org/openide/util/Utilities.java> java > > < > https://github.com/apache/netbeans/blob/master/platform/openide.util.ui/src > > /org/openide/util/Utilities.java> (lines 382 – 401) > > > > > > > > Which defines function of exact same signature and cals the one from > > *BaseUtilities.**java.* > > > > *Utilities.wrapStringToArray is not used anywhere.* > > > > > > > > > > > > > > There is another methods present in *BaseUtilities.java* called " > > *wrapString*" which in turn invokes "*wrapStringToArray*". > > platform\openide.dialogs\src\org\openide\NotifyDescriptor.java > > < > https://github.com/apache/netbeans/blob/71f182d6f160bcb3879c38c1f9f9a4925f1 > > > 8074f/platform/openide.dialogs/src/org/openide/NotifyDescriptor.java#L972> > > > > [image: obraz.png] > > > > > > So I thought... maybe it makes sense to remove > *Utilities.wrapStringToArray* > > and make *BaseUtilities.wrapStringToArray* private to be able to refactor > > BaseUtilities.wrapString into more efficient implementation (after > writing > > characterization > > tests <https://en.wikipedia.org/wiki/Characterization_test>first). > > > > > -- Łukasz Bownik
