Lune

FSE2023顶会

Practical Inference of Nullability Types

Nima Karimipour, Justin Pham, Lazaro Clapp, Manu Sridharan

摘要

NullPointerExceptions (NPEs), caused by dereferencing null, frequently cause crashes in Java programs. Pluggable type checking is highly effective in preventing Java NPEs. However, this approach is difficult to adopt for large, existing code bases, as it requires manually inserting a significant number of type qualifiers into the code. Hence, a tool to automatically infer these qualifiers could make adoption of type-based NPE prevention significantly easier.

We present a novel and practical approach to automatic inference of nullability type qualifiers for Java. Our technique searches for a set of qualifiers that maximizes the amount of code that can be successfully type checked. The search uses the type checker as a black box oracle, easing compatibility with existing tools. However, this approach can be costly, as evaluating the impact of a qualifier requires re-running the checker. We present a technique for safely evaluating many qualifiers in a single checker run, dramatically reducing running times. We also describe extensions to make the approach practical in a real-world deployment.

We implemented our approach in an open-source tool Null-AwayAnnotator, designed to work with the NullAway type checker. We evaluated NullAwayAnnotator's effectiveness on both opensource projects and commercial code. NullAwayAnnotator reduces the number of reported NullAway errors by 69.5% on average. Further, our optimizations enable NullAwayAnnotator to scale to large Java programs. NullAwayAnnotator has been highly effective in practice: in a production deployment, it has already been used to add NullAway checking to 160 production modules totaling over 1.3 million lines of Java code.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 5 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Repairing Leaks in Resource Wrappers 引用了 TFix: Learning to Fix Coding Errors with a Text-to-Text Transformer
  • Repairing Leaks in Resource Wrappers 引用了 TypeWriter: neural type prediction with search-based validation
  • LLM-Based Repair of Static Nullability Errors 引用了 A New Approach to Evaluating Nullability Inference Tools
  • LLM-Based Repair of Static Nullability Errors 引用了 TypeWriter: neural type prediction with search-based validation
  • Solver-based gradual type migration 引用了 What is decidable about gradual types?
  • Solver-based gradual type migration 引用了 TypeWriter: neural type prediction with search-based validation
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper5

  1. Effective Unit Test Generation for Java Null Pointer ExceptionsMyungho Lee, Jiseong Bak, Seokhyeon Moon, Yoonchan Jhi 等ASE 2024 · 1 次引用
  2. Repairing Leaks in Resource WrappersSanjay Malakar, Michael D. Ernst, Martin Kellogg, Manu SridharanASE 2025
  3. CodeCureAgent: Automatic Classification and Repair of Static Analysis WarningsPascal Joos, Islem Bouzenia, Michael PradelFSE 2026
  4. LLM-Based Repair of Static Nullability ErrorsNima Karimipour, Pascal Joos, Michael Pradel, Martin Kellogg 等ISSTA 2026
  5. A New Approach to Evaluating Nullability Inference ToolsNima Karimipour, Erfan Arvan, Martin Kellogg, Manu SridharanFSE 2025

它引用的 Paper6

  1. TFix: Learning to Fix Coding Errors with a Text-to-Text TransformerBerkay Berabi, Jingxuan He, Veselin Raychev, Martin T. VechevICML 2021 · 143 次引用
  2. TypeWriter: neural type prediction with search-based validationMichael Pradel, Georgios Gousios, Jason Liu, Satish ChandraFSE 2020 · 102 次引用
  3. Solver-based gradual type migrationLuna Phipps-Costin, Carolyn Jane Anderson, Michael Greenberg, Arjun GuhaOOPSLA 2021 · 16 次引用
  4. What is decidable about gradual types?Zeina Migeed, Jens PalsbergPOPL 2020 · 12 次引用
  5. Precise inference of expressive units of measurement typesTongtong Xiang, Jeff Y. Luo, Werner DietlOOPSLA 2020 · 9 次引用

相关 Paper

  1. Pluggable Type Inference for FreeMartin Kellogg, Daniel Daskiewicz, Loi Ngo Duc Nguyen, Muyeed Ahmed 等ASE 2023 · 4 次引用
  2. On the Real-World Effectiveness of Static Bug Detectors at Finding Null Pointer ExceptionsDavid A. Tomassi, Cindy Rubio-GonzálezASE 2021 · 24 次引用
  3. Verifying Determinism in Sequential ProgramsRashmi Mudduluru, Jason Waataja, Suzanne Millstein, Michael D. ErnstICSE 2021 · 4 次引用
  4. NPEX: Repairing Java Null Pointer Exceptions without TestsJunhee Lee, Seongjoon Hong, Hakjoo OhICSE 2022 · 13 次引用
  5. Wildcards need witness protectionKevin BierhoffOOPSLA 2022 · 1 次引用
黄昏的海面,两侧是细线勾勒的悬崖