skip to main content
10.1145/1706356.1706360acmconferencesArticle/Chapter ViewAbstractPublication PagespepmConference Proceedingsconference-collections
research-article

Corrective hints for type incorrect generic Java programs

Published: 18 January 2010 Publication History

Abstract

Since version 1.5, generics (parametric polymorphism) are part of the Java language. Experience with implementations of the Java Language Specification such as EJC and JAVAC has shown that the type error messages provided by these tools leave more than a little to be desired. Type error messages are often uninformative and sometimes show artifacts of the type checking process in the messages. Apparently, providing good type error messages for a language as large and complex as Java currently is, is not easy.
To alleviate the problem, we describe a number of heuristics that suggest fixes for generic method invocations in Generic Java, and illustrate their effect by means of examples. The heuristics are part of an extension to the original type checking process that has been implemented into the JastAdd Extensible Java Compiler.

References

[1]
T. Ekman and G. Hedin. JastAdd Extensible Java Compiler. http://jastadd.cs.lth.se/web/extjava.
[2]
N. el Boustani. Improving type error messages for generic java, 2008. http://www.cs.uu.nl/wiki/Hage/MasterStudents.
[3]
N. el Boustani and J. Hage. Improving type error messages for Generic Java. In G. Puebla and G. Vidal, editors, Proceedings of the ACM SIGPLAN 2009 Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM '09), pages 131--140. ACM Press, 2009.
[4]
M. Odersky et al. The Scala homepage, 2008. http://www.scala-lang.org/.
[5]
J. Gosling, B. Joy, G. Steele, and G. Bracha. Java(TM) Language Specification, The Third Edition. Addison-Wesley Professional, 2005.
[6]
J. Hage and B. Heeren. Heuristics for type error discovery and recovery. In Z. Horváth, V. Zsók, and A. Butterfield, editors, Implementation of Functional Languages -- IFL 2006, volume 4449, pages 199--216, Heidelberg, 2007. Springer Verlag.
[7]
G. Hedin and E. Magnusson. The JastAdd system -- an aspect-oriented compiler construction system. Science of Computer Programming, 47(1):37--58, April 2003. http://www.cs.lth.se/~gorel/publications/2003-JastAdd-SCP-Preprint.pdf.
[8]
B. Heeren. Top Quality Type Error Messages. PhD thesis, Universiteit Utrecht, The Netherlands, 2005. http://www.cs.uu.nl/people/bastiaan/phdthesis.
[9]
M.C. Jadud. A first look at novice compilation behaviour using BlueJ. Computer Science Education, 15(1):25--40, March 2005.
[10]
B. Lerner, D. Grossman, and C. Chambers. Seminal: searching for ml type-error messages. In ML '06: Proceedings of the 2006 workshop on ML, pages 63--73, New York, NY, USA, 2006. ACM.
[11]
J. Nordlander, M. Carlsson, A. Gill, P. Lindgren, and B. von Sydow. The Timber homepage, 2008. http://www.timber-lang.org.
[12]
Stuart Russell and Peter Norvig. Artificial Intelligence: A Modern Approach, chapter 5, pages 137--151. Pearson Education, second edition, 2003.
[13]
D. Smith and R. Cartwright. Java type inference is broken: Can we x it? In Proceedings of the 23rd Conference on Object-oriented programming, systems, languages, and applications (OOPSLA '08), pages 505--524, New York, NY, USA, 2008. ACM.
[14]
J.A. Walz and G.F. Johnson. A maximum flow approach to anomaly isolation in unification-based incremental type inference. In Conference Record of the 13th Annual ACM Symposium on Principles of Programming Languages, pages 44--57, St. Petersburg, FL, January 1986.

Cited By

View all
  • (2019)Type errors for the IDE with Xtext and XsemanticsOpen Computer Science10.1515/comp-2019-00039:1(52-79)Online publication date: 26-Mar-2019
  • (2019)Compiler Error Messages Considered UnhelpfulProceedings of the Working Group Reports on Innovation and Technology in Computer Science Education10.1145/3344429.3372508(177-210)Online publication date: 18-Dec-2019
  • (2017)SkalpelJournal of Symbolic Computation10.1016/j.jsc.2016.07.01380:P1(164-208)Online publication date: 1-May-2017
  • Show More Cited By

Index Terms

  1. Corrective hints for type incorrect generic Java programs

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    PEPM '10: Proceedings of the 2010 ACM SIGPLAN workshop on Partial evaluation and program manipulation
    January 2010
    168 pages
    ISBN:9781605587271
    DOI:10.1145/1706356
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 18 January 2010

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. compilers
    2. error correcting
    3. error reporting
    4. heuristics
    5. java generics
    6. type checking

    Qualifiers

    • Research-article

    Conference

    PEPM '10
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 66 of 120 submissions, 55%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)5
    • Downloads (Last 6 weeks)1
    Reflects downloads up to 27 Feb 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2019)Type errors for the IDE with Xtext and XsemanticsOpen Computer Science10.1515/comp-2019-00039:1(52-79)Online publication date: 26-Mar-2019
    • (2019)Compiler Error Messages Considered UnhelpfulProceedings of the Working Group Reports on Innovation and Technology in Computer Science Education10.1145/3344429.3372508(177-210)Online publication date: 18-Dec-2019
    • (2017)SkalpelJournal of Symbolic Computation10.1016/j.jsc.2016.07.01380:P1(164-208)Online publication date: 1-May-2017
    • (2014)Security type error diagnosis for higher-order, polymorphic languagesScience of Computer Programming10.1016/j.scico.2014.03.01195:P2(200-218)Online publication date: 1-Dec-2014
    • (2013)Security type error diagnosis for higher-order, polymorphic languagesProceedings of the ACM SIGPLAN 2013 workshop on Partial evaluation and program manipulation10.1145/2426890.2426894(3-12)Online publication date: 21-Jan-2013
    • (2011)Improving type error messages for generic JavaHigher-Order and Symbolic Computation10.1007/s10990-011-9070-324:1-2(3-39)Online publication date: 1-Jun-2011

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media