View | Details | Raw Unified | Return to bug 207754 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java (-1 / +35 lines)
Lines 120-126 Link Here
120
	static {
120
	static {
121
//		TESTS_NAMES = new String[] {"test0602"};
121
//		TESTS_NAMES = new String[] {"test0602"};
122
//		TESTS_RANGE = new int[] { 670, -1 };
122
//		TESTS_RANGE = new int[] { 670, -1 };
123
//		TESTS_NUMBERS =  new int[] { 631, 686 };
123
//		TESTS_NUMBERS =  new int[] { 687 };
124
	}
124
	}
125
	public static Test suite() {
125
	public static Test suite() {
126
		return buildModelTestSuite(ASTConverterTestAST3_2.class);
126
		return buildModelTestSuite(ASTConverterTestAST3_2.class);
Lines 9516-9519 Link Here
9516
				workingCopy.discardWorkingCopy();
9516
				workingCopy.discardWorkingCopy();
9517
		}
9517
		}
9518
	}
9518
	}
9519
9520
	/*
9521
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=207754
9522
	 */
9523
	public void test0687() throws JavaModelException {
9524
		ICompilationUnit workingCopy = null;
9525
		try {
9526
			String contents =
9527
				"public class X {\n" + 
9528
				"	protected String foo(String string) {\n" + 
9529
				"		return (\"\" + string + \"\") + (\"\");\n" + 
9530
				"	}\n" + 
9531
				"}";
9532
			workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
9533
			ASTNode node = buildAST(
9534
				contents,
9535
				workingCopy);
9536
			assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
9537
			CompilationUnit unit = (CompilationUnit) node;
9538
			assertProblemsSize(unit, 0);
9539
			node = getASTNode(unit, 0, 0, 0);
9540
			assertEquals("Not a return statement", ASTNode.RETURN_STATEMENT, node.getNodeType());
9541
			ReturnStatement statement = (ReturnStatement) node;
9542
			Expression expression = statement.getExpression();
9543
			checkSourceRange(expression, "(\"\" + string + \"\") + (\"\")", contents);
9544
			assertEquals("Not an infix expression", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
9545
			InfixExpression infixExpression = (InfixExpression) expression;
9546
			Expression leftOperand = infixExpression.getLeftOperand();
9547
			checkSourceRange(leftOperand, "(\"\" + string + \"\")", contents);
9548
		} finally {
9549
			if (workingCopy != null)
9550
				workingCopy.discardWorkingCopy();
9551
		}
9552
	}
9519
}
9553
}

Return to bug 207754