lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Peter_Lena...@ibi.com>
Subject void touchFile() should return the boolean result of the setLastModified
Date Wed, 04 Nov 2009 01:05:19 GMT
This is an issue found by Findbugs.
In the file FSDirectory the method void touchFile() should return the boolean result of the
setLastModified method call.


public abstract class FSDirectory extends Directory {


@Override
  public void touchFile(String name) {
    ensureOpen();
    File file = new File(directory, name);
    file.setLastModified(System.currentTimeMillis());
  }

Because this class is abstract this method may be overridden, and this may create an upward
compatibility issue.


Suggested change

@Override
  public Boolean touchFile(String name) {
    ensureOpen();
    File file = new File(directory, name);
    Return file.setLastModified(System.currentTimeMillis());
  }



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message