Bug 61759 [typing] Smart semicolon does not work at end of string literal
I20040506 0. smart semicolon is on, smart typing mode 1. have this code: String s= "asdfasdf<caret>" 2. press SEMICOLON -> expected: semicolon gets inserted after the closing quotation mark -> real: the semicolon is inserted at the caret position -> note that it works if the caret position is not before the closing quotation mark.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/SmartSemicolonAutoEditStrategy.java
return document.getNumberOfLines(command.offset, command.length) > 1;
		} catch (BadLocationException e) {
			
			return false;
		}
	}
	/**
	 * Adds a space before a brace if it is inserted after a parenthesis, equal sign, or one
	 * of the keywords <code>try, else, do</code>. 
	 * 
	 * @param document the document we are working on
	 * @param position the insert position of <code>character</code>
	 * @param character the character to be inserted
	 * @return a <code>String</code> consisting of <code>character</code> plus any additional spacing
	 */
	private String adjustSpacing(IDocument doc, int position, char character) {
		if (character == BRACECHAR) {
			if (position > 0 && position <= doc.getLength()) {
				int pos= position - 1;
				if (looksLike(doc, pos, ")") 
				|| looksLike(doc, pos, "=") 
				|| looksLike(doc, pos, "]") 
				|| looksLike(doc, pos, "try") 
				|| looksLike(doc, pos, "else") 
				|| looksLike(doc, pos, "synchronized") 
				|| looksLike(doc, pos, "static") 
				|| looksLike(doc, pos, "finally") 
				|| looksLike(doc, pos, "do")) 
					return new String(new char[] { ' ', character });
			}