lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernhard Messer <Bernhard.Mes...@intrafind.de>
Subject strange behaviour in CompoundFileReader fileModified and touchFile
Date Thu, 30 Sep 2004 17:17:31 GMT
hi,

CompoundFileReader class contains some code where i can't follow the 
idea behind it. Maybe somebody else can switch on the light for me, so i 
can see the track. There are 2 public methods which definitly don't work 
as expected. I know, extending Directory forces one to implement the 
methods,  but in that particular, case the implementation is just 
confusing me and my be other people too.

    public long fileModified(String name) throws IOException {
        return directory.fileModified(fileName);
    }

    public void touchFile(String name) throws IOException {
        directory.touchFile(fileName);
    }

Looking at the implementation, both methods are working on the compound 
filename itself, regardless what the filename passed in has as it's 
value. It would be much more understandable, if these methods throw some 
UnsupportedOperationException. The other way is to to change them in a 
way, that the underlaying directory method calls will get the real 
filename passed in and not the compound filename itself.

just a thought ;-)

bernhard



---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message