Bug 45349 [typing] Smart ; must replace selection
I20031015 1. enter "int a= 3;" 2. select "=3;" 3. press ";"
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/SmartSemicolonAutoEditStrategy.java
if (Character.isWhitespace(ch) && p != position)
					return p + 1;
				else
					return -1;
			}
			
			return 0;
		} catch (BadLocationException e) {
		}
		return -1;
	}
	/**
	 * Returns a position in the first java partition after the last non-empty and non-comment partition.
	 * There is no non-whitespace from the returned position to the end of the partition it is contained in.
	 * 
	 * @param document the document being modified
	 * @param line the line under investigation
	 * @param offset the caret offset into <code>line</code>
	 * @param partitioning the document partitioning
	 * @return the position of the next Java partition, or the end of <code>line</code>
	 */
	private static int nextPartitionOrLineEnd(IDocument document, ITextSelection line, int offset, String partitioning) {
		
		final int docOffset= offset + line.getOffset();
		final int eol= line.getOffset() + line.getLength();
		int nextPartitionPos= eol; 
		int validPosition= docOffset;
		try {
			ITypedRegion partition= TextUtilities.getPartition(document, partitioning, nextPartitionPos);
			validPosition= getValidPositionForPartition(document, partition, eol);