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 193729 - NullPointerException at org.netbeans.modules.refactoring.php.findusages.WhereUsedElement.create
Summary: NullPointerException at org.netbeans.modules.refactoring.php.findusages.Where...
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-22 09:53 UTC by FTDeBUGgeR
Modified: 2011-03-14 20:16 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 161381


Attachments
stacktrace (1.13 KB, text/plain)
2010-12-22 09:53 UTC, FTDeBUGgeR
Details
stacktrace (1.15 KB, text/plain)
2011-01-25 13:30 UTC, Sc0tTyXL
Details

Note You need to log in before you can comment on or make changes to this bug.
Description FTDeBUGgeR 2010-12-22 09:53:19 UTC
Build: NetBeans IDE Dev (Build 101218-c87f4bc20449)
VM: Java HotSpot(TM) Client VM, 17.1-b03, Java(TM) SE Runtime Environment, 1.6.0_22-b04
OS: Linux

Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.refactoring.php.findusages.WhereUsedElement.create(WhereUsedElement.java:0)
   at org.netbeans.modules.refactoring.php.findusages.WhereUsedSupport$Results.addEntry(WhereUsedSupport.java:0)
   at org.netbeans.modules.refactoring.php.findusages.WhereUsedSupport$Results.access$300(WhereUsedSupport.java:0)
   at org.netbeans.modules.refactoring.php.findusages.WhereUsedSupport.collectUsages(WhereUsedSupport.java:0)
   at org.netbeans.modules.refactoring.php.findusages.PhpWhereUsedQueryPlugin.prepare(PhpWhereUsedQueryPlugin.java:0)
   at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare2(AbstractRefactoring.java:0)
Comment 1 FTDeBUGgeR 2010-12-22 09:53:23 UTC
Created attachment 104389 [details]
stacktrace
Comment 2 Sc0tTyXL 2011-01-25 13:30:33 UTC
Created attachment 105333 [details]
stacktrace

Tried to do a refactor, project wide.

Got this exception when doing the search.
Comment 3 Exceptions Reporter 2011-02-03 11:52:51 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=161381
Comment 4 Exceptions Reporter 2011-03-04 17:58:20 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=161381
Comment 5 Petr Pisl 2011-03-10 12:38:23 UTC
IMHO the situation can happen when the project has the default encoding UTF-8 and there are files that are not in UTF-8 encoding. The the document is not opened and the refactoring can not be done. 

Fixed in the web main:
http://hg.netbeans.org/web-main/rev/dcd173f0ae37

and adding logging
http://hg.netbeans.org/web-main/rev/6948d24b1a4f
Comment 6 Petr Pisl 2011-03-10 13:17:03 UTC
Can someone from QA tested?
Comment 7 Marian Mirilovic 2011-03-10 21:13:30 UTC
(In reply to comment #6)
> Can someone from QA tested?

Yes, we'll do so.
Comment 8 Vladimir Riha 2011-03-10 21:31:58 UTC
I'll test it as soon as possible
Comment 9 Quality Engineering 2011-03-11 09:40:06 UTC
Integrated into 'main-golden', will be available in build *201103110400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/dcd173f0ae37
User: Petr Pisl <ppisl@netbeans.org>
Log: #193729 - NullPointerException at org.netbeans.modules.refactoring.php.findusages.WhereUsedElement.create
Comment 10 Vladimir Riha 2011-03-11 17:00:40 UTC
I created project and put some files with different encoding (utf-8 and ANSII), one with method declaration, other one with was calling this method. Command "Find Usages" works fine, "Refactor Rename" also without problems. Verified
Comment 11 Petr Pisl 2011-03-14 20:16:49 UTC
The patch transplanted into releases repository, release70 branch