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.

Bug 225126

Summary: NullPointerException at org.netbeans.modules.profiler.ExportAction.actionPerformed
Product: profiler Reporter: Petr Cyhelsky <cyhelsky>
Component: BaseAssignee: Petr Cyhelsky <cyhelsky>
Status: VERIFIED FIXED    
Severity: normal CC: exceptions_reporter, mmirilovic
Priority: P2 Keywords: REGRESSION
Version: 7.3   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 197812
Attachments: stacktrace

Description Petr Cyhelsky 2013-01-21 09:02:12 UTC
Build: NetBeans IDE 7.3 RC1 (Build 201301102100)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.6-b04, Java(TM) SE Runtime Environment, 1.7.0_10-ea-b15
OS: Linux

Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.profiler.ExportAction.actionPerformed(ExportAction.java:361)
   at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
   at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
   at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
   at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
Comment 1 Petr Cyhelsky 2013-01-21 09:02:14 UTC
Created attachment 130433 [details]
stacktrace
Comment 2 Petr Cyhelsky 2013-01-21 11:08:32 UTC
this is an regression caused by check whether the backing snapshot is being overwritten. It happens for memory diff from sampled memory profiling.
fixed in https://hg.netbeans.org/profiler-main/rev/a849e0bc8c4e
Comment 3 Jiri Sedlacek 2013-01-21 11:56:36 UTC
Not sure if this is the right fix. By this change you've disabled the check to overwrite an existing file for sampled memory diffs. Now the target file is overwritten without any message. Sampled CPU diff asks you to confirm overwrite file - should be consistent.

Looking at the 'checkFileExists(...)' implementation, this seems to be a better fix:

  if (!checkFileExists(snapshot == null ? null : snapshot.getFile(),file)) {

Please check and eventually update your changes.
Comment 4 Jiri Sedlacek 2013-01-21 14:21:59 UTC
*** Bug 225140 has been marked as a duplicate of this bug. ***
Comment 5 Petr Cyhelsky 2013-01-22 14:16:57 UTC
reviewer's code integrated in:
https://hg.netbeans.org/profiler-main/rev/f7b9eecf29cc
Comment 6 Jiri Sedlacek 2013-01-22 14:20:46 UTC
The fix looks good, verified that it fixes the reported bug and doesn't introduce new problems.
Comment 7 Quality Engineering 2013-01-24 00:54:53 UTC
Integrated into 'releases', will be available in build *201301232200* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/85b0008d56ed
User: Petr Cyhelsky <cyhelsky@netbeans.org>
Log: #225126 - check for non existent backing snapshot when exporting
(transplanted from a849e0bc8c4ef76b7ee9bef476cd69714bc4b78e)
Comment 8 Quality Engineering 2013-01-24 03:02:39 UTC
Integrated into 'main-golden', will be available in build *201301240001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a849e0bc8c4e
User: Petr Cyhelsky <cyhelsky@netbeans.org>
Log: #225126 - check for non existent backing snapshot when exporting