Bug 129530 [quick fix] remove curly brackets should have least relevance
20060227 Using quick fix on the 'for' of public class A { void f(List<? extends Number> x){ for (Iterator<? extends Number> iter = x.iterator(); iter.hasNext();) { Number num = iter.next(); //do stuff }} } has 'remove curly brackets' as first option. It should always be last (or second last in this example)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickAssistProcessor.java
}
			int statementStart= statement.getStartPosition();
			int statementEnd= statementStart + statement.getLength();
			int offset= context.getSelectionOffset();
			int length= context.getSelectionLength();
			if (length == 0) {
				if (offset != statementEnd) { 
					return false;
				}
			} else {
				if (offset > statementStart || offset + length < statementEnd) { 
					return false;
				}
			}
			statement= (Statement) statement.getParent();
		}
		StructuralPropertyDescriptor childProperty= null;
		ASTNode child= null;
		switch (statement.getNodeType()) {
			case ASTNode.IF_STATEMENT:
				int selectionStart= context.getSelectionOffset();
				int selectionEnd= context.getSelectionOffset() + context.getSelectionLength();
				ASTNode then= ((IfStatement) statement).getThenStatement();
				if (selectionEnd <= then.getStartPosition() + then.getLength()) {
					if (!(then instanceof Block)) {
						childProperty= IfStatement.THEN_STATEMENT_PROPERTY;
						child= then;
					}
				} else if (selectionStart >=  then.getStartPosition() + then.getLength()) {
					ASTNode elseStatement= ((IfStatement) statement).getElseStatement();