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
* @param offset the position of the caret
	 * @return <code>true</code> if <code>line</code> contains <code>for</code>, <code>false</code> otherwise
	 */
	private static boolean isForStatement(String line, int offset) {
		
		int forPos= line.indexOf("for"); 
		if (forPos != -1) {
			if ((forPos == 0 || !Character.isJavaIdentifierPart(line.charAt(forPos - 1))) && (line.length() == forPos + 3 || !Character.isJavaIdentifierPart(line.charAt(forPos + 3))))
				return true;
		}
		return false;
	}
	/**
	 * Returns the position in <code>text</code> after which there comes only whitespace, up to 
	 * <code>offset</code>.
	 *  
	 * @param text the text being searched
	 * @param offset the maximum offset to search for
	 * @return the smallest value <code>v</code> such that <code>text.substring(v, offset).trim() == 0</code>
	 */
	private static int startOfWhitespaceBeforeOffset(String text, int offset) {
		int i= Math.min(offset, text.length());
		for (; i >= 1; i--) {
			if (!Character.isWhitespace(text.charAt(i - 1)))
				break;
		}
		return i;
	}
}