Skip to content

Commit 5b5a3df

Browse files
committed
GH-419: Deprecate RamFileSystemProvider for removal.
RamFileSystemProvider realistically is not something we will ever expect the user to be making any use of, so can be safely deprecated and then removed on the v1.0.0 branch.
1 parent 4e37df1 commit 5b5a3df

File tree

6 files changed

+7
-10
lines changed

6 files changed

+7
-10
lines changed

java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/PathStrategy.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,6 @@ public enum PathStrategy {
5151
*
5252
* <p>Some non-Javac compiler implementations (such as ECJ) may also have some difficulties
5353
* dealing with these paths.
54-
*
55-
* The actual implementation used internally will be the first {@link RamFileSystemProvider} that
56-
* is present when querying that interface with the Java
57-
* {@link java.util.ServiceLoader Service Loader mechanism}. By default, if no custom implementation
58-
* is provided by the user, then an internal implementation is used. This internal implementation is
59-
* subject to change at any time (as long as the change is non-breaking), but currently uses
60-
* {@link com.google.common.jimfs.Jimfs Google's JIMFS}.
6154
*/
6255
RAM_DIRECTORIES(RamDirectoryImpl::newRamDirectory),
6356

java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/RamFileSystemProvider.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@
2929
*
3030
* @author Ashley Scopes
3131
* @since 0.0.1 (0.0.1-M9)
32+
* @deprecated this feature should never be needed by users of this library, and so has been
33+
* deprecated for removal in v1.0.0.
3234
*/
3335
@API(since = "0.0.1", status = Status.STABLE)
36+
@Deprecated(since = "0.6.0", forRemoval = true)
3437
public interface RamFileSystemProvider {
3538

3639
/**

java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/JimfsFileSystemProviderImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
* @since 0.0.1 (0.0.1-M9)
3232
*/
3333
@API(since = "0.0.1", status = Status.INTERNAL)
34+
@SuppressWarnings("removal")
3435
public final class JimfsFileSystemProviderImpl implements RamFileSystemProvider {
3536

3637
// We could initialise this lazily, but this class has fewer fields and initialisation

java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/RamDirectoryImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import static io.github.ascopes.jct.utils.FileUtils.assertValidRootName;
1919
import static io.github.ascopes.jct.utils.IoExceptionUtils.uncheckedIo;
2020

21-
import io.github.ascopes.jct.workspaces.RamFileSystemProvider;
2221
import java.io.IOException;
2322
import java.nio.file.FileSystem;
2423
import java.nio.file.Files;
@@ -88,7 +87,7 @@ public static RamDirectoryImpl newRamDirectory(String name) {
8887

8988
assertValidRootName(name);
9089

91-
var fileSystem = RamFileSystemProvider.getInstance().createFileSystem(name);
90+
var fileSystem = JimfsFileSystemProviderImpl.getInstance().createFileSystem(name);
9291
var path = fileSystem.getRootDirectories().iterator().next().resolve(name);
9392

9493
// Ensure the base directory exists.

java-compiler-testing/src/main/java/module-info.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
* }
9090
* </code></pre>
9191
*/
92+
@SuppressWarnings("removal")
9293
module io.github.ascopes.jct {
9394

9495
////////////////////

java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/workspaces/RamFileSystemProviderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*/
3838
@DisplayName("RamFileSystemProvider tests")
3939
@Isolated("messes with global ServiceLoader")
40-
@SuppressWarnings("Java9UndeclaredServiceUsage")
40+
@SuppressWarnings({"Java9UndeclaredServiceUsage", "removal"})
4141
class RamFileSystemProviderTest {
4242

4343
@DisplayName(".getInstance() returns the first service provider instance if present")

0 commit comments

Comments
 (0)