else if (insertPos > 0 && text.charAt(insertPos - 1) == '}') { int opening= scanBackward(document, insertPos - 1 + line.getOffset(), partitioning, -1, new char[] { '{' }); if (opening > -1 && opening < offset + line.getOffset()) { if (computeArrayInitializationPos(document, line, opening - line.getOffset(), partitioning) == -1) { insertPos= offset; } } }
	protected static int computeCharacterPosition(IDocument document, ITextSelection line, int offset, char character, String partitioning) {		String text= line.getText();		if (text == null)			return 0;		int insertPos;		if (character == BRACECHAR) {			insertPos= computeArrayInitializationPos(document, line, offset, partitioning);			if (insertPos == -1) {				insertPos= computeAfterTryDoElse(document, line, offset);			}			if (insertPos == -1) {				insertPos= computeAfterParenthesis(document, line, offset, partitioning);			}		} else if (character == SEMICHAR) {			if (isForStatement(text, offset)) {				insertPos= -1; // don't do anything in for statements, as semis are vital part of these			} else {				int nextPartitionPos= nextPartitionOrLineEnd(document, line, offset, partitioning);				insertPos= startOfWhitespaceBeforeOffset(text, nextPartitionPos);				// if there is a semi present, return its location as alreadyPresent() will take it out this way.				if (insertPos > 0 && text.charAt(insertPos - 1) == character)					insertPos= insertPos - 1;			}					} else {			Assert.isTrue(false);			return -1;		}		return insertPos;	}