Bug 48641 [typing] Smart paste "fixes" comments
A new feature was added to M5 where smart paste fixes C style comments into Java style comments: /* * */ becomes: /* * */ The problem is that we have lots of text that is formatted the using C style and using smart paste makes the code inconistent. I don't use the feature but others on the team do. Shouldn't smart paste just indent the code?
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/JavaHeuristicScanner.java
/**
	 * Checks whether <code>position</code> resides in a default (Java) partition of <code>fDocument</code>.
	 * 
	 * @param position the position to be checked
	 * @return <code>true</code> if <code>position</code> is in the default partition of <code>fDocument</code>, <code>false</code> otherwise
	 */
	public boolean isDefaultPartition(int position) {
		Assert.isTrue(position >= 0);
		Assert.isTrue(position <= fDocument.getLength());
		
		try {
			ITypedRegion region= TextUtilities.getPartition(fDocument, fPartitioning, position);
			return region.getType().equals(fPartition);
			
		} catch (BadLocationException e) {
		}
		
		return false;
	}
	/**
	 * Checks if the line seems to be an open condition not followed by a block (i.e. an if, while, 
	 * or for statement with just one following statement, see example below). 
	 * 
	 * <pre>
	 * if (condition)
	 *     doStuff();
	 * </pre>
	 * 
	 * <p>Algorithm: if the last non-WS, non-Comment code on the line is an if (condition), while (condition),