Lines 47-53
Link Here
|
47 |
} |
47 |
} |
48 |
|
48 |
|
49 |
static { |
49 |
static { |
50 |
// TESTS_NUMBERS = new int[] { 334 }; |
50 |
// TESTS_NUMBERS = new int[] { 337 }; |
51 |
// TESTS_RANGE = new int[] { 325, -1 }; |
51 |
// TESTS_RANGE = new int[] { 325, -1 }; |
52 |
// TESTS_NAMES = new String[] {"test0204"}; |
52 |
// TESTS_NAMES = new String[] {"test0204"}; |
53 |
} |
53 |
} |
Lines 10802-10805
Link Here
|
10802 |
IVariableBinding variableBinding = (IVariableBinding) memberValuePair.getValue(); |
10802 |
IVariableBinding variableBinding = (IVariableBinding) memberValuePair.getValue(); |
10803 |
assertEquals("Wrong field", "CLASS", variableBinding.getName()); |
10803 |
assertEquals("Wrong field", "CLASS", variableBinding.getName()); |
10804 |
} |
10804 |
} |
|
|
10805 |
/* |
10806 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=287701 |
10807 |
*/ |
10808 |
public void test0337() throws JavaModelException { |
10809 |
String contents = |
10810 |
"public class X {\n" + |
10811 |
" void m() {\n" + |
10812 |
" int x= 1 ;\n" + |
10813 |
" int y= - 1 , z=0 ;\n" + |
10814 |
" // Assignment nodes too long:\n" + |
10815 |
" int a= x = 2 ;\n" + |
10816 |
" System.out.print( x=1 );\n" + |
10817 |
" java.util.Arrays.asList( x = 1 /*bla*/ , x= 2\n" + |
10818 |
" // comment \n" + |
10819 |
" );\n" + |
10820 |
" }\n" + |
10821 |
"}\n" + |
10822 |
""; |
10823 |
this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/); |
10824 |
CompilationUnit unit= (CompilationUnit) buildAST( |
10825 |
contents, |
10826 |
this.workingCopy, |
10827 |
true, |
10828 |
true, |
10829 |
true); |
10830 |
ASTNode node = getASTNode(unit, 0, 0, 2); |
10831 |
checkSourceRange(node, "int a= x = 2 ;", contents); |
10832 |
VariableDeclarationFragment fragment = (VariableDeclarationFragment) ((VariableDeclarationStatement) node).fragments().get(0); |
10833 |
checkSourceRange(fragment, "a= x = 2", contents); |
10834 |
node = getASTNode(unit, 0, 0, 3); |
10835 |
Expression expression = (Expression) ((MethodInvocation) ((ExpressionStatement) node).getExpression()).arguments().get(0); |
10836 |
checkSourceRange(expression, "x=1", contents); |
10837 |
node = getASTNode(unit, 0, 0, 4); |
10838 |
List arguments = ((MethodInvocation) ((ExpressionStatement) node).getExpression()).arguments(); |
10839 |
ASTNode node2 = (ASTNode) arguments.get(0); |
10840 |
checkSourceRange(node2, "x = 1", contents); |
10841 |
checkSourceRange((ASTNode) arguments.get(1), "x= 2", contents); |
10842 |
int extendedLength = unit.getExtendedLength(node2); |
10843 |
int extendedStartPosition = unit.getExtendedStartPosition(node2); |
10844 |
checkSourceRange(extendedStartPosition, extendedLength, "x = 1 /*bla*/", contents); |
10845 |
} |
10805 |
} |
10846 |
} |