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 107702 - NPE when doing Refactor -> Safe Delete
Summary: NPE when doing Refactor -> Safe Delete
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-21 19:25 UTC by Sonali Kochar
Modified: 2007-06-22 14:05 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sonali Kochar 2007-06-21 19:25:03 UTC
NPE during Refactor -> Safe Delete

java.lang.NullPointerException
       at
org.netbeans.modules.apisupport.refactoring.AbstractRefactoringPlugin.examineLookup(AbstractRefactoringPlugin.java:145)
       at
org.netbeans.modules.apisupport.refactoring.NbSafeDeleteRefactoringPlugin.prepare(NbSafeDeleteRefactoringPlugin.java:87)
       at
org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare(AbstractRefactoring.java:328)
       at
org.netbeans.modules.refactoring.api.AbstractRefactoring.prepare(AbstractRefactoring.java:177)
       at
org.netbeans.modules.refactoring.spi.impl.ParametersPanel$Prepare.run(ParametersPanel.java:723)
       at
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:539)
       at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:964)
SEVERE [org.openide.util.RequestProcessor] 

The problem seems to be in AbstractReafactoringPlugin:
 JavaSource source = JavaSource.forFileObject(handle.getFileObject());

You need to check if handle != null before doing this call.
Comment 1 Milos Kleint 2007-06-22 14:05:48 UTC
fixed
Checking in NbRefactoringFactory.java;
/cvs/apisupport/refactoring/src/org/netbeans/modules/apisupport/refactoring/NbRefactoringFactory.java,v  <-- 
NbRefactoringFactory.java
new revision: 1.7; previous revision: 1.6
done
IDE: [6/22/07 3:06 PM] Committing finished