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.
This bug was originally marked as duplicate of bug 230226, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related. Build: NetBeans IDE 7.3.1 (Build 201306052037) VM: Java HotSpot(TM) Client VM, 23.25-b01, Java(TM) SE Runtime Environment, 1.7.0_25-b17 OS: Windows 7 User Comments: GUEST: I was trying to add a column into a table, even the 'Add column' button when I am busy creating a new table doesn't work. Stacktrace: java.lang.NullPointerException at org.netbeans.modules.db.explorer.dlg.AddTableColumnDialog.updateState(AddTableColumnDialog.java:503) at org.netbeans.modules.db.explorer.dlg.AddTableColumnDialog.setDescriptor(AddTableColumnDialog.java:587) at org.netbeans.modules.db.explorer.dlg.AddTableColumnDialog.showDialogAndCreate(AddTableColumnDialog.java:647) at org.netbeans.modules.db.explorer.action.AddColumnAction$1.run(AddColumnAction.java:87) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2044)
Created attachment 148137 [details] stacktrace
It would be interesting to know the DB on which this was encountered - but none the less - the code relies an sizelesstypes and charactertypes to be non-null. So ensure that in AddTableColumnDialog.java: # This patch file was generated by NetBeans IDE # It uses platform neutral UTF-8 encoding and \n newlines. --- Base (BASE) +++ Locally Modified (Based On LOCAL) @@ -58,6 +58,7 @@ import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.List; import java.util.Map; import java.util.concurrent.Callable; @@ -152,9 +153,12 @@ // Column type - sizelesstypes = (Collection<String>) spe.getProperties().get("SizelessTypes"); // NOI18N - charactertypes = (Collection<String>) spe.getProperties().get("CharacterTypes"); // NOI18N + Collection<String> sizelesstypesSpec = (Collection<String>) spe.getProperties().get("SizelessTypes"); // NOI18N + Collection<String> charactertypesSpec = (Collection<String>) spe.getProperties().get("CharacterTypes"); // NOI18N + sizelesstypes = sizelesstypesSpec != null ? sizelesstypesSpec : Collections.<String>emptyList(); + charactertypes = charactertypesSpec != null ? charactertypesSpec : Collections.<String>emptyList(); + Map<String, String> tmap = spe.getTypeMap(); List<TypeElement> ttab = new ArrayList<TypeElement>(tmap.size()); for (String key : tmap.keySet()) {
Fix committed as: http://hg.netbeans.org/core-main/rev/6e9c9acafddf If someone has been able to reproduce the problem, please recheck after the nightly build that contains this fix is done (a message will be appended here then). If you can confirm the fix, please change Status of this bug to VERIFIED.
Integrated into 'main-silver', will be available in build *201502070001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/6e9c9acafddf User: Matthias Blaesing <matthias42@netbeans.org> Log: #245800: Prevent null pointer exception by initializing collections to empty list