Skip to content

Commit 20accd5

Browse files
committed
Remove platform classpath features deprecated in GH-396.
1 parent 8f87d0c commit 20accd5

File tree

14 files changed

+0
-494
lines changed

14 files changed

+0
-494
lines changed

java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/AbstractJctCompiler.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ public abstract class AbstractJctCompiler<A extends AbstractJctCompiler<A>>
7777
private boolean fixJvmModulePathMismatch;
7878
private boolean inheritClassPath;
7979
private boolean inheritModulePath;
80-
81-
@Deprecated(forRemoval = true, since = "0.6.0")
82-
@SuppressWarnings("DeprecatedIsStillUsed")
83-
private boolean inheritPlatformClassPath;
84-
8580
private boolean inheritSystemModulePath;
8681
private LoggingMode fileManagerLoggingMode;
8782
private AnnotationProcessorDiscovery annotationProcessorDiscovery;
@@ -91,7 +86,6 @@ public abstract class AbstractJctCompiler<A extends AbstractJctCompiler<A>>
9186
*
9287
* @param defaultName the printable default name to use for the compiler.
9388
*/
94-
@SuppressWarnings("removal")
9589
protected AbstractJctCompiler(String defaultName) {
9690
name = requireNonNull(defaultName, "name");
9791
annotationProcessors = new ArrayList<>();
@@ -112,7 +106,6 @@ protected AbstractJctCompiler(String defaultName) {
112106
fixJvmModulePathMismatch = JctCompiler.DEFAULT_FIX_JVM_MODULE_PATH_MISMATCH;
113107
inheritClassPath = JctCompiler.DEFAULT_INHERIT_CLASS_PATH;
114108
inheritModulePath = JctCompiler.DEFAULT_INHERIT_MODULE_PATH;
115-
inheritPlatformClassPath = JctCompiler.DEFAULT_INHERIT_PLATFORM_CLASS_PATH;
116109
inheritSystemModulePath = JctCompiler.DEFAULT_INHERIT_SYSTEM_MODULE_PATH;
117110
fileManagerLoggingMode = JctCompiler.DEFAULT_FILE_MANAGER_LOGGING_MODE;
118111
annotationProcessorDiscovery = JctCompiler.DEFAULT_ANNOTATION_PROCESSOR_DISCOVERY;
@@ -340,21 +333,6 @@ public A inheritModulePath(boolean inheritModulePath) {
340333
return myself();
341334
}
342335

343-
@Deprecated(forRemoval = true, since = "0.6.0")
344-
@Override
345-
@SuppressWarnings({"removal", "DeprecatedIsStillUsed"})
346-
public boolean isInheritPlatformClassPath() {
347-
return inheritPlatformClassPath;
348-
}
349-
350-
@Deprecated(forRemoval = true, since = "0.6.0")
351-
@Override
352-
@SuppressWarnings({"removal", "DeprecatedIsStillUsed"})
353-
public A inheritPlatformClassPath(boolean inheritPlatformClassPath) {
354-
this.inheritPlatformClassPath = inheritPlatformClassPath;
355-
return myself();
356-
}
357-
358336
@Override
359337
public boolean isInheritSystemModulePath() {
360338
return inheritSystemModulePath;

java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompiler.java

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,6 @@ public interface JctCompiler<C extends JctCompiler<C, R>, R extends JctCompilati
8989
*/
9090
boolean DEFAULT_INHERIT_MODULE_PATH = true;
9191

92-
/**
93-
* Default setting for inclusion of the current platform class path ({@code false}).
94-
*
95-
* @deprecated The platform class path has been mostly replaced by the use of system modules, so
96-
* should not be used. This will be removed in v1.0.0, and has been changed to default to
97-
* {@code false} as of v0.6.0
98-
*/
99-
@Deprecated(forRemoval = true, since = "0.6.0")
100-
@SuppressWarnings("DeprecatedIsStillUsed")
101-
boolean DEFAULT_INHERIT_PLATFORM_CLASS_PATH = false;
102-
10392
/**
10493
* Default setting for inclusion of the system module path ({@code true}).
10594
*/
@@ -721,41 +710,6 @@ default C target(SourceVersion target) {
721710
*/
722711
C inheritModulePath(boolean inheritModulePath);
723712

724-
/**
725-
* Get whether the current platform class path is being inherited from the caller JVM or not.
726-
*
727-
* <p>This may also be known as the "bootstrap class path".
728-
*
729-
* <p>Default environments probably will not provide this functionality, in which case it will be
730-
* ignored.
731-
*
732-
* <p>Unless otherwise changed or specified, implementations should default to
733-
* {@link #DEFAULT_INHERIT_PLATFORM_CLASS_PATH}.
734-
*
735-
* @return whether the platform class path is being inherited or not.
736-
* @deprecated The platform class path has been mostly replaced by the use of system modules, so
737-
* should not be used. This will be removed in v1.0.0.
738-
*/
739-
@Deprecated(forRemoval = true, since = "0.6.0")
740-
@SuppressWarnings("DeprecatedIsStillUsed")
741-
boolean isInheritPlatformClassPath();
742-
743-
/**
744-
* Set whether the current platform class path is being inherited from the caller JVM or not.
745-
*
746-
* <p>This may also be known as the "bootstrap class path".
747-
*
748-
* <p>Default environments probably will not provide this functionality, in which case it will be
749-
* ignored.
750-
*
751-
* @param inheritPlatformClassPath {@code true} to include it, or {@code false} to exclude it.
752-
* @return this compiler object for further call chaining.
753-
* @deprecated The platform class path has been mostly replaced by the use of system modules, so
754-
* should not be used. This will be removed in v1.0.0.
755-
*/
756-
@Deprecated(forRemoval = true, since = "0.6.0")
757-
C inheritPlatformClassPath(boolean inheritPlatformClassPath);
758-
759713
/**
760714
* Get whether the system module path is inherited from the caller JVM or not.
761715
*

java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/JctFileManager.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -245,22 +245,6 @@ default ModuleContainerGroup getAnnotationProcessorModulePathGroup() {
245245
return getModuleContainerGroup(StandardLocation.ANNOTATION_PROCESSOR_MODULE_PATH);
246246
}
247247

248-
/**
249-
* Get the location holding the {@link StandardLocation#PLATFORM_CLASS_PATH platform class path}
250-
* (also known as the boot class path).
251-
*
252-
* @return the location, or {@code null} if the location is not present in the file manager.
253-
* @since 0.1.0
254-
* @deprecated The platform class path has been mostly replaced by the use of system modules, so
255-
* should not be used. This will be removed in v1.0.0.
256-
*/
257-
@Deprecated(forRemoval = true, since = "0.6.0")
258-
@Nullable
259-
@SuppressWarnings("DeprecatedIsStillUsed")
260-
default PackageContainerGroup getPlatformClassPathGroup() {
261-
return getPackageContainerGroup(StandardLocation.PLATFORM_CLASS_PATH);
262-
}
263-
264248
/**
265249
* Get the location holding the
266250
* {@link StandardLocation#NATIVE_HEADER_OUTPUT native header outputs}.

java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmPlatformClassPathConfigurer.java

Lines changed: 0 additions & 85 deletions
This file was deleted.

java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/impl/JctFileManagerFactoryImpl.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import io.github.ascopes.jct.filemanagers.config.JctFileManagerJvmClassPathConfigurer;
2424
import io.github.ascopes.jct.filemanagers.config.JctFileManagerJvmClassPathModuleConfigurer;
2525
import io.github.ascopes.jct.filemanagers.config.JctFileManagerJvmModulePathConfigurer;
26-
import io.github.ascopes.jct.filemanagers.config.JctFileManagerJvmPlatformClassPathConfigurer;
2726
import io.github.ascopes.jct.filemanagers.config.JctFileManagerJvmSystemModulesConfigurer;
2827
import io.github.ascopes.jct.filemanagers.config.JctFileManagerLoggingProxyConfigurer;
2928
import io.github.ascopes.jct.filemanagers.config.JctFileManagerRequiredLocationsConfigurer;
@@ -74,15 +73,13 @@ public JctFileManager createFileManager(Workspace workspace) {
7473
* @return the chain to use.
7574
*/
7675
@VisibleForTestingOnly
77-
@SuppressWarnings("removal")
7876
public JctFileManagerConfigurerChain createConfigurerChain(Workspace workspace) {
7977
// The order here is important. Do not adjust it without testing extensively first!
8078
return new JctFileManagerConfigurerChain()
8179
.addLast(new JctFileManagerWorkspaceConfigurer(workspace))
8280
.addLast(new JctFileManagerJvmClassPathConfigurer(compiler))
8381
.addLast(new JctFileManagerJvmClassPathModuleConfigurer(compiler))
8482
.addLast(new JctFileManagerJvmModulePathConfigurer(compiler))
85-
.addLast(new JctFileManagerJvmPlatformClassPathConfigurer(compiler))
8683
.addLast(new JctFileManagerJvmSystemModulesConfigurer(compiler))
8784
.addLast(new JctFileManagerAnnotationProcessorClassPathConfigurer(compiler))
8885
.addLast(new JctFileManagerRequiredLocationsConfigurer(workspace))

java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/SpecialLocationUtils.java

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -109,37 +109,6 @@ public static List<Path> currentModulePathLocations() {
109109
return createPaths(System.getProperty(JDK_MODULE_PROPERTY, NO_PATH));
110110
}
111111

112-
/**
113-
* Get the boot classpath of the current JVM. This will usually include any dependencies you may
114-
* have loaded into memory, and may refer to directories of {@code *.class} files, {@code *.war}
115-
* files, or {@code *.jar} files.
116-
*
117-
* <p>This corresponds to the {@link javax.tools.StandardLocation#PLATFORM_CLASS_PATH} location.
118-
*
119-
* <p>Most OpenJDK implementations do not appear to support this. In this case, an empty list
120-
* will be returned here.
121-
*
122-
* @return a list across the paths.
123-
*/
124-
@Deprecated(forRemoval = true, since = "0.6.0")
125-
@SuppressWarnings("DeprecatedIsStillUsed")
126-
public static List<Path> currentPlatformClassPathLocations() {
127-
var mxBean = ManagementFactory.getRuntimeMXBean();
128-
129-
if (mxBean.isBootClassPathSupported()) {
130-
LOGGER.warn(
131-
"Warning: platform (boot) class path locations were found on this JVM, but this "
132-
+ "feature is deprecated for removal in v1.0.0 of the java-compiler-testing API. "
133-
+ "Consider disabling platform classpath discovery explicitly to prevent tests "
134-
+ "having differing behaviour for v1.0.0."
135-
);
136-
return createPaths(mxBean.getBootClassPath());
137-
}
138-
139-
LOGGER.trace("Platform (boot) classpath is not supported on this JVM, so will be ignored");
140-
return List.of();
141-
}
142-
143112
private static List<Path> createPaths(String raw) {
144113
return SEPARATOR
145114
.splitToStream(raw)

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

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -505,23 +505,6 @@ default void addAnnotationProcessorPathModule(String moduleName, Path path) {
505505
addModule(StandardLocation.ANNOTATION_PROCESSOR_MODULE_PATH, moduleName, path);
506506
}
507507

508-
/**
509-
* Add a package to the {@link StandardLocation#PLATFORM_CLASS_PATH platform class path} (also
510-
* known as the boot class path).
511-
*
512-
* @param path the path to add.
513-
* @throws IllegalArgumentException if the path does not exist.
514-
* @see #addPackage(Location, Path)
515-
* @see #createPlatformClassPathPackage()
516-
* @deprecated The platform class path has been mostly replaced by the use of system modules, so
517-
* should not be used. This will be removed in v1.0.0.
518-
*/
519-
@Deprecated(forRemoval = true, since = "0.6.0")
520-
@SuppressWarnings("DeprecatedIsStillUsed")
521-
default void addPlatformClassPathPackage(Path path) {
522-
addPackage(StandardLocation.PLATFORM_CLASS_PATH, path);
523-
}
524-
525508
/**
526509
* Add a package to the {@link StandardLocation#NATIVE_HEADER_OUTPUT native header outputs}.
527510
*
@@ -777,22 +760,6 @@ default ManagedDirectory createAnnotationProcessorPathModule(String moduleName)
777760
return createModule(StandardLocation.ANNOTATION_PROCESSOR_MODULE_PATH, moduleName);
778761
}
779762

780-
/**
781-
* Create a package in the {@link StandardLocation#PLATFORM_CLASS_PATH platform class path} (also
782-
* known as the boot class path).
783-
*
784-
* @return the created test directory.
785-
* @see #createPackage(Location)
786-
* @see #addPlatformClassPathPackage(Path)
787-
* @deprecated The platform class path has been mostly replaced by the use of system modules, so
788-
* should not be used. This will be removed in v1.0.0.
789-
*/
790-
@Deprecated(forRemoval = true, since = "0.6.0")
791-
@SuppressWarnings("DeprecatedIsStillUsed")
792-
default ManagedDirectory createPlatformClassPathPackage() {
793-
return createPackage(StandardLocation.PLATFORM_CLASS_PATH);
794-
}
795-
796763
/**
797764
* Create a package in the {@link StandardLocation#NATIVE_HEADER_OUTPUT native header outputs}.
798765
*

java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/compilers/AbstractJctCompilerTest.java

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -283,15 +283,6 @@ void constructorInitialisesInheritModulePathToDefaultValue() {
283283
.isEqualTo(JctCompiler.DEFAULT_INHERIT_MODULE_PATH);
284284
}
285285

286-
@DisplayName("constructor initialises inheritPlatformClassPath to default value")
287-
@Test
288-
@SuppressWarnings("removal")
289-
void constructorInitialisesInheritPlatformClassPathToDefaultValue() {
290-
// Then
291-
assertThatCompilerField("inheritPlatformClassPath")
292-
.isEqualTo(JctCompiler.DEFAULT_INHERIT_PLATFORM_CLASS_PATH);
293-
}
294-
295286
@DisplayName("constructor initialises inheritSystemModulePath to default value")
296287
@Test
297288
void constructorInitialisesInheritSystemModulePathToDefaultValue() {
@@ -1290,46 +1281,6 @@ void inheritModulePathReturnsTheCompiler() {
12901281
}
12911282
}
12921283

1293-
@DisplayName(".isInheritPlatformClassPath() returns the expected values")
1294-
@ValueSource(booleans = {true, false})
1295-
@ParameterizedTest(name = "for inheritPlatformClassPath = {0}")
1296-
@SuppressWarnings("removal")
1297-
void isInheritPlatformClassPathReturnsExpectedValue(boolean expected) {
1298-
// Given
1299-
setFieldOnCompiler("inheritPlatformClassPath", expected);
1300-
1301-
// Then
1302-
assertThat(compiler.isInheritPlatformClassPath()).isEqualTo(expected);
1303-
}
1304-
1305-
@DisplayName("AbstractJctCompiler#inheritPlatformClassPath tests")
1306-
@Nested
1307-
class InheritPlatformClassPathTests {
1308-
1309-
@DisplayName(".inheritPlatformClassPath(...) sets the expected values")
1310-
@ValueSource(booleans = {true, false})
1311-
@ParameterizedTest(name = "for inheritPlatformClassPath = {0}")
1312-
@SuppressWarnings("removal")
1313-
void inheritPlatformClassPathSetsExpectedValue(boolean expected) {
1314-
// When
1315-
compiler.inheritPlatformClassPath(expected);
1316-
1317-
// Then
1318-
assertThatCompilerField("inheritPlatformClassPath").isEqualTo(expected);
1319-
}
1320-
1321-
@DisplayName(".inheritPlatformClassPath(...) returns the compiler")
1322-
@Test
1323-
@SuppressWarnings("removal")
1324-
void inheritPlatformClassPathReturnsTheCompiler() {
1325-
// When
1326-
var result = compiler.inheritPlatformClassPath(true);
1327-
1328-
// Then
1329-
assertThat(result).isSameAs(compiler);
1330-
}
1331-
}
1332-
13331284
@DisplayName(".isInheritSystemModulePath() returns the expected values")
13341285
@ValueSource(booleans = {true, false})
13351286
@ParameterizedTest(name = "for inheritSystemModulePath = {0}")

0 commit comments

Comments
 (0)