Bug 40038 [typing] Smart semicolon fooled by method braces
Build: I20030710 Start writing a setter method, like this: public void setValue(int i) {} Then position cursor between the braces and fill in the method body. You end up with this: public void setValue(int i) {this.value=i}; Problem: when you type the semicolon, it jumps over the closing method body brace and places it at the end of the line, resulting in a syntax error.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/SmartSemicolonAutoEditStrategy.java
while (validPosition == -1) {
				nextPartitionPos= partition.getOffset() - 1;
				if (nextPartitionPos < docOffset) {
					validPosition= docOffset;
					break;
				}
				partition= TextUtilities.getPartition(document, partitioning, nextPartitionPos, false);
				validPosition= getValidPositionForPartition(document, partition, eol);
			}
		} catch (BadLocationException e) {
		}
		validPosition= Math.max(validPosition, docOffset);
		
		validPosition -= line.getOffset();
		return validPosition;
	}
	/**
	 * Returns a valid insert location (except for whitespace) in <code>partition</code> or -1 if
	 * there is no valid insert location. 
	 * An valid insert location is right after any java string or character partition, or at the end
	 * of a java default partition, but never behind <code>maxOffset</code>. Comment partitions or 
	 * empty java partitions do never yield valid insert positions.
	 * 
	 * @param doc the document being modified
	 * @param partition the current partition
	 * @param maxOffset the maximum offset to consider
	 * @return a valid insert location in <code>partition</code>, or -1 if there is no valid insert location
	 */
	private static int getValidPositionForPartition(IDocument doc, ITypedRegion partition, int maxOffset) {
		final int INVALID= -1;