{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,10,21]],"date-time":"2026-10-21T01:45:19Z","timestamp":1792547119206,"version":"4.5.0"},"reference-count":79,"publisher":"Association for Computing Machinery (ACM)","issue":"OOPSLA","license":[{"start":{"date-parts":[[2019,10,10]],"date-time":"2019-10-10T00:00:00Z","timestamp":1570665600000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"DOI":"10.13039\/501100001711","name":"Schweizerischer Nationalfonds zur F\u00f6rderung der Wissenschaftlichen Forschung","doi-asserted-by":"crossref","award":["CRSII2_136225 \/ 2"],"award-info":[{"award-number":["CRSII2_136225 \/ 2"]}],"id":[{"id":"10.13039\/501100001711","id-type":"DOI","asserted-by":"crossref"}]}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2019,10,10]]},"abstract":"<jats:p>The main goal of a static type system is to prevent certain kinds of errors from happening at run time. A type system is formulated as a set of constraints that gives any expression or term in a program a well-defined type. Yet mainstream programming languages are endowed with type systems that provide the means to circumvent their constraints through casting.<\/jats:p>\n          <jats:p>We want to understand how and when developers escape the static type system to use dynamic typing. We empirically study how casting is used by developers in more than seven thousand Java projects. We find that casts are widely used (8.7% of methods contain at least one cast) and that 50% of casts we inspected are not guarded locally to ensure against potential run-time errors.<\/jats:p>\n          <jats:p>To help us better categorize use cases and thus understand how casts are used in practice, we identify 25 cast-usage patterns---recurrent programming idioms using casts to solve a specific issue. This knowledge can be: (a) a recommendation for current and future language designers to make informed decisions (b) a reference for tool builders, e.g., by providing more precise or new refactoring analyses, (c) a guide for researchers to test new language features, or to carry out controlled programming experiments, and (d) a guide for developers for better practices.<\/jats:p>","DOI":"10.1145\/3360584","type":"journal-article","created":{"date-parts":[[2019,10,11]],"date-time":"2019-10-11T14:53:33Z","timestamp":1570805613000},"page":"1-31","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":12,"title":["Casting about in the dark: an empirical study of cast operations in Java programs"],"prefix":"10.1145","volume":"3","author":[{"given":"Luis","family":"Mastrangelo","sequence":"first","affiliation":[{"name":"USI Lugano, Switzerland"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Matthias","family":"Hauswirth","sequence":"additional","affiliation":[{"name":"USI Lugano, Switzerland"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Nathaniel","family":"Nystrom","sequence":"additional","affiliation":[{"name":"USI Lugano, Switzerland"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2019,10,10]]},"reference":[{"key":"e_1_2_2_1_1","doi-asserted-by":"publisher","DOI":"10.1109\/MSR.2013.6624029"},{"key":"e_1_2_2_2_1","doi-asserted-by":"publisher","DOI":"10.1145\/1993498.1993569"},{"key":"e_1_2_2_3_1","doi-asserted-by":"publisher","DOI":"10.4230\/LIPIcs.ECOOP.2016.2"},{"key":"e_1_2_2_4_1","doi-asserted-by":"publisher","DOI":"10.1109\/SUITE.2009.5070010"},{"key":"e_1_2_2_5_1","unstructured":"Gavin Bierman. 2019. JEP 354: Switch Expressions. (2019). https:\/\/openjdk.java.net\/jeps\/354  Gavin Bierman. 2019. JEP 354: Switch Expressions. (2019). https:\/\/openjdk.java.net\/jeps\/354"},{"key":"e_1_2_2_6_1","doi-asserted-by":"crossref","unstructured":"Martin Bravenboer and Yannis Smaragdakis. 2009. Exception Analysis and Points-to Analysis: Better Together. (2009) 11.  Martin Bravenboer and Yannis Smaragdakis. 2009. Exception Analysis and Points-to Analysis: Better Together. (2009) 11.","DOI":"10.1145\/1572272.1572274"},{"key":"e_1_2_2_7_1","doi-asserted-by":"publisher","DOI":"10.1016\/S1571-0661(04)80799-0"},{"key":"e_1_2_2_8_1","doi-asserted-by":"publisher","DOI":"10.1007\/s10664-012-9203-2"},{"key":"e_1_2_2_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/99370.99392"},{"key":"e_1_2_2_10_1","doi-asserted-by":"publisher","DOI":"10.1145\/1086365.1086397"},{"key":"e_1_2_2_11_1","doi-asserted-by":"publisher","DOI":"10.5555\/2820518.2820536"},{"key":"e_1_2_2_12_1","doi-asserted-by":"publisher","DOI":"10.1145\/1167473.1167481"},{"key":"e_1_2_2_13_1","doi-asserted-by":"publisher","DOI":"10.1145\/3030207.3030221"},{"key":"e_1_2_2_14_1","doi-asserted-by":"publisher","DOI":"10.1145\/2771783.2771787"},{"key":"e_1_2_2_15_1","doi-asserted-by":"publisher","DOI":"10.1109\/SCAM.2007.31"},{"key":"e_1_2_2_16_1","doi-asserted-by":"publisher","DOI":"10.1145\/2093157.2093168"},{"key":"e_1_2_2_17_1","doi-asserted-by":"publisher","DOI":"10.1109\/CSMR-WCRE.2014.6747226"},{"key":"e_1_2_2_18_1","doi-asserted-by":"publisher","DOI":"10.4230\/LIPIcs.ECOOP.2017.9"},{"key":"e_1_2_2_19_1","doi-asserted-by":"publisher","DOI":"10.5381\/jot.2017.16.4.a1"},{"key":"e_1_2_2_20_1","doi-asserted-by":"publisher","DOI":"10.1109\/Metrisec.2011.18"},{"key":"e_1_2_2_21_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE.2013.6606588"},{"key":"e_1_2_2_22_1","doi-asserted-by":"publisher","DOI":"10.1145\/2568225.2568295"},{"key":"e_1_2_2_23_1","doi-asserted-by":"publisher","DOI":"10.1145\/2517208.2517226"},{"key":"e_1_2_2_24_1","doi-asserted-by":"publisher","DOI":"10.7146\/dpb.v29i549.7654"},{"key":"e_1_2_2_25_1","doi-asserted-by":"publisher","DOI":"10.1007\/3-540-45337-7_17"},{"key":"e_1_2_2_26_1","doi-asserted-by":"publisher","DOI":"10.1145\/3213846.3213864"},{"key":"e_1_2_2_27_1","unstructured":"Brian Goetz. 2017a. JEP 305: Pattern Matching for instanceof (Preview). (2017). https:\/\/openjdk.java.net\/jeps\/305  Brian Goetz. 2017a. JEP 305: Pattern Matching for instanceof (Preview). (2017). https:\/\/openjdk.java.net\/jeps\/305"},{"key":"e_1_2_2_28_1","unstructured":"Brian Goetz. 2017b. JEP 325: Switch Expressions (Preview). (2017). https:\/\/openjdk.java.net\/jeps\/325  Brian Goetz. 2017b. JEP 325: Switch Expressions (Preview). (2017). https:\/\/openjdk.java.net\/jeps\/325"},{"key":"e_1_2_2_29_1","unstructured":"Brian Goetz. 2018. JEP 286: Local-Variable Type Inference. (2018). https:\/\/openjdk.java.net\/jeps\/286  Brian Goetz. 2018. JEP 286: Local-Variable Type Inference. (2018). https:\/\/openjdk.java.net\/jeps\/286"},{"key":"e_1_2_2_30_1","doi-asserted-by":"publisher","DOI":"10.1145\/2568225.2568276"},{"key":"e_1_2_2_31_1","doi-asserted-by":"publisher","DOI":"10.1145\/1852786.1852801"},{"key":"e_1_2_2_32_1","doi-asserted-by":"publisher","DOI":"10.1145\/2594291.2594308"},{"key":"e_1_2_2_33_1","doi-asserted-by":"publisher","DOI":"10.1145\/2483760.2483786"},{"key":"e_1_2_2_34_1","doi-asserted-by":"publisher","DOI":"10.1145\/1866307.1866339"},{"key":"e_1_2_2_35_1","doi-asserted-by":"publisher","DOI":"10.1145\/2597073.2597089"},{"key":"e_1_2_2_36_1","doi-asserted-by":"publisher","DOI":"10.1145\/1017472.1017488"},{"key":"e_1_2_2_37_1","volume-title":"Simon Peyton Jones, and Chung-chieh Shan","author":"Kiselyov Oleg","year":"2009","unstructured":"Oleg Kiselyov , Simon Peyton Jones, and Chung-chieh Shan . 2009 . Fun with type functions. https:\/\/www.microsoft.com\/enus\/research\/publication\/fun-type-functions\/ Oleg Kiselyov, Simon Peyton Jones, and Chung-chieh Shan. 2009. Fun with type functions. https:\/\/www.microsoft.com\/enus\/research\/publication\/fun-type-functions\/"},{"key":"e_1_2_2_38_1","doi-asserted-by":"publisher","DOI":"10.1109\/SCAM.2009.28"},{"key":"e_1_2_2_39_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE.2017.53"},{"key":"e_1_2_2_41_1","doi-asserted-by":"publisher","DOI":"10.1007\/11575467_11"},{"key":"e_1_2_2_42_1","doi-asserted-by":"publisher","DOI":"10.1145\/3133908"},{"key":"e_1_2_2_43_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-54807-9_12"},{"key":"e_1_2_2_45_1","doi-asserted-by":"publisher","DOI":"10.1145\/2814270.2814313"},{"key":"e_1_2_2_46_1","doi-asserted-by":"publisher","DOI":"10.1145\/3133909"},{"key":"e_1_2_2_47_1","doi-asserted-by":"publisher","DOI":"10.1145\/800055.802035"},{"key":"e_1_2_2_48_1","doi-asserted-by":"publisher","DOI":"10.1145\/2786805.2786834"},{"key":"e_1_2_2_49_1","doi-asserted-by":"publisher","DOI":"10.1007\/3-540-36579-6_11"},{"key":"e_1_2_2_50_1","doi-asserted-by":"publisher","DOI":"10.1145\/1167515.1167476"},{"key":"e_1_2_2_51_1","volume-title":"Proceedings of the Twelth International Workshop on Foundations of Object-Oriented Languages (FOOL \u201905)","author":"Odersky Martin","year":"2005","unstructured":"Martin Odersky and Matthias Zenger . 2005 . Independently Extensible Solutions to the Expression Problem . In Proceedings of the Twelth International Workshop on Foundations of Object-Oriented Languages (FOOL \u201905) . http:\/\/homepages.inf.ed.ac.uk\/wadler\/fool. Martin Odersky and Matthias Zenger. 2005. Independently Extensible Solutions to the Expression Problem. In Proceedings of the Twelth International Workshop on Foundations of Object-Oriented Languages (FOOL \u201905). http:\/\/homepages.inf.ed.ac.uk\/wadler\/fool."},{"key":"e_1_2_2_52_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-31057-7_2"},{"key":"e_1_2_2_53_1","doi-asserted-by":"publisher","DOI":"10.1145\/2951913.2951945"},{"key":"e_1_2_2_54_1","doi-asserted-by":"publisher","DOI":"10.4230\/LIPIcs.ECOOP.2018.14"},{"key":"e_1_2_2_55_1","doi-asserted-by":"publisher","DOI":"10.1109\/ASE.2013.6693086"},{"key":"e_1_2_2_56_1","doi-asserted-by":"publisher","DOI":"10.1109\/MSR.2015.69"},{"key":"e_1_2_2_57_1","doi-asserted-by":"publisher","DOI":"10.1145\/1985441.1985446"},{"key":"e_1_2_2_58_1","doi-asserted-by":"publisher","DOI":"10.1007\/s10664-012-9236-6"},{"key":"e_1_2_2_59_1","volume-title":"Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP\u201906)","author":"Jones Simon Peyton","year":"2006","unstructured":"Simon Peyton Jones , Dimitrios Vytiniotis , Stephanie Weirich , and Geoffrey Washburn . 2006 . Simple unification-based type inference for GADTs . In Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP\u201906) . ACM Press, 50\u015b61. https:\/\/www.microsoft.com\/en-us\/research\/publication\/simple-unification-based-type-inferencefor-gadts\/ Simon Peyton Jones, Dimitrios Vytiniotis, Stephanie Weirich, and Geoffrey Washburn. 2006. Simple unification-based type inference for GADTs. In Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP\u201906). ACM Press, 50\u015b61. https:\/\/www.microsoft.com\/en-us\/research\/publication\/simple-unification-based-type-inferencefor-gadts\/"},{"key":"e_1_2_2_60_1","doi-asserted-by":"publisher","DOI":"10.1109\/SANER.2016.66"},{"key":"e_1_2_2_61_1","volume-title":"Proceedings of the 25th European Conference on Object-Oriented Programming (ECOOP\u201911)","author":"Richards Gregor","year":"2011","unstructured":"Gregor Richards , Christian Hammer , Brian Burg , and Jan Vitek . 2011 . The Eval That Men Do: A Large-Scale Study of the Use of Eval in Javascript Applications . In Proceedings of the 25th European Conference on Object-Oriented Programming (ECOOP\u201911) . Springer-Verlag, Berlin, Heidelberg, 52\u015b78. Gregor Richards, Christian Hammer, Brian Burg, and Jan Vitek. 2011. The Eval That Men Do: A Large-Scale Study of the Use of Eval in Javascript Applications. In Proceedings of the 25th European Conference on Object-Oriented Programming (ECOOP\u201911). Springer-Verlag, Berlin, Heidelberg, 52\u015b78."},{"key":"e_1_2_2_62_1","doi-asserted-by":"publisher","DOI":"10.1145\/1806596.1806598"},{"key":"e_1_2_2_63_1","volume-title":"Siek and Walid Taha","author":"Jeremy","year":"2006","unstructured":"Jeremy G. Siek and Walid Taha . 2006 . Gradual Typing for Functional Languages. In Scheme and functional programming workshop. 81\u015b92. Jeremy G. Siek and Walid Taha. 2006. Gradual Typing for Functional Languages. In Scheme and functional programming workshop. 81\u015b92."},{"key":"e_1_2_2_64_1","doi-asserted-by":"publisher","DOI":"10.1145\/2047849.2047861"},{"key":"e_1_2_2_65_1","doi-asserted-by":"publisher","DOI":"10.1109\/APSEC.2010.46"},{"key":"e_1_2_2_66_1","doi-asserted-by":"publisher","DOI":"10.1109\/CSMR.2008.4493342"},{"key":"e_1_2_2_67_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE.2015.59"},{"key":"e_1_2_2_68_1","doi-asserted-by":"publisher","DOI":"10.1109\/TSE.2017.2653105"},{"key":"e_1_2_2_69_1","doi-asserted-by":"publisher","DOI":"10.1145\/2884781.2884849"},{"key":"e_1_2_2_70_1","doi-asserted-by":"publisher","DOI":"10.1145\/2414721.2414728"},{"key":"e_1_2_2_71_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-540-73589-2_4"},{"key":"e_1_2_2_72_1","volume-title":"Cordy","author":"Vinju Jurgen","year":"2006","unstructured":"Jurgen Vinju and James R . Cordy . 2006 . How to Make a Bridge between Transformation and Analysis Technologies?. In Transformation Techniques in Software Engineering (Dagstuhl Seminar Proceedings), James R. Cordy, Ralf L\u00e4mmel, and Andreas Winter (Eds.). Internationales Begegnungs- und Forschungszentrum f\u00fcr Informatik (IBFI), Schloss Dagstuhl, Germany, Dagstuhl, Germany . Jurgen Vinju and James R. Cordy. 2006. How to Make a Bridge between Transformation and Analysis Technologies?. In Transformation Techniques in Software Engineering (Dagstuhl Seminar Proceedings), James R. Cordy, Ralf L\u00e4mmel, and Andreas Winter (Eds.). Internationales Begegnungs- und Forschungszentrum f\u00fcr Informatik (IBFI), Schloss Dagstuhl, Germany, Dagstuhl, Germany."},{"key":"e_1_2_2_73_1","volume-title":"8th International Symposium, PADL","author":"Volder Kris De","year":"2006","unstructured":"Kris De Volder . 2006 . Jquery: A Generic Code Browser with a Declarative Configuration Language. In In Practical Aspects of Declarative Languages , 8th International Symposium, PADL 2006. Springer, 88\u015b102. Kris De Volder. 2006. Jquery: A Generic Code Browser with a Declarative Configuration Language. In In Practical Aspects of Declarative Languages, 8th International Symposium, PADL 2006. Springer, 88\u015b102."},{"key":"e_1_2_2_74_1","unstructured":"Philip Wadler. 1998. The Expression Problem. https:\/\/homepages.inf.ed.ac.uk\/wadler\/papers\/expression\/expression.txt.  Philip Wadler. 1998. The Expression Problem. https:\/\/homepages.inf.ed.ac.uk\/wadler\/papers\/expression\/expression.txt."},{"key":"e_1_2_2_75_1","volume-title":"Programming Languages and Systems (Lecture Notes in Computer Science)","author":"Wadler Philip","unstructured":"Philip Wadler and Robert Bruce Findler . 2009. Well-Typed Programs Can\u2019t Be Blamed . In Programming Languages and Systems (Lecture Notes in Computer Science) , Giuseppe Castagna (Ed.). Springer Berlin Heidelberg , 1\u015b16. Philip Wadler and Robert Bruce Findler. 2009. Well-Typed Programs Can\u2019t Be Blamed. In Programming Languages and Systems (Lecture Notes in Computer Science), Giuseppe Castagna (Ed.). Springer Berlin Heidelberg, 1\u015b16."},{"key":"e_1_2_2_76_1","doi-asserted-by":"publisher","DOI":"10.1145\/2889443.2889448"},{"key":"e_1_2_2_77_1","doi-asserted-by":"publisher","DOI":"10.1002\/spe.2334"},{"key":"e_1_2_2_78_1","doi-asserted-by":"publisher","DOI":"10.1145\/2076674.2076680"},{"key":"e_1_2_2_79_1","doi-asserted-by":"publisher","DOI":"10.1145\/2737924.2738008"},{"key":"e_1_2_2_80_1","doi-asserted-by":"publisher","DOI":"10.1145\/3133894"},{"key":"e_1_2_2_81_1","unstructured":"Alex Zhitnitsky. 2016. The Top 10 Exception Types in Production Java Applications - Based on 1B Events. https:\/\/blog.takipi.com\/the-top-10-exceptions-types-in-production-java-applications-based-on-1b-events\/.  Alex Zhitnitsky. 2016. The Top 10 Exception Types in Production Java Applications - Based on 1B Events. https:\/\/blog.takipi.com\/the-top-10-exceptions-types-in-production-java-applications-based-on-1b-events\/."}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3360584","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3360584","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,17]],"date-time":"2025-06-17T23:22:59Z","timestamp":1750202579000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3360584"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2019,10,10]]},"references-count":79,"journal-issue":{"issue":"OOPSLA","published-print":{"date-parts":[[2019,10,10]]}},"alternative-id":["10.1145\/3360584"],"URL":"https:\/\/doi.org\/10.1145\/3360584","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2019,10,10]]},"assertion":[{"value":"2019-10-10","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}