For an undergraduate Independent Study, I'm (by myself) developing an IDEA
compiler plugin + inspection plugin which respects Java 5 annotations for
specifying non-null value invariants for variables, fields, etc. (and maybe
other invariants, to come later). I have chosen to do it within PSI as a
source processor (this also allows compilation-time checks as well as editor
Complex data flow is necessary to know when values may be null and when they
are not null. I am very new to compilers, dataflow, and things like that.
I've read most of Tiger compiler book, and Optimization section of Dragon
compiler book, but neither seems specific enough to address how to do dataflow
such that is required for my plugin. So, I'm having some trouble designing
and implementing the plugin.
The Constant Conditions & Exceptions inspections already present in IDEA
appear to share a great deal of functionality with my project. My project
needs to check whether values may be null, and Constant Conditions already
I plan to look at Sable optimisation framework, and Sun HotSpot source code
to see how they handle null checks, but I thought I would ask here first,
because you guys have implemented something very similar to what I need,
using the same PSI API.
So, I ask you, IDEA developers, a few questions:
1. What books, papers, open-source research projects would you recommend
I look at, to learn more about what I need for implementing such dataflow
2. Would it be possible for you to expose Constant Conditions & Exceptions
as OpenAPI, for example some API to compute constant conditions at a given
PSI element's execution?
3. Would it be possible for you to release the Constant Conditions inspection
source code, under a license such that I could extend it or include it in
Thanks, any pointers that you JetBrains, or anyone, can give me for this
project would be great. My college's CS department has only one faculty member
with knowledge about static analysis, and she is away for the semester, so
I'm mostly on my own with this project.