From 608417a166eec61fd0472b170da19bcd5bae6623 Mon Sep 17 00:00:00 2001 From: cgdecker Date: Thu, 21 Jan 2016 12:09:28 -0800 Subject: [PATCH] Minor fixes in preparation for 1.1-rc1. - Add @since 1.1 to new public types (though neither of them should be used directly). - Also @deprecate the required public, no-arg constructors on those types. - Make SystemJimfsFileSystemProvider final. - Random whitespace fix. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=112710083 --- jimfs/src/main/java/com/google/common/jimfs/Handler.java | 7 +++++++ .../common/jimfs/SystemJimfsFileSystemProvider.java | 9 ++++++++- .../google/common/jimfs/WatchServiceConfiguration.java | 4 ++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/jimfs/src/main/java/com/google/common/jimfs/Handler.java b/jimfs/src/main/java/com/google/common/jimfs/Handler.java index 8772ddae..bcb019d0 100644 --- a/jimfs/src/main/java/com/google/common/jimfs/Handler.java +++ b/jimfs/src/main/java/com/google/common/jimfs/Handler.java @@ -32,6 +32,7 @@ * to be used directly. * * @author Colin Decker + * @since 1.1 */ public final class Handler extends URLStreamHandler { @@ -70,6 +71,12 @@ static void register(Class handlerClass) { System.setProperty(JAVA_PROTOCOL_HANDLER_PACKAGES, packages); } + /** + * @deprecated Not intended to be called directly; this class is only for use by Java itself. + */ + @Deprecated + public Handler() {} // a public, no-arg constructor is required + @Override protected URLConnection openConnection(URL url) throws IOException { return new PathURLConnection(url); diff --git a/jimfs/src/main/java/com/google/common/jimfs/SystemJimfsFileSystemProvider.java b/jimfs/src/main/java/com/google/common/jimfs/SystemJimfsFileSystemProvider.java index c89fa766..f6553855 100644 --- a/jimfs/src/main/java/com/google/common/jimfs/SystemJimfsFileSystemProvider.java +++ b/jimfs/src/main/java/com/google/common/jimfs/SystemJimfsFileSystemProvider.java @@ -58,9 +58,10 @@ * instance, see {@link Jimfs}. For other operations, use the public APIs in {@code java.nio.file}. * * @author Colin Decker + * @since 1.1 */ @AutoService(FileSystemProvider.class) -public class SystemJimfsFileSystemProvider extends FileSystemProvider { +public final class SystemJimfsFileSystemProvider extends FileSystemProvider { /** * Env map key that maps to the already-created {@code FileSystem} instance in @@ -89,6 +90,12 @@ public class SystemJimfsFileSystemProvider extends FileSystemProvider { private static final ConcurrentMap fileSystems = new MapMaker().weakValues().makeMap(); + /** + * @deprecated Not intended to be called directly; this class is only for use by Java itself. + */ + @Deprecated + public SystemJimfsFileSystemProvider() {} // a public, no-arg constructor is required + @Override public String getScheme() { return URI_SCHEME; diff --git a/jimfs/src/main/java/com/google/common/jimfs/WatchServiceConfiguration.java b/jimfs/src/main/java/com/google/common/jimfs/WatchServiceConfiguration.java index 8648fc3c..4ef1a06b 100644 --- a/jimfs/src/main/java/com/google/common/jimfs/WatchServiceConfiguration.java +++ b/jimfs/src/main/java/com/google/common/jimfs/WatchServiceConfiguration.java @@ -44,7 +44,7 @@ public abstract class WatchServiceConfiguration { public static WatchServiceConfiguration polling(long interval, TimeUnit timeUnit) { return new PollingConfig(interval, timeUnit); } - + WatchServiceConfiguration() {} /** @@ -54,7 +54,7 @@ public static WatchServiceConfiguration polling(long interval, TimeUnit timeUnit // implementations abstract AbstractWatchService newWatchService(FileSystemView view, PathService pathService); - /** + /** * Implementation for {@link #polling}. */ private static final class PollingConfig extends WatchServiceConfiguration {