Bug 96280 [typing] Smart paste has problems if second line has only whitespaces
N20050523-0010 Paste the following into a method: void hasOneExitPoint() { } void hasTwoExitPoints(int i) { if (i < 0) callsMethodThatThrowsRuntimeException(i); }
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java
* @return <code>true</code> if the specified character range contains a <code>new</code> keyword, <code>false</code> otherwise.
	 */
	private static boolean isNewMatch(IDocument document, int offset, int length, String partitioning) {
		Assert.isTrue(length >= 0);
		Assert.isTrue(offset >= 0);
		Assert.isTrue(offset + length < document.getLength() + 1);
		try {
			String text= document.get(offset, length);
			int pos= text.indexOf("new"); 
			while (pos != -1 && !isDefaultPartition(document, pos + offset, partitioning))
				pos= text.indexOf("new", pos + 2); 
			if (pos < 0)
				return false;
			if (pos != 0 && Character.isJavaIdentifierPart(text.charAt(pos - 1)))
				return false;
			if (pos + 3 < length && Character.isJavaIdentifierPart(text.charAt(pos + 3)))
				return false;
			return true;
		} catch (BadLocationException e) {
		}
		return false;
	}
	/**
	 * Checks whether the content of <code>document</code> at <code>position</code> looks like an
	 * anonymous class definition. <code>position</code> must be to the left of the opening
	 * parenthesis of the definition's parameter list.
	 *
	 * @param document the document being modified
	 * @param position the first character position in <code>document</code> to be considered
	 * @param partitioning the document partitioning