Hi Pankaj, your change may break existing applications. Suppose that someone has created a sub-class of JTable and has overridden the #initializeLocalVars()-method and tries to access the table model in this model. Before your change the application works and after your change the application would throw NPE.
Best regards, Andrej Golovnin On Fri, Jan 5, 2018 at 1:16 PM, Pankaj Bansal <pankaj.b.ban...@oracle.com> wrote: > Hi All, > > > > Please review the fix for JDK 11. > > > > Bug: > > https://bugs.openjdk.java.net/browse/JDK-6257207 > > > > Webrev: > > http://cr.openjdk.java.net/~pbansal/6257207/webrev.00/ > > > > Issue: > > JTable.getDefaultEditor can throw a NullPointerException. > > > > Fix: > > While creating JTable, when data model is set by calling SetModel function, > SetModel function throws TableChanged event. Now if client code has > subclassed the JTable and is listening to TableChanged events, client can > try to use DefaultEditor, which causes problem as it has not been > initialized as of now. Moved the call to initializeLocalVars above setModel > call. > > > > Regards, > > Pankaj Bansal > >