Details
-
New Feature
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.5.1
-
None
Description
Prior to 2.5.0 release Gerrit was using this was to initialize FileSystemFactoryProvider:
private void initFileSystemFactory() { setFileSystemFactory( session -> new FileSystem() { @Override public void close() throws IOException {} @Override public Iterable<FileStore> getFileStores() { return null; } @Override public Path getPath(String arg0, String... arg1) { return null; } @Override public PathMatcher getPathMatcher(String arg0) { return null; } @Override public Iterable<Path> getRootDirectories() { return null; } @Override public String getSeparator() { return null; } @Override public UserPrincipalLookupService getUserPrincipalLookupService() { return null; } @Override public boolean isOpen() { return false; } @Override public boolean isReadOnly() { return false; } @Override public WatchService newWatchService() throws IOException { return null; } @Override public FileSystemProvider provider() { return null; } @Override public Set<String> supportedFileAttributeViews() { return null; } }); }
After the migration to release 2.5.1 it doesn't compile any more, because the FileSystemFactory factory is not FunctionalInterface any more, as it has two methods now.
We could do something like this:
private void initFileSystemFactory() {
setFileSystemFactory(NativeFileSystemFactory.INSTANCE);
}
But given that we are not using sftp, it could be even safer to just say:
private void noFileSystemFactory() {
setFileSystemFactory(NoFileSystemFactory.INSTANCE);
}