JET: Exception checking in the java native interface

Siliang Li, Gang Tan

Research output: Contribution to journalArticlepeer-review

6 Scopus citations


Java's type system enforces exception-checking rules that stipulate a checked exception thrown by a method must be declared in the throws clause of the method. Software written in Java often invokes native methods through the use of the Java Native Interface (JNI). Java's type system, however, cannot enforce the same exception-checking rules on Java exceptions raised in native methods. This gap makes Java software potentially buggy and often difficult to debug when an exception is raised in native code. In this paper, we propose a complete static-analysis framework called JET to extend exception-checking rules even on native code. The framework has a two-stage design where the first stage throws away a large portion of irrelevant code so that the second stage, a fine-grained analysis, can concentrate on a small set of code for accurate bug finding. This design achieves both high efficiency and accuracy. We have applied JET on a set of benchmark programs with a total over 227K lines of source code and identified 12 inconsistent native-method exception declarations..

Original languageEnglish (US)
Pages (from-to)345-357
Number of pages13
JournalACM SIGPLAN Notices
Issue number10
StatePublished - Oct 2011

All Science Journal Classification (ASJC) codes

  • General Computer Science


Dive into the research topics of 'JET: Exception checking in the java native interface'. Together they form a unique fingerprint.

Cite this