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.
NB 5.0 200601251500 JDK 1.5.0_05 CCE is thrown when trying to extract new method from part of case branch of switch statement. Steps to reproduce: 1) open some class and write this code: int x = 1; switch (x) { case 1: |>System.out.println("a"); System.out.println("b");<| break; } 2) select both println commands (as marked with '|>' and '<|' symbols) 3) call Extract method -> CCE thrown In step 2) it is important to select both lines otherwise it works java.lang.ClassCastException: org.netbeans.jmi.javamodel.Case$Impl at org.netbeans.modules.javacore.internalapi.JavaModelUtil.getSelectedStatements(JavaModelUtil.java:168) at org.netbeans.modules.refactoring.plugins.ExtractMethodRefactoringPlugin.checkStatements(ExtractMethodRefactoringPlugin.java:139)
Created attachment 29322 [details] exception
Fixed in trunk. /cvs/java/javacore/src/org/netbeans/modules/javacore/internalapi/JavaModelUtil.java new revision: 1.20; previous revision: 1.19
Fix merged into release55 branch. /cvs/java/javacore/src/org/netbeans/modules/javacore/internalapi/JavaModelUtil.java new revision: 1.12.4.3.2.2; previous revision: 1.12.4.3.2.1
verified
*** Issue 82401 has been marked as a duplicate of this issue. ***
Reorganization of java component