So the bug is that findFile() returns and InputStream and the Idl class constructor that takes an InputStream is created by the javacc processing of the Idl.jj file. This Idl constructor does not set the inputDir field of the Idl class and hence the Idl object created from the stream returned by findFile() has lost the sourceDirectory. This causes an import statement processed by this Idl object to fail, because the file can not be found as the "sourceDirectory is "lost".
I'm not very happy with my current solution as it seems a little "hacky". Suggestions appreciated.
1. Add a setSrcDir() method to the Idl class (added to Idl.jj)
2. Modify the ImportIdl() method to first create the Idl instance from the InputStream returned by findFile() and then call the setSrcDir() setter chaining the current inputDir into the created Idl instance.