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 134854 - NullPointerException at org.netbeans.modules.refactoring.java.plugins.MoveRefactoringPlugin.getTargetPackageName
Summary: NullPointerException at org.netbeans.modules.refactoring.java.plugins.MoveRef...
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Pokorsky
URL: http://statistics.netbeans.org/except...
Keywords:
: 136044 141193 153781 157847 (view as bug list)
Depends on:
Blocks: 128830
  Show dependency tree
 
Reported: 2008-05-12 13:13 UTC by Jiri Prox
Modified: 2009-02-19 22:58 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 53885


Attachments
stacktrace (2.68 KB, text/plain)
2008-05-12 13:13 UTC, Jiri Prox
Details
sample project (57.50 KB, application/x-compressed)
2008-05-15 13:48 UTC, Jiri Prox
Details
stacktrace (2.76 KB, text/plain)
2008-05-20 21:59 UTC, onolox
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Prox 2008-05-12 13:13:31 UTC
Build: NetBeans IDE Dev (Build 20080512063749)
VM: Java HotSpot(TM) Client VM, 11.0-b11, Java(TM) SE Runtime Environment, 1.6.0_10-beta-b14
OS: Linux, 2.6.22-14-generic, i386

User Comments: 
NPE when renaming package in files view
Comment 1 Jiri Prox 2008-05-12 13:13:41 UTC
Created attachment 61256 [details]
stacktrace
Comment 2 Jan Becicka 2008-05-15 13:34:48 UTC
Cannot reproduce. Please provide step by step instructions.
Comment 3 Jiri Prox 2008-05-15 13:48:05 UTC
Created attachment 61432 [details]
sample project
Comment 4 Jiri Prox 2008-05-15 13:49:14 UTC
Steps to reproduce:
1) open sample project
2) switch to files view
3) rename org to com
Comment 5 Jan Pokorsky 2008-05-15 14:40:50 UTC
NPE is caused by outdated implementation of SourceUtils.getFile(Element,ClasspathInfo). I could fix it by migrating to
SourceUtils.getFile(ElementHandle,ClasspathInfo) that seems to work well but it seems to me useful to restore the
implementation of SourceUtils.getFile(Element,ClasspathInfo) and undeprecate it. There are a lot of places in the java
refactoring module and maybe others where it is necessary to get FileObject for an Element and it is unhandy to always
create ElementHandle for the query.

Tome, would it be possible?
Comment 6 onolox 2008-05-20 21:59:27 UTC
Created attachment 61646 [details]
stacktrace
Comment 7 Jan Pokorsky 2008-05-21 14:02:04 UTC
Reassigning back, it is still open how it will be fixed.
Comment 8 Jan Pokorsky 2008-07-22 18:24:51 UTC
http://hg.netbeans.org/main/rev/2d5de69cea4f

tzezula: Tome, it will not work in cases when the Element is a method parameter or anything for which ElementHandle
cannot be created.
Comment 9 Tomas Zezula 2008-07-23 16:23:27 UTC
http://hg.netbeans.org/main/rev/d09c88e22532
Comment 10 Quality Engineering 2008-07-24 04:04:59 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #341 build
Changeset: http://hg.netbeans.org/main/rev/d09c88e22532
User: Tomas Zezula <tzezula@netbeans.org>
Log: #134854:NullPointerException at org.netbeans.modules.refactoring.java.plugins.MoveRefactoringPlugin.getTargetPackageName
Comment 11 Jan Lahoda 2008-07-24 21:46:02 UTC
*** Issue 141193 has been marked as a duplicate of this issue. ***
Comment 12 Jan Becicka 2008-08-06 10:19:37 UTC
*** Issue 136044 has been marked as a duplicate of this issue. ***
Comment 13 Jiri Prox 2009-01-14 16:42:17 UTC
unfortunately it is still reproducible with original steps to reproduce

Product Version: NetBeans IDE Dev (Build 20090113073351)
Java: 1.6.0_11; Java HotSpot(TM) Client VM 11.0-b16
System: Linux version 2.6.24-23-generic running on i386; UTF-8; en_US (nb)
Comment 14 Jan Pokorsky 2009-01-15 12:46:46 UTC
fixed http://hg.netbeans.org/main/rev/3af37c87e634
Comment 15 Jiri Prox 2009-01-15 21:55:54 UTC
verified in
Product Version: NetBeans IDE Dev (Build 20090115032805)
Java: 1.6.0_11; Java HotSpot(TM) Client VM 11.0-b16
System: Linux version 2.6.24-23-generic running on i386; UTF-8; en_US (nb)
Comment 16 Jan Pokorsky 2009-01-16 15:57:30 UTC
http://hg.netbeans.org/main/rev/b2ee4d20bf9b this changeset relates too
Comment 17 Quality Engineering 2009-01-17 06:53:07 UTC
Integrated into 'main-golden', will be available in build *200901170201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/3af37c87e634
User: Jan Pokorsky <jpokorsky@netbeans.org>
Log: #134854: SourceUtils.getFile(Element) should work even for PackageElement the same way as SourceUtils.getFile(ElementHandle)
Comment 18 Jan Pokorsky 2009-02-10 14:41:29 UTC
*** Issue 153781 has been marked as a duplicate of this issue. ***
Comment 19 Jan Pokorsky 2009-02-10 14:44:38 UTC
*** Issue 157847 has been marked as a duplicate of this issue. ***