This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Running this code Table1 t1 = new Table1(); Table2 t2a = new Table2(); Table2 t2b = new Table2(); t1.getTable2Collection().add(t2a); t1.getTable2Collection().add(t2b); get NPE on the add method. Assuming you want quick prototyping, generating something like the following seems approprate public Collection<Table2> getTable2Collection() { if(table2Collection == null) table2Collection = new ArrayList<Table2>(); return table2Collection; }
it's unclear for me if it's really good to implement or not, but looks like enhancement for me. less check always good me if it works as users can create code where this verification will be unnecessary but verification will still consume some processor time and make code more complex. for quick prototyping it's should be easy to use setTable2Collection instead of getTable2Collection, may be frst check if get.. retun null.
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss