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.
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
Created attachment 61256 [details] stacktrace
Cannot reproduce. Please provide step by step instructions.
Created attachment 61432 [details] sample project
Steps to reproduce: 1) open sample project 2) switch to files view 3) rename org to com
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?
Created attachment 61646 [details] stacktrace
Reassigning back, it is still open how it will be fixed.
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.
http://hg.netbeans.org/main/rev/d09c88e22532
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
*** Issue 141193 has been marked as a duplicate of this issue. ***
*** Issue 136044 has been marked as a duplicate of this issue. ***
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)
fixed http://hg.netbeans.org/main/rev/3af37c87e634
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)
http://hg.netbeans.org/main/rev/b2ee4d20bf9b this changeset relates too
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)
*** Issue 153781 has been marked as a duplicate of this issue. ***
*** Issue 157847 has been marked as a duplicate of this issue. ***