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

Collapse All | Expand All

(-)dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java (-1 / +1 lines)
Lines 426-432 Link Here
426
			} else if (enclosingTypeDeclaration != null) {
426
			} else if (enclosingTypeDeclaration != null) {
427
				if (node instanceof org.eclipse.jdt.internal.compiler.ast.Initializer) {
427
				if (node instanceof org.eclipse.jdt.internal.compiler.ast.Initializer) {
428
					((org.eclipse.jdt.internal.compiler.ast.Initializer) node).parseStatements(parser, enclosingTypeDeclaration, compilationUnitDeclaration);
428
					((org.eclipse.jdt.internal.compiler.ast.Initializer) node).parseStatements(parser, enclosingTypeDeclaration, compilationUnitDeclaration);
429
				} else {
429
				} else if (node instanceof org.eclipse.jdt.internal.compiler.ast.TypeDeclaration) {
430
					((org.eclipse.jdt.internal.compiler.ast.TypeDeclaration)node).parseMethods(parser, compilationUnitDeclaration);
430
					((org.eclipse.jdt.internal.compiler.ast.TypeDeclaration)node).parseMethods(parser, compilationUnitDeclaration);
431
				}
431
				}
432
			}
432
			}
(-)src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java (-2 / +19 lines)
Lines 24-29 Link Here
24
import org.eclipse.jdt.core.Flags;
24
import org.eclipse.jdt.core.Flags;
25
import org.eclipse.jdt.core.IClassFile;
25
import org.eclipse.jdt.core.IClassFile;
26
import org.eclipse.jdt.core.ICompilationUnit;
26
import org.eclipse.jdt.core.ICompilationUnit;
27
import org.eclipse.jdt.core.IField;
27
import org.eclipse.jdt.core.IInitializer;
28
import org.eclipse.jdt.core.IInitializer;
28
import org.eclipse.jdt.core.IJavaElement;
29
import org.eclipse.jdt.core.IJavaElement;
29
import org.eclipse.jdt.core.IJavaProject;
30
import org.eclipse.jdt.core.IJavaProject;
Lines 120-126 Link Here
120
	static {
121
	static {
121
//		TESTS_NAMES = new String[] {"test0602"};
122
//		TESTS_NAMES = new String[] {"test0602"};
122
//		TESTS_RANGE = new int[] { 670, -1 };
123
//		TESTS_RANGE = new int[] { 670, -1 };
123
//		TESTS_NUMBERS =  new int[] { 687 };
124
		TESTS_NUMBERS =  new int[] { 688 };
124
	}
125
	}
125
	public static Test suite() {
126
	public static Test suite() {
126
		return buildModelTestSuite(ASTConverterTestAST3_2.class);
127
		return buildModelTestSuite(ASTConverterTestAST3_2.class);
Lines 9546-9553 Link Here
9546
			Expression leftOperand = infixExpression.getLeftOperand();
9547
			Expression leftOperand = infixExpression.getLeftOperand();
9547
			checkSourceRange(leftOperand, "(\"\" + string + \"\")", contents);
9548
			checkSourceRange(leftOperand, "(\"\" + string + \"\")", contents);
9548
		} finally {
9549
		} finally {
9549
			if (workingCopy != null)
9550
			if (workingCopy != null) {
9550
				workingCopy.discardWorkingCopy();
9551
				workingCopy.discardWorkingCopy();
9552
			}
9551
		}
9553
		}
9552
	}
9554
	}
9555
	/**
9556
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
9557
	 */
9558
	public void test0688() throws JavaModelException {
9559
		ICompilationUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0688", "X.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
9560
		IType[] types = sourceUnit.getTypes();
9561
		assertNotNull(types);
9562
		assertEquals("wrong size", 1, types.length);
9563
		IType type = types[0];
9564
		IField field = type.getField("i");
9565
		assertNotNull("No field", field);
9566
		ISourceRange sourceRange = field.getNameRange();
9567
		ASTNode result = runConversion(AST.JLS3, sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
9568
		assertNotNull(result);
9569
	}
9553
}
9570
}
(-)workspace/Converter/src/test0688/X.java (+6 lines)
Added Link Here
1
package test0688;
2
3
public class X {
4
	protected int i;
5
	protected void foo(String string) {}
6
}

Return to bug 215858