Project: JDT
Bug 206617 [quick assist] ClassCastException in if statement
Reported: 2007-10-17 09:40:58 | Status: resolved fixed

Build ID: I20070621-1340 Steps To Reproduce: 1. Request quick assist in a || operand of an else-if statement, e.g : .. else if(a||b) { .. 2. Some quick assist are missing (Exchange left and right operands, split || condition...) , check the log you will see that a ClassCastException has occured. More information: It works for a 'if' statement and fails for an 'else-if'. This is the exception stack trace: Exception while processing quick fixes or quick assists java.lang.ClassCastException: org.eclipse.jdt.core.dom.IfStatement cannot be cast to org.eclipse.jdt.core.dom.Block at org.eclipse.jdt.internal.ui.text.correction.AdvancedQuickAssistProcessor.getSplitOrConditionProposals(AdvancedQuickAssistProcessor.java:1115) at org.eclipse.jdt.internal.ui.text.correction.AdvancedQuickAssistProcessor.getAssists(AdvancedQuickAssistProcessor.java:155)

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AdvancedQuickAssistTest.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/AdvancedQuickAssistProcessor.java