Improving type error messages for generic java

Nabil El Boustani, Jurriaan Hage

    Research output: Chapter in Book/Report/Conference proceedingConference contributionAcademicpeer-review

    Abstract

    Since version 1.5, generics (parametric polymorphism) are part of the Java language. However, adding parametric polymorphism to a language that is built on inclusion polymorphism can be confusing to a novice programmer, because the typing rules are suddenly different and, in the case of Generic Java, quite complex. Indeed, the main Java compilers, Eclipse's EJC compiler and Sun's JAVAC, do not even accept the same set of programs. Moreover, experience with these compilers shows that the error messages provided by them leave more than a little to be desired. To alleviate the latter problem, we describe how to adapt the type inference process of Java to obtain better error diagnostics for generic method invocations. The extension has been implemented into the JastAdd extensible Java compiler.

    Original languageEnglish
    Title of host publicationProceedings of the 2009 ACM SIGPLAN Symposium on Partial Evaluation and Program Manipulation, PEPM'09
    Pages131-140
    Number of pages10
    DOIs
    Publication statusPublished - 2009
    Event2009 ACM SIGPLAN Symposium on Partial Evaluation and Program Manipulation, PEPM'09 - Savannah, GA, United States
    Duration: 19 Jan 200920 Jan 2009

    Publication series

    NameProceedings of the 2009 ACM SIGPLAN Symposium on Partial Evaluation and Program Manipulation, PEPM'09

    Conference

    Conference2009 ACM SIGPLAN Symposium on Partial Evaluation and Program Manipulation, PEPM'09
    Country/TerritoryUnited States
    CitySavannah, GA
    Period19/01/0920/01/09

    Keywords

    • Compilers
    • Error reporting
    • Java generics
    • Type Checking

    Fingerprint

    Dive into the research topics of 'Improving type error messages for generic java'. Together they form a unique fingerprint.

    Cite this