Lines 523-529
Link Here
|
523 |
assertEquals("Wrong size", 1, typeParameters.size()); |
523 |
assertEquals("Wrong size", 1, typeParameters.size()); |
524 |
TypeParameter typeParameter = (TypeParameter) typeParameters.get(0); |
524 |
TypeParameter typeParameter = (TypeParameter) typeParameters.get(0); |
525 |
checkSourceRange(typeParameter.getName(), "A", source); |
525 |
checkSourceRange(typeParameter.getName(), "A", source); |
526 |
checkSourceRange(typeParameter, "A extends Object & java.io.Serializable & Comparable", source); |
526 |
checkSourceRange(typeParameter, "A extends Object & java.io.Serializable & Comparable<?>", source); |
527 |
List typeBounds = typeParameter.typeBounds(); |
527 |
List typeBounds = typeParameter.typeBounds(); |
528 |
assertEquals("Wrong size", 3, typeBounds.size()); |
528 |
assertEquals("Wrong size", 3, typeBounds.size()); |
529 |
Type typeBound = (Type) typeBounds.get(0); |
529 |
Type typeBound = (Type) typeBounds.get(0); |
Lines 531-537
Link Here
|
531 |
typeBound = (Type) typeBounds.get(1); |
531 |
typeBound = (Type) typeBounds.get(1); |
532 |
checkSourceRange(typeBound, "java.io.Serializable", source); |
532 |
checkSourceRange(typeBound, "java.io.Serializable", source); |
533 |
typeBound = (Type) typeBounds.get(2); |
533 |
typeBound = (Type) typeBounds.get(2); |
534 |
checkSourceRange(typeBound, "Comparable", source); |
534 |
checkSourceRange(typeBound, "Comparable<?>", source); |
535 |
} |
535 |
} |
536 |
|
536 |
|
537 |
public void test0016() throws JavaModelException { |
537 |
public void test0016() throws JavaModelException { |
Lines 1746-1752
Link Here
|
1746 |
" <T extends Exception & Runnable> void foo(T t) {\n" + |
1746 |
" <T extends Exception & Runnable> void foo(T t) {\n" + |
1747 |
" }\n" + |
1747 |
" }\n" + |
1748 |
"}/*end*/", |
1748 |
"}/*end*/", |
1749 |
this.workingCopy); |
1749 |
this.workingCopy, |
|
|
1750 |
false); |
1750 |
MethodDeclaration[] methods = ((TypeDeclaration) node).getMethods(); |
1751 |
MethodDeclaration[] methods = ((TypeDeclaration) node).getMethods(); |
1751 |
int length = methods.length; |
1752 |
int length = methods.length; |
1752 |
String[] keys = new String[length]; |
1753 |
String[] keys = new String[length]; |
Lines 1787-1793
Link Here
|
1787 |
"public class X<T> {\n" + |
1788 |
"public class X<T> {\n" + |
1788 |
" /*start*/X<Class>/*end*/ f;\n" + |
1789 |
" /*start*/X<Class>/*end*/ f;\n" + |
1789 |
"}", |
1790 |
"}", |
1790 |
this.workingCopy); |
1791 |
this.workingCopy, |
|
|
1792 |
false); |
1791 |
IBinding binding = ((Type) node).resolveBinding(); |
1793 |
IBinding binding = ((Type) node).resolveBinding(); |
1792 |
assertBindingKeyEquals( |
1794 |
assertBindingKeyEquals( |
1793 |
"Lp/X<Ljava/lang/Class<>;>;", |
1795 |
"Lp/X<Ljava/lang/Class<>;>;", |
Lines 1824-1830
Link Here
|
1824 |
SingleVariableDeclaration declaration = (SingleVariableDeclaration) parameters.get(0); |
1826 |
SingleVariableDeclaration declaration = (SingleVariableDeclaration) parameters.get(0); |
1825 |
Type type = declaration.getType(); |
1827 |
Type type = declaration.getType(); |
1826 |
typeBinding = type.resolveBinding(); |
1828 |
typeBinding = type.resolveBinding(); |
1827 |
assertEquals("Wrong qualified name", "java.util.List<? extends test0063.X>", typeBinding.getQualifiedName()); |
1829 |
assertEquals("Wrong qualified name", "java.util.List<? extends test0063.X<?>>", typeBinding.getQualifiedName()); |
1828 |
} |
1830 |
} |
1829 |
|
1831 |
|
1830 |
/** |
1832 |
/** |
Lines 1858-1864
Link Here
|
1858 |
SingleVariableDeclaration declaration = (SingleVariableDeclaration) parameters.get(0); |
1860 |
SingleVariableDeclaration declaration = (SingleVariableDeclaration) parameters.get(0); |
1859 |
Type type = declaration.getType(); |
1861 |
Type type = declaration.getType(); |
1860 |
typeBinding = type.resolveBinding(); |
1862 |
typeBinding = type.resolveBinding(); |
1861 |
assertEquals("Wrong qualified name", "java.util.List<? extends test0064.X>", typeBinding.getQualifiedName()); |
1863 |
assertEquals("Wrong qualified name", "java.util.List<? extends test0064.X<?,?>>", typeBinding.getQualifiedName()); |
1862 |
} |
1864 |
} |
1863 |
|
1865 |
|
1864 |
/** |
1866 |
/** |
Lines 1885-1891
Link Here
|
1885 |
Expression expression = returnStatement.getExpression(); |
1887 |
Expression expression = returnStatement.getExpression(); |
1886 |
typeBinding = expression.resolveTypeBinding(); |
1888 |
typeBinding = expression.resolveTypeBinding(); |
1887 |
assertTrue("Not parameterized", typeBinding.isParameterizedType()); |
1889 |
assertTrue("Not parameterized", typeBinding.isParameterizedType()); |
1888 |
assertEquals("Wrong qualified name", "test0065.X<java.lang.String,java.util.List>", typeBinding.getQualifiedName()); |
1890 |
assertEquals("Wrong qualified name", "test0065.X<java.lang.String,java.util.List<?>>", typeBinding.getQualifiedName()); |
1889 |
node = getASTNode(compilationUnit, 0, 1); |
1891 |
node = getASTNode(compilationUnit, 0, 1); |
1890 |
assertEquals("Wrong node", ASTNode.METHOD_DECLARATION, node.getNodeType()); |
1892 |
assertEquals("Wrong node", ASTNode.METHOD_DECLARATION, node.getNodeType()); |
1891 |
MethodDeclaration methodDeclaration = (MethodDeclaration) node; |
1893 |
MethodDeclaration methodDeclaration = (MethodDeclaration) node; |
Lines 1894-1900
Link Here
|
1894 |
SingleVariableDeclaration declaration = (SingleVariableDeclaration) parameters.get(0); |
1896 |
SingleVariableDeclaration declaration = (SingleVariableDeclaration) parameters.get(0); |
1895 |
Type type = declaration.getType(); |
1897 |
Type type = declaration.getType(); |
1896 |
typeBinding = type.resolveBinding(); |
1898 |
typeBinding = type.resolveBinding(); |
1897 |
assertEquals("Wrong qualified name", "java.util.List<? extends test0065.X>", typeBinding.getQualifiedName()); |
1899 |
assertEquals("Wrong qualified name", "java.util.List<? extends test0065.X<?,?>>", typeBinding.getQualifiedName()); |
1898 |
} |
1900 |
} |
1899 |
|
1901 |
|
1900 |
/* |
1902 |
/* |
Lines 1908-1914
Link Here
|
1908 |
"public class X<T> {\n" + |
1910 |
"public class X<T> {\n" + |
1909 |
" /*start*/X/*end*/ field;" + |
1911 |
" /*start*/X/*end*/ field;" + |
1910 |
"}", |
1912 |
"}", |
1911 |
this.workingCopy); |
1913 |
this.workingCopy, |
|
|
1914 |
false); |
1912 |
IBinding binding = ((Type) node).resolveBinding(); |
1915 |
IBinding binding = ((Type) node).resolveBinding(); |
1913 |
assertBindingKeyEquals( |
1916 |
assertBindingKeyEquals( |
1914 |
"Lp/X<>;", |
1917 |
"Lp/X<>;", |
Lines 2412-2419
Link Here
|
2412 |
assertNotNull(result); |
2415 |
assertNotNull(result); |
2413 |
assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT); |
2416 |
assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT); |
2414 |
CompilationUnit compilationUnit = (CompilationUnit) result; |
2417 |
CompilationUnit compilationUnit = (CompilationUnit) result; |
2415 |
String expectedOutput = "Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized"; |
2418 |
String expectedOutput = |
2416 |
assertProblemsSize(compilationUnit, 1, expectedOutput); |
2419 |
"Class is a raw type. References to generic type Class<T> should be parameterized\n" + |
|
|
2420 |
"Class is a raw type. References to generic type Class<T> should be parameterized\n" + |
2421 |
"Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized\n" + |
2422 |
"Y is a raw type. References to generic type Y<T> should be parameterized"; |
2423 |
assertProblemsSize(compilationUnit, 4, expectedOutput); |
2417 |
ASTNode node = getASTNode(compilationUnit, 1, 0, 0); |
2424 |
ASTNode node = getASTNode(compilationUnit, 1, 0, 0); |
2418 |
assertEquals("Not a method declaration", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); |
2425 |
assertEquals("Not a method declaration", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); |
2419 |
VariableDeclarationStatement statement = (VariableDeclarationStatement) node; |
2426 |
VariableDeclarationStatement statement = (VariableDeclarationStatement) node; |
Lines 2440-2446
Link Here
|
2440 |
assertNotNull(result); |
2447 |
assertNotNull(result); |
2441 |
assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT); |
2448 |
assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT); |
2442 |
CompilationUnit compilationUnit = (CompilationUnit) result; |
2449 |
CompilationUnit compilationUnit = (CompilationUnit) result; |
2443 |
assertProblemsSize(compilationUnit, 0); |
2450 |
String expectedOutput = |
|
|
2451 |
"Gen is a raw type. References to generic type Gen<X> should be parameterized\n" + |
2452 |
"Gen.Inn is a raw type. References to generic type Gen<X>.Inn should be parameterized"; |
2453 |
assertProblemsSize(compilationUnit, 2, expectedOutput); |
2444 |
ASTNode node = getASTNode(compilationUnit, 0); |
2454 |
ASTNode node = getASTNode(compilationUnit, 0); |
2445 |
assertEquals("Not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType()); |
2455 |
assertEquals("Not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType()); |
2446 |
TypeDeclaration typeDeclaration = (TypeDeclaration) node; |
2456 |
TypeDeclaration typeDeclaration = (TypeDeclaration) node; |
Lines 3472-3478
Link Here
|
3472 |
"public class X<E> {\n" + |
3482 |
"public class X<E> {\n" + |
3473 |
" /*start*/X<String>/*end*/ field;\n" + |
3483 |
" /*start*/X<String>/*end*/ field;\n" + |
3474 |
"}", |
3484 |
"}", |
3475 |
this.workingCopy); |
3485 |
this.workingCopy, |
|
|
3486 |
false); |
3476 |
ITypeBinding binding = type.resolveBinding().getTypeDeclaration(); |
3487 |
ITypeBinding binding = type.resolveBinding().getTypeDeclaration(); |
3477 |
assertBindingEquals( |
3488 |
assertBindingEquals( |
3478 |
"LX<TE;>;", |
3489 |
"LX<TE;>;", |
Lines 3488-3494
Link Here
|
3488 |
"public class X<E> {\n" + |
3499 |
"public class X<E> {\n" + |
3489 |
" /*start*/X/*end*/ field;\n" + |
3500 |
" /*start*/X/*end*/ field;\n" + |
3490 |
"}", |
3501 |
"}", |
3491 |
this.workingCopy); |
3502 |
this.workingCopy, |
|
|
3503 |
false); |
3492 |
ITypeBinding binding = type.resolveBinding().getTypeDeclaration(); |
3504 |
ITypeBinding binding = type.resolveBinding().getTypeDeclaration(); |
3493 |
assertBindingEquals( |
3505 |
assertBindingEquals( |
3494 |
"LX<TE;>;", |
3506 |
"LX<TE;>;", |
Lines 3581-3587
Link Here
|
3581 |
"public class X<E> {\n" + |
3593 |
"public class X<E> {\n" + |
3582 |
" /*start*/X/*end*/ field;\n" + |
3594 |
" /*start*/X/*end*/ field;\n" + |
3583 |
"}", |
3595 |
"}", |
3584 |
this.workingCopy); |
3596 |
this.workingCopy, |
|
|
3597 |
false); |
3585 |
ITypeBinding binding = type.resolveBinding().getErasure(); |
3598 |
ITypeBinding binding = type.resolveBinding().getErasure(); |
3586 |
assertBindingEquals( |
3599 |
assertBindingEquals( |
3587 |
"LX<TE;>;", |
3600 |
"LX<TE;>;", |
Lines 4430-4440
Link Here
|
4430 |
"}"; |
4443 |
"}"; |
4431 |
ASTNode node = buildAST( |
4444 |
ASTNode node = buildAST( |
4432 |
contents, |
4445 |
contents, |
4433 |
this.workingCopy); |
4446 |
this.workingCopy, |
|
|
4447 |
false); |
4434 |
assertNotNull("No node", node); |
4448 |
assertNotNull("No node", node); |
4435 |
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); |
4449 |
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); |
4436 |
CompilationUnit compilationUnit = (CompilationUnit) node; |
4450 |
CompilationUnit compilationUnit = (CompilationUnit) node; |
4437 |
assertProblemsSize(compilationUnit, 0); |
4451 |
assertProblemsSize(compilationUnit, 1, "Iterator is a raw type. References to generic type Iterator<E> should be parameterized"); |
4438 |
node = getASTNode(compilationUnit, 0, 0, 0); |
4452 |
node = getASTNode(compilationUnit, 0, 0, 0); |
4439 |
assertEquals("not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); |
4453 |
assertEquals("not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); |
4440 |
VariableDeclarationStatement statement = (VariableDeclarationStatement) node; |
4454 |
VariableDeclarationStatement statement = (VariableDeclarationStatement) node; |
Lines 5317-5323
Link Here
|
5317 |
"}\n"; |
5331 |
"}\n"; |
5318 |
ASTNode node = buildAST( |
5332 |
ASTNode node = buildAST( |
5319 |
contents, |
5333 |
contents, |
5320 |
this.workingCopy); |
5334 |
this.workingCopy, |
|
|
5335 |
false); |
5321 |
ITypeBinding type = ((Expression)node).resolveTypeBinding(); |
5336 |
ITypeBinding type = ((Expression)node).resolveTypeBinding(); |
5322 |
assertTrue("Should be one bound", type.getTypeBounds().length == 1); |
5337 |
assertTrue("Should be one bound", type.getTypeBounds().length == 1); |
5323 |
assertEquals("Invalid bound", "java.util.Collection", type.getTypeBounds()[0].getBinaryName()); |
5338 |
assertEquals("Invalid bound", "java.util.Collection", type.getTypeBounds()[0].getBinaryName()); |
Lines 5360-5366
Link Here
|
5360 |
"}\n"; |
5375 |
"}\n"; |
5361 |
ASTNode node = buildAST( |
5376 |
ASTNode node = buildAST( |
5362 |
contents, |
5377 |
contents, |
5363 |
this.workingCopy); |
5378 |
this.workingCopy, |
|
|
5379 |
false); |
5364 |
ITypeBinding type = ((Expression)node).resolveTypeBinding(); |
5380 |
ITypeBinding type = ((Expression)node).resolveTypeBinding(); |
5365 |
assertTrue("Should be one bound", type.getTypeBounds().length == 1); |
5381 |
assertTrue("Should be one bound", type.getTypeBounds().length == 1); |
5366 |
assertEquals("Invalid bound", "java.util.Collection", type.getTypeBounds()[0].getBinaryName()); |
5382 |
assertEquals("Invalid bound", "java.util.Collection", type.getTypeBounds()[0].getBinaryName()); |
Lines 5603-5609
Link Here
|
5603 |
final ASTNode result = runJLS3Conversion(sourceUnit, true, true); |
5619 |
final ASTNode result = runJLS3Conversion(sourceUnit, true, true); |
5604 |
assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT); |
5620 |
assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.COMPILATION_UNIT); |
5605 |
final CompilationUnit compilationUnit = (CompilationUnit) result; |
5621 |
final CompilationUnit compilationUnit = (CompilationUnit) result; |
5606 |
assertProblemsSize(compilationUnit, 1, "Type safety: The expression of type ArrayList needs unchecked conversion to conform to List<String>"); |
5622 |
assertProblemsSize(compilationUnit, 2, "Type safety: The expression of type ArrayList needs unchecked conversion to conform to List<String>\n" + |
|
|
5623 |
"ArrayList is a raw type. References to generic type ArrayList<T> should be parameterized"); |
5607 |
} |
5624 |
} |
5608 |
|
5625 |
|
5609 |
/* |
5626 |
/* |
Lines 5645-5651
Link Here
|
5645 |
"}"; |
5662 |
"}"; |
5646 |
ASTNode node = buildAST( |
5663 |
ASTNode node = buildAST( |
5647 |
contents, |
5664 |
contents, |
5648 |
this.workingCopy); |
5665 |
this.workingCopy, |
|
|
5666 |
false); |
5649 |
assertEquals("Not a type parameter", ASTNode.TYPE_PARAMETER, node.getNodeType()); |
5667 |
assertEquals("Not a type parameter", ASTNode.TYPE_PARAMETER, node.getNodeType()); |
5650 |
ITypeBinding typeBinding = ((TypeParameter) node).resolveBinding(); |
5668 |
ITypeBinding typeBinding = ((TypeParameter) node).resolveBinding(); |
5651 |
assertNotNull("No binding", typeBinding); |
5669 |
assertNotNull("No binding", typeBinding); |
Lines 5690-5696
Link Here
|
5690 |
" return null;\n" + |
5708 |
" return null;\n" + |
5691 |
" }\n" + |
5709 |
" }\n" + |
5692 |
"}", |
5710 |
"}", |
5693 |
this.workingCopy); |
5711 |
this.workingCopy, |
|
|
5712 |
false); |
5694 |
MethodInvocation method = (MethodInvocation) node; |
5713 |
MethodInvocation method = (MethodInvocation) node; |
5695 |
IMethodBinding methodBinding = method.resolveMethodBinding(); |
5714 |
IMethodBinding methodBinding = method.resolveMethodBinding(); |
5696 |
assertBindingEquals( |
5715 |
assertBindingEquals( |
Lines 5747-5753
Link Here
|
5747 |
"}"; |
5766 |
"}"; |
5748 |
ASTNode node = buildAST( |
5767 |
ASTNode node = buildAST( |
5749 |
contents, |
5768 |
contents, |
5750 |
this.workingCopy); |
5769 |
this.workingCopy, |
|
|
5770 |
false); |
5751 |
assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); |
5771 |
assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); |
5752 |
VariableDeclarationStatement statement = (VariableDeclarationStatement) node; |
5772 |
VariableDeclarationStatement statement = (VariableDeclarationStatement) node; |
5753 |
List modifiers = statement.modifiers(); |
5773 |
List modifiers = statement.modifiers(); |
Lines 5821-5827
Link Here
|
5821 |
"}"; |
5841 |
"}"; |
5822 |
ASTNode node = buildAST( |
5842 |
ASTNode node = buildAST( |
5823 |
contents, |
5843 |
contents, |
5824 |
this.workingCopy); |
5844 |
this.workingCopy, |
|
|
5845 |
false); |
5825 |
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); |
5846 |
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); |
5826 |
CompilationUnit unit = (CompilationUnit) node; |
5847 |
CompilationUnit unit = (CompilationUnit) node; |
5827 |
node = getASTNode(unit, 0, 0, 2); |
5848 |
node = getASTNode(unit, 0, 0, 2); |
Lines 5848-5854
Link Here
|
5848 |
"}"; |
5869 |
"}"; |
5849 |
ASTNode node = buildAST( |
5870 |
ASTNode node = buildAST( |
5850 |
contents, |
5871 |
contents, |
5851 |
this.workingCopy); |
5872 |
this.workingCopy, |
|
|
5873 |
false); |
5852 |
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); |
5874 |
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); |
5853 |
CompilationUnit unit = (CompilationUnit) node; |
5875 |
CompilationUnit unit = (CompilationUnit) node; |
5854 |
node = getASTNode(unit, 0, 0, 2); |
5876 |
node = getASTNode(unit, 0, 0, 2); |
Lines 6759-6767
Link Here
|
6759 |
false); |
6781 |
false); |
6760 |
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); |
6782 |
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); |
6761 |
CompilationUnit unit = (CompilationUnit) node; |
6783 |
CompilationUnit unit = (CompilationUnit) node; |
6762 |
String expectedOutput = "Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized\n" + |
6784 |
String expectedOutput = |
6763 |
"Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized"; |
6785 |
"Class is a raw type. References to generic type Class<T> should be parameterized\n" + |
6764 |
assertProblemsSize(unit, 2, expectedOutput); |
6786 |
"Class is a raw type. References to generic type Class<T> should be parameterized\n" + |
|
|
6787 |
"Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized\n" + |
6788 |
"Y is a raw type. References to generic type Y<T> should be parameterized\n" + |
6789 |
"Class is a raw type. References to generic type Class<T> should be parameterized\n" + |
6790 |
"Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized\n" + |
6791 |
"Y is a raw type. References to generic type Y<T> should be parameterized"; |
6792 |
assertProblemsSize(unit, 7, expectedOutput); |
6765 |
node = getASTNode(unit, 1, 0, 0); |
6793 |
node = getASTNode(unit, 1, 0, 0); |
6766 |
assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); |
6794 |
assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); |
6767 |
VariableDeclarationStatement statement = (VariableDeclarationStatement) node; |
6795 |
VariableDeclarationStatement statement = (VariableDeclarationStatement) node; |
Lines 6807-6813
Link Here
|
6807 |
false); |
6835 |
false); |
6808 |
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); |
6836 |
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); |
6809 |
CompilationUnit unit = (CompilationUnit) node; |
6837 |
CompilationUnit unit = (CompilationUnit) node; |
6810 |
assertProblemsSize(unit, 0); |
6838 |
String expectedOutput = |
|
|
6839 |
"Generic is a raw type. References to generic type Generic<E> should be parameterized\n" + |
6840 |
"Collection is a raw type. References to generic type Collection<T> should be parameterized"; |
6841 |
assertProblemsSize(unit, 2, expectedOutput); |
6811 |
node = getASTNode(unit, 1, 0); |
6842 |
node = getASTNode(unit, 1, 0); |
6812 |
assertEquals("Not a field declaration", ASTNode.FIELD_DECLARATION, node.getNodeType()); |
6843 |
assertEquals("Not a field declaration", ASTNode.FIELD_DECLARATION, node.getNodeType()); |
6813 |
FieldDeclaration fieldDeclaration = (FieldDeclaration) node; |
6844 |
FieldDeclaration fieldDeclaration = (FieldDeclaration) node; |