Bug 32033 Spaces for TAB preference is confusing
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java
}
			int whiteend= findEndOfWhiteSpace(document, start, command.offset);
			buffer.append(document.get(start, whiteend - start));
			if (getBracketCount(document, start, command.offset, true) > 0) {
				buffer.append(createIndent(1, useSpaces()));
			}
		} catch (BadLocationException e) {
			JavaPlugin.log(e);
		}
		
		return calculateDisplayedWidth(buffer.toString(), getTabWidth());
	}
	
	private String getBlockIndent(IDocument d, DocumentCommand c) {
		if (c.offset < 0 || d.getLength() == 0)
			return null;
		try {
			int p= (c.offset == d.getLength() ? c.offset - 1 : c.offset);
			int line= d.getLineOfOffset(p);
			
			int indLine= findMatchingOpenBracket(d, line, c.offset, 1);
			if (indLine != -1)
				
				return getIndentOfLine(d, indLine);
		} catch (BadLocationException e) {
			JavaPlugin.log(e);
		}
		return null;
	}
	private static final class LineIterator implements Iterator {