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 |
} |