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.
Sun Studio on NetBeans 6.8 (PIB) Scenario: - Push Debug->Debug Executable... menu item ==> some window appeared - Press OK button ==> NPE
java.lang.NullPointerException at org.netbeans.modules.cnd.gizmo.options.GizmoOptionsImpl.getConfigurationByDisplayName(GizmoOptionsImpl.java:121) at org.netbeans.modules.cnd.gizmo.options.GizmoOptionsImpl.assign(GizmoOptionsImpl.java:326) at org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfiguration.assign(MakeConfiguration.java:421) at org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfiguration.copy(MakeConfiguration.java:438) at com.sun.tools.debugger.dbxgui.debugger.debugtarget.DebugTarget.cloneRecord(DebugTarget.java:259) at com.sun.tools.debugger.dbxgui.debugger.debugtarget.DebugTargetPanel.(DebugTargetPanel.java:143) at com.sun.tools.debugger.dbxgui.debugger.debugtarget.DebugTargetChooser.(DebugTargetChooser.java:45) at com.sun.tools.debugger.dbxgui.debugger.actions.DebugExecutableNodeAction.perform(DebugExecutableNodeAction.java:131) at com.sun.tools.debugger.dbxgui.debugger.actions.DebugExecutableNodeAction.performAction(DebugExecutableNodeAction.java:73) at org.openide.util.actions.NodeAction.performAction(NodeAction.java:296) at org.openide.util.actions.CallableSystemAction$1.run(CallableSystemAction.java:127) at org.netbeans.modules.openide.util.ActionsBridge.implPerformAction(ActionsBridge.java:83) at org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(ActionsBridge.java:64) at
P1 because this bug should be evaluated on this week. If NPE should be fixed in NetBeans 6.8, then it is showstopper.
bug confirmed. dbxgui is making a copy of the configuration and it is causing the exception. Don't quite understand yet why it doesn't happen is you use the Duplicate action in the configuration manager dialog (it is going through the same code), but it doesn't.
dbxgui also creates a makeconfiguration from scratch. These two lines reproduces the exception: MakeConfiguration configuration = new MakeConfiguration("/tmp", "Default", MakeConfiguration.TYPE_MAKEFILE); MakeConfiguration configuration2 = (MakeConfiguration)configuration.copy();
Fixed: dhcp-umpk16-82-219[581] hg export 7baf2531fded # HG changeset patch # User Thomas Preisler <thp@netbeans.org> # Date 1258574420 28800 # Node ID 7baf2531fdedd2ea122aea24ce86205b55e9969e # Parent e0f7f65769985b79ae4e624746e6a34f5b5bc28f #177087 - NullPointerException at org.netbeans.modules.cnd.gizmo.options.GizmoOptionsImpl.getConfigurationByDisplayName diff -r e0f7f6576998 -r 7baf2531fded cnd.gizmo/src/org/netbeans/modules/cnd/gizmo/options/GizmoOptionsImpl.java --- a/cnd.gizmo/src/org/netbeans/modules/cnd/gizmo/options/GizmoOptionsImpl.java Wed Nov 18 21:15:07 2009 +0300 +++ b/cnd.gizmo/src/org/netbeans/modules/cnd/gizmo/options/GizmoOptionsImpl.java Wed Nov 18 12:00:20 2009 -0800 @@ -118,6 +118,9 @@ public class GizmoOptionsImpl implements } public DLightConfiguration getConfigurationByDisplayName(List<DLightConfiguration> list, String displayName) { + if (list == null) { + return null; + } for (DLightConfiguration dlightConf : list) { if (dlightConf.getDisplayedName().equals(displayName)) { return dlightConf; @@ -323,9 +326,11 @@ public class GizmoOptionsImpl implements setMakeConfiguration(gizmoOptions.getMakeConfiguration()); preferredConfigurationName = null; List<DLightConfiguration> list = getValidConfigurations(); - DLightConfiguration conf = getConfigurationByDisplayName(list, getDlightConfigurationName().getValue()); - if (conf != null) { - preferredConfigurationName = conf.getConfigurationName(); + if (list != null) { + DLightConfiguration conf = getConfigurationByDisplayName(list, getDlightConfigurationName().getValue()); + if (conf != null) { + preferredConfigurationName = conf.getConfigurationName(); + } } } It is a showstopper because Sun Studio debugger (dbxgui) feature Debug->Debug Executable... wouldn't work without this fix. The fix is very low risk. Basically just checking for null. Fix can only be verified in SS context. Try SS IDE installed in /net/danmark.sfbay.sun.com/home/thp/aten/opt or use /net/danmark.sfbay.sun.com/home/thp/aten/ss12.2.tar
Alexander S., Do you mind peer review this fix? The problem was the way dbxgui created and used a configuration. It creates it's own configuration from scratch and did a copy on it before it was initialized with the configuration. I added two null checks . It's safe and correct. The configuration will correctly be initialized later before it is being used. Alexander P./Valeriy, The bug can only be verified in SS context. Please try SS IDE installed in /net/danmark.sfbay.sun.com/home/thp/aten/opt or use /net/danmark.sfbay.sun.com/home/thp/aten/ss12.2.tar Are there anything else I need to do to make sure the fix goes into main?
I reviewed fix. It is right and fixes NPE.
*** Bug 177159 has been marked as a duplicate of this bug. ***
described scenario is fixed
Integrated into 'main-golden', will be available in build *200911190201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/7baf2531fded User: Thomas Preisler <thp@netbeans.org> Log: #177087 - NullPointerException at org.netbeans.modules.cnd.gizmo.options.GizmoOptionsImpl.getConfigurationByDisplayName
Another scenario where I've seen this fail is as follows: StepInto some project StepInto the same project again in order to start a second session.
Verified in SSIDE PIB (091125)