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 214813

Summary: NullPointerException at org.netbeans.modules.refactoring.java.RefactoringUtils.findEnclosingClass
Product: java Reporter: _mikejwatts_
Component: RefactoringAssignee: Ralph Ruijs <ralphbenjamin>
Status: RESOLVED WORKSFORME    
Severity: normal CC: jiriprox
Priority: P3    
Version: 7.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 190107
Attachments: stacktrace
stacktrace

Description _mikejwatts_ 2012-06-26 16:17:38 UTC
Build: NetBeans IDE 7.2 Beta (Build 201205031832)
VM: Java HotSpot(TM) Client VM, 21.0-b17, Java(TM) SE Runtime Environment, 1.7.0-b147
OS: Windows XP

User Comments:
_mikejwatts_: moving enum to superclass




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.refactoring.java.RefactoringUtils.findEnclosingClass(RefactoringUtils.java:779)
   at org.netbeans.modules.refactoring.java.api.JavaRefactoringUtils.findEnclosingClass(JavaRefactoringUtils.java:145)
   at org.netbeans.modules.refactoring.java.plugins.MoveMembersRefactoringPlugin.fastCheckParameters(MoveMembersRefactoringPlugin.java:239)
   at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin$WorkingTask.run(JavaRefactoringPlugin.java:359)
   at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin$WorkingTask.run(JavaRefactoringPlugin.java:329)
   at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:488)
Comment 1 _mikejwatts_ 2012-06-26 16:17:42 UTC
Created attachment 121398 [details]
stacktrace
Comment 2 Jiri Prox 2013-03-15 14:39:43 UTC
Created attachment 132658 [details]
stacktrace

NPE when trying to move methods from enum

Steps to reproduce:
1) have a enum MyEnum {A,B;}
2) call Move refactoring
3) in opened dialog select valueOf method
Comment 3 Quality Engineering 2015-02-04 03:29:25 UTC
Reported for 7.3.x or earlier, no new info since then -> closing as worksforme, please reopen in case you see it.