lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless" <>
Subject adding "throws IOException" to RAMDirectory.createOutput?
Date Wed, 03 Oct 2007 11:37:45 GMT

As part of LUCENE-1011, I'd like to add "throws IOException" to

It is technically an API change since it's a checked exception and
people may need to change source code in their apps.  However, I
expect very few apps would actually be affected, because the super
(Directory.createOutput) already throws IOException so it's only
apps that directly call RAMDirectory.createOutput that may need to
change.  EG the common use of using RAMDirectory for holding your
index would be unaffected by this.

I'd like to do this because MockRAMDirectory, which subclasses
RAMDirectory and is very useful for testing because it "simulates"
windows behavior of not overwriting an open file, needs to be able to
throw IOException from its createOutput.  I was previously throwing
RuntimeException from MockRAMDirectory, but this is causing some tests
to fail because that RuntimeException is not expected by Lucene.

Any objections?

The only alternative I can think of is to turn off this windows-like
behavior for certain tests (don't like that because it "weakens" these
tests), or, change MockRAMDirectory to subclass directly from
Directory (don't like that because then I'm copying alot of code from


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message