An Entity of Type: language, from Named Graph: http://dbpedia.org, within Data Space: dbpedia.org:8891

In the Java programming language, heap pollution is a situation that arises when a variable of a parameterized type refers to an object that is not of that parameterized type. This situation is normally detected during compilation and indicated with an unchecked warning. Later, during runtime heap pollution will often cause a ClassCastException. Heap Pollution in a non-varargs context

Property Value
dbo:abstract
  • In the Java programming language, heap pollution is a situation that arises when a variable of a parameterized type refers to an object that is not of that parameterized type. This situation is normally detected during compilation and indicated with an unchecked warning. Later, during runtime heap pollution will often cause a ClassCastException. A source of heap pollution in Java arises from the fact that type arguments and variables are not reified at run-time. As a result, different parameterized types are implemented by the same class or interface at run time. Indeed, all invocations of a given generic type declaration share a single run-time implementation. This results in the possibility of heap pollution. Under certain conditions, it is possible that a variable of a parameterized type refers to an object that is not of that parameterized type. The variable will always refer to an object that is an instance of a class that implements the parameterized type. Heap Pollution in a non-varargs context public class HeapPollutionDemo{ public static void main(String[] args) { Set s = new TreeSet<Integer>; Set<String> ss = s; // unchecked warning s.add(new Integer(42)); // another unchecked warning Iterator<String> iter = ss.iterator; while (iter.hasNext) { String str = iter.next; // ClassCastException thrown System.out.println(str); } }} (en)
dbo:wikiPageExternalLink
dbo:wikiPageID
  • 15399561 (xsd:integer)
dbo:wikiPageLength
  • 3825 (xsd:nonNegativeInteger)
dbo:wikiPageRevisionID
  • 1001954820 (xsd:integer)
dbo:wikiPageWikiLink
dbp:wikiPageUsesTemplate
dcterms:subject
gold:hypernym
rdf:type
rdfs:comment
  • In the Java programming language, heap pollution is a situation that arises when a variable of a parameterized type refers to an object that is not of that parameterized type. This situation is normally detected during compilation and indicated with an unchecked warning. Later, during runtime heap pollution will often cause a ClassCastException. Heap Pollution in a non-varargs context (en)
rdfs:label
  • Heap pollution (en)
owl:sameAs
prov:wasDerivedFrom
foaf:isPrimaryTopicOf
is dbo:wikiPageRedirects of
is dbo:wikiPageWikiLink of
is foaf:primaryTopic of
Powered by OpenLink Virtuoso    This material is Open Knowledge     W3C Semantic Web Technology     This material is Open Knowledge    Valid XHTML + RDFa
This content was extracted from Wikipedia and is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License