| 1 |
import java.util.ArrayList; |
| 2 |
import java.util.Calendar; |
| 3 |
|
| 4 |
class Component {} |
| 5 |
|
| 6 |
class Components extends ArrayList {} |
| 7 |
|
| 8 |
// If we include a type parameter in the superclass, then there |
| 9 |
// is no error below. |
| 10 |
// class Components extends ArrayList<Component> {} |
| 11 |
|
| 12 |
public class RawTypeAssignment { |
| 13 |
static Components getComponents() { |
| 14 |
return new Components(); |
| 15 |
} |
| 16 |
|
| 17 |
static void addTimes(Calendar calendar) { |
| 18 |
// Type systems may issue an error below because of a mismatch between the type arguments. |
| 19 |
@SuppressWarnings("assignment.type.incompatible") |
| 20 |
// :: warning: [unchecked] unchecked conversion |
| 21 |
ArrayList<Component> clist = getComponents(); |
| 22 |
clist.get(0); |
| 23 |
} |
| 24 |
} |