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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java (-1 / +25 lines)
Lines 107-113 Link Here
107
107
108
	static {
108
	static {
109
//		TESTS_NAMES = new String[] {"test0602"};
109
//		TESTS_NAMES = new String[] {"test0602"};
110
//		TESTS_NUMBERS =  new int[] { 652 };
110
		TESTS_NUMBERS =  new int[] { 653 };
111
	}
111
	}
112
	public static Test suite() {
112
	public static Test suite() {
113
		return buildModelTestSuite(ASTConverterTestAST3_2.class);
113
		return buildModelTestSuite(ASTConverterTestAST3_2.class);
Lines 7988-7991 Link Here
7988
				workingCopy.discardWorkingCopy();
7988
				workingCopy.discardWorkingCopy();
7989
		}
7989
		}
7990
	}
7990
	}
7991
	/**
7992
	 * http://dev.eclipse.org/bugs/show_bug.cgi?id=150409
7993
	 */
7994
	public void test0653() throws JavaModelException {
7995
		ICompilationUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0653", "X.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
7996
		ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
7997
		assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, result.getNodeType());
7998
		CompilationUnit unit = (CompilationUnit) result;
7999
	
8000
		ASTNode node = getASTNode(unit, 0, 2, 0);
8001
		assertEquals("Not a method invocation", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
8002
		ExpressionStatement statement = (ExpressionStatement) node;
8003
		MethodInvocation invocation = (MethodInvocation) statement.getExpression();
8004
		List arguments = invocation.arguments();
8005
		assertEquals("Wrong size", 1, arguments.size());
8006
		Expression argument = (Expression) arguments.get(0);
8007
		assertEquals("Not a method invocation", ASTNode.METHOD_INVOCATION, argument.getNodeType());
8008
		invocation = (MethodInvocation) argument;
8009
		Expression expression = invocation.getExpression();
8010
		assertEquals("Not a method invocation", ASTNode.FIELD_ACCESS, expression.getNodeType());
8011
		FieldAccess fieldAccess = (FieldAccess) expression;
8012
		IVariableBinding variableBinding = fieldAccess.resolveFieldBinding();
8013
		assertNotNull("No variable binding", variableBinding);
8014
	}	
7991
}
8015
}
(-)workspace/Converter/src/test0653/X.java (+22 lines)
Added Link Here
1
package test0653;
2
3
import java.util.ArrayList;
4
5
public class X extends A {
6
7
	public X(String name) {
8
		super(name);
9
	}
10
11
	public static void main(String[] args) {
12
		new X("SimpleTest").test();
13
	}
14
15
	public void test() {
16
		System.out.println(this.name.length());
17
		ArrayList arrayList = new ArrayList(); // BREAKPOINT
18
		for (int i = 0; i < 100; i++) {
19
			arrayList.add(new Integer(i));
20
		}
21
	}
22
}
(-)workspace/Converter/src/test0653/A.java (+9 lines)
Added Link Here
1
package test0653;
2
3
public class A {
4
	private String name = null;
5
6
	public A(String aName) {
7
		this.name = aName;
8
	}
9
}

Return to bug 150409