COOKIES: By using this website you agree that we can place Google Analytics Cookies on your device for performance monitoring. |
University of Cambridge > Talks.cam > Computer Laboratory Programming Research Group Seminar > Using the OpenJDK to investigate covariance in Java
Using the OpenJDK to investigate covariance in JavaAdd to your list(s) Download to your calendar using vCal
If you have a question about this talk, please contact Dominic Orchard. Note unusual day and time. The Java type system is unsafe since it allows covariant use of arrays. For example, an array of Bananas can be used where an array of Fruit is expected, given that Banana is a subclass of Fruit. This allows the following unsafe code: Banana[] bananas = new Banana[ 5 ]; Fruit[] fruits = bananas; fruits[ 0 ] = new Apple(); // runtime exception bananas[ 0 ]; // Apple? In the above example, the programmer gets back an Apple where he was expecting Bananas, causing an undesired runtime exception. We investigate the covariant use of arrays in open source Java programs to see whether programmers use this problematic feature of Java. We make use of the freely available OpenJDK, modifying its Java compiler to disallow covariant use of arrays, thus reporting any such uses as compile errors. We apply this compiler to a code corpus of 106 open source programs, including large and well-known programs such as Eclipse, JUnit and Ant. Initial results of our investigation show that covariance is rarely used outside the context of legacy code and Java libraries. This leads us to question its relevance in the Java language. In our talk, we also discuss solutions to covariance taken by other languages such as Scala and Google Dart, explain our modifications to the OpenJDK Java compiler and report the full results of our study. This talk is part of the Computer Laboratory Programming Research Group Seminar series. This talk is included in these lists:
Note that ex-directory lists are not shown. |
Other listsType the title of a new list here Cambridge University Student Pugwash Society Recommendations (not affiliated) All Talks (aka the CURE list)Other talksDataFlow SuperComputing for BigData Designer Babies or Children of Frankenstein? Genome Editing and its Side Effects Disaggregating goods Evolution’s Bite: Dental evidence for the diets of our distant ancestors Development of a Broadly-Neutralising Vaccine against Blood-Stage P. falciparum Malaria On being a "barang": Experiences of interviewing fishermen in Cambodia and Indonesia Discovering regulators of insulin output with flies and human islets: implications for diabetes and pancreas cancer Animal Migration Scale and anisotropic effects in necking of metallic tensile specimens Dynamics of Phenotypic and Genomic Evolution in a Long-Term Experiment with E. coli Alzheimer's talks Hydrogen-Deuterium Exchange Mass Spectrometry |