Skip to main content

Modular Transformation of Java Exceptions Modulo Errors

  • 512 Accesses

Part of the Lecture Notes in Computer Science book series (LNPSE,volume 12863)


Deductive verifiers are used more and more in both academia and industry to prevent costly bugs. Their capabilities of verifying concurrent programs are getting better, but they are still lagging behind with regard to many major programming language features such as exceptions. To improve the situation, this work presents a semantics of Java exceptions which reduces the annotation burden on the user, while still allowing verification of exceptions. This is accomplished by ignoring sources of errors which are irrelevant to functional verification. Additionally, to deal with the complex control flow introduced by finally, a transformation is proposed that simplifies verification of exceptional postconditions and finally into postconditions and goto. We implement the approach and evaluate it against several common exception patterns.


  • Deductive verification
  • Java
  • VerCors
  • Exceptions
  • Finally
  • Errors

This is a preview of subscription content, access via your institution.

Buying options

USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions


  1. Ahrendt, W., Beckert, B., Bubel, R., Hähnle, R., Schmitt, P.H., Ulbrich, M.: Deductive Software Verification - The KeY Book. LNCS, vol. 10001. Springer, Cham (2016).

  2. Amighi, A., Blom, S., Huisman, M., Zaharieva-Stojanovski, M.: The VerCors project: setting up basecamp. In: Proceedings of the Sixth PLPV Workshop. ACM (2012).

  3. Bicalho de Pádua, G.: Studying and Assisting the Practice of Java and C# Exception Handling. Masters, Concordia University, February 2018

    Google Scholar 

  4. Black Duck Open Hub: The Apache Hadoop Open Source Project on Open Hub: Languages Page (2018).

  5. Black Duck Open Hub: The Apache Tomcat Open Source Project on Open Hub: Languages Page (2018).

  6. Blom, S., Darabi, S., Huisman, M., Oortwijn, W.: The VerCors tool set: verification of parallel and concurrent software. In: iFM, vol. 10510, pp. 102–110 (2017).

  7. Cok, D.R.: OpenJML: software verification for Java 7 using JML, OpenJDK, and Eclipse. EPTCS (2014).

  8. Distefano, D., Parkinson, M.J.: jStar: towards practical verification for Java. In: Proceedings of the 23rd ACM SIGPLAN OOPSLA Conference. ACM (2008).

  9. Dyer, R., Nguyen, H.A., Rajan, H., Nguyen, T.N.: Boa: a language and infrastructure for analyzing ultra-large-scale software repositories. In: 2013 35th ICSE. IEEE (2013).

  10. Eilers, M.: Shortened github link to code-level documentation of get\_finally\_var method (2021).

  11. Fragoso Santos, J., Maksimović, P., Naudžiünienė, D., Wood, T., Gardner, P.: JaVerT: JavaScript verification toolchain. In: Proceedings of the ACM Programming Language 2(POPL) (2017).

  12. Freund, S.N.: The costs and benefits of Java bytecode subroutines. In: Formal Underpinnings of Java Workshop at OOPSLA 98 (1998)

    Google Scholar 

  13. Gillian Team: Gillian - a multi-language platform for compositional symbolic analysis (2020).

  14. Gosling, J., Joy, B., Steele, G., Bracha, G.: The Java language specification, Java SE 7th edn. (2000)

    Google Scholar 

  15. Gosling, J., et al.: The Java language specification, Java SE 16th edn. (2021)

    Google Scholar 

  16. Hähnle, R., Huisman, M.: Deductive Software Verification: From Pen-and-Paper Proofs to Industrial Tools. Springer (2019)

    CrossRef  Google Scholar 

  17. Hamilton, J., Danicic, S.: An evaluation of current java bytecode decompilers. In: Ninth IEEE SCAM (2009). DOI: 10.1109/SCAM.2009.24

    CrossRef  Google Scholar 

  18. Jacobs, B.: Verifast & Java’s “finally” clause (2020).!topic/verifast/56uhVmdERwA

  19. Jacobs, B., Smans, J., Piessens, F.: A Quick Tour of the VeriFast Program Verifier. In: Programming Languages and Systems, vol. 6461. Springer (2010).

    CrossRef  Google Scholar 

  20. Kery, M.B., Le Goues, C., Myers, B.A.: Examining programmer practices for locally handling exceptions. In: Proceedings of the 13th MSR Conference. ACM (2016).

  21. Leavens, G.T., et al.: JML reference manual (2008).

  22. Marché, C., Paulin-Mohring, C., Urbain, X.: The Krakatoa tool for certification of Java/JavaCard programs annotated in JML. Journal of Logic and Algebraic Programming 58, 89-106 (2004).

  23. de Moura, L., Bjørner, N.: Z3: an efficient smt solver. In: TACAS. Springer (2008)

    CrossRef  Google Scholar 

  24. Müller, P., Schwerhoff, M., Summers, A.J.: Viper: A verification infrastructure for permission-based reasoning. In: VMCAI. Springer (2016)

    CrossRef  MATH  Google Scholar 

  25. Nakshatri, S., Hegde, M., Thandra, S.: Analysis of exception handling patterns in java projects: an empirical study. In: Proceedings of the 13th MSR Conference (2016).

  26. O’Hearn, P.: Separation logic. Commun. ACM 62 (2019).

  27. Osman, H., Chiş, A., Schaerer, J., Ghafari, M., Nierstrasz, O.: On the evolution of exception usage in Java projects. In: 2017 IEEE 24th SANER Conference (2017).

  28. Purohit, P., Tokekar, V.: An investigation of exception handling practices in.NET and Java environments. Int. J. Appl. Eng. Res. 13, 2130–2140 (2018)

    Google Scholar 

  29. Rubbens, R.: Improving support for Java exceptions and inheritance in VerCors. Master’s thesis, University of Twente (2020).

  30. Rubbens, R.: Modular Transformation of Java Exceptions Modulo Errors: accompanying package (2021).

  31. Sena, D., Coelho, R., Kulesza, U., Bonifácio, R.: Understanding the exception handling strategies of Java libraries: an empirical study. In: Proceedings of the 13th MSR Conference. ACM (2016).

  32. Steinhöfel, D., Wasser, N.: A New Invariant Rule for the Analysis of Loops with Non-standard Control Flows. In: IFM, vol. 10510. Springer (2017).

    CrossRef  Google Scholar 

  33. Vallée-Rai, R., Co, P., Gagnon, E., Hendren, L., Lam, P., Sundaresan, V.: Soot: a java bytecode optimization framework. CASCON First Decade High Impact Papers (2010).

  34. VerCors Team: VerCors homepage (2020).

Download references

Author information

Authors and Affiliations


Corresponding author

Correspondence to Robert Rubbens .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and Permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Rubbens, R., Lathouwers, S., Huisman, M. (2021). Modular Transformation of Java Exceptions Modulo Errors. In: Lluch Lafuente, A., Mavridou, A. (eds) Formal Methods for Industrial Critical Systems. FMICS 2021. Lecture Notes in Computer Science(), vol 12863. Springer, Cham.

Download citation

  • DOI:

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-85247-4

  • Online ISBN: 978-3-030-85248-1

  • eBook Packages: Computer ScienceComputer Science (R0)