Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
*/
public class ServiceProcessor extends AbstractProcessor {

public ServiceProcessor() {
// Hope you are happy, javac. I made a constructor for you.
}

@Override
public Set<String> getSupportedAnnotationTypes() {
return Set.of(Service.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import javax.annotation.processing.Processor;

module io.github.ascopes.jct.acceptancetests.serviceloaderjpms {
requires java.compiler;
requires transitive java.compiler;
exports io.github.ascopes.jct.acceptancetests.serviceloaderjpms;
provides Processor with ServiceProcessor;
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public final A isAnyOfElements(Collection<E> elements) {
* group of acceptable values.
*/
@SafeVarargs
@SuppressWarnings("varargs")
public final A isNoneOf(E... elements) {
requireNonNullValues(elements, "elements");
requireAtLeastOne(elements, "elements");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import io.github.ascopes.jct.containers.PackageContainerGroup;
import io.github.ascopes.jct.diagnostics.TraceDiagnostic;
import io.github.ascopes.jct.filemanagers.PathFileObject;
import io.github.ascopes.jct.utils.UtilityClass;
import java.util.List;
import javax.tools.Diagnostic;
import javax.tools.JavaFileManager.Location;
Expand All @@ -35,7 +34,7 @@
* @since 0.0.1
*/
@SuppressWarnings("unused")
public final class JctAssertions extends UtilityClass {
public final class JctAssertions {

private JctAssertions() {
// Disallow initialisation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@
package io.github.ascopes.jct.compilers;

import io.github.ascopes.jct.compilers.impl.JavacJctCompilerImpl;
import io.github.ascopes.jct.utils.UtilityClass;

/**
* Helpers to create new compiler instances.
*
* @author Ashley Scopes
* @since 0.0.1
*/
public final class JctCompilers extends UtilityClass {
public final class JctCompilers {

private JctCompilers() {
// Static-only class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import static java.util.Objects.requireNonNull;

import io.github.ascopes.jct.utils.LoomPolyfill;
import io.github.ascopes.jct.utils.VisibleForTestingOnly;
import java.time.Instant;
import java.util.List;
import java.util.Locale;
Expand Down Expand Up @@ -67,19 +66,7 @@ public TracingDiagnosticListener(
);
}

/**
* Only visible for testing.
*
* <p>Users should <strong>NOT</strong> use this constructor. It may be changed
* or removed without notice.
*
* @param logger the logger to use.
* @param threadGetter the supplier of the current thread.
* @param logging whether to enable logging.
* @param stackTraces whether to enable stack traces in the logging.
*/
@VisibleForTestingOnly
protected TracingDiagnosticListener(
TracingDiagnosticListener(
Logger logger,
Supplier<? extends Thread> threadGetter,
boolean logging,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,9 @@ Set<JavaFileObject> list(
@Override
Iterable<Set<Location>> listLocationsForModules(Location location) throws IOException;

///
/// Default helper overrides
///
/*
* Default helper overrides
*/

/**
* Get the location holding the {@link StandardLocation#CLASS_OUTPUT class outputs}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@

import io.github.ascopes.jct.compilers.JctCompiler;
import io.github.ascopes.jct.filemanagers.impl.JctFileManagerFactoryImpl;
import io.github.ascopes.jct.utils.UtilityClass;

/**
* Helpers to create instances of default implementations for file managers.
*
* @author Ashley Scopes
* @since 1.1.0
*/
public final class JctFileManagers extends UtilityClass {
public final class JctFileManagers {

private JctFileManagers() {
// Static-only class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import io.github.ascopes.jct.filemanagers.config.JctFileManagerLoggingProxyConfigurer;
import io.github.ascopes.jct.filemanagers.config.JctFileManagerRequiredLocationsConfigurer;
import io.github.ascopes.jct.filemanagers.config.JctFileManagerWorkspaceConfigurer;
import io.github.ascopes.jct.utils.VisibleForTestingOnly;
import io.github.ascopes.jct.workspaces.Workspace;

/**
Expand All @@ -54,12 +53,10 @@ public JctFileManagerFactoryImpl(JctCompiler compiler) {
}

/**
* Get the compiler that was set on this file manager factory.
* Get the associated compiler.
*
* @return the compiler
* @since 1.1.0
* @return the associated compiler.
*/
@VisibleForTestingOnly
public JctCompiler getCompiler() {
return compiler;
}
Expand All @@ -72,16 +69,7 @@ public JctFileManager createFileManager(Workspace workspace) {
.configure(fileManager);
}

/**
* Create the default configurer chain to use for the given workspace.
*
* <p>This is visible for testing only.
*
* @param workspace the workspace to configure with.
* @return the chain to use.
*/
@VisibleForTestingOnly
public JctFileManagerConfigurerChain createConfigurerChain(Workspace workspace) {
JctFileManagerConfigurerChain createConfigurerChain(Workspace workspace) {
// The order here is important. Do not adjust it without testing extensively first!
return new JctFileManagerConfigurerChain()
.addLast(new JctFileManagerWorkspaceConfigurer(workspace))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private LoggingFileManagerProxy(JctFileManager inner, boolean stackTraces) {
*/
@Nullable
@Override
public Object invoke(Object proxy, Method method, Object @Nullable ... args) throws Throwable {
public Object invoke(Object proxy, Method method, Object @Nullable[] args) throws Throwable {
if (method.getName().equals("toString")) {
return toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ private JctCompilerConfigurer<?> initializeConfigurer(
}
}

@SuppressWarnings("unchecked")
@SuppressWarnings({"rawtypes", "unchecked", "RedundantSuppression"})
private static <T> Class<T>[] emptyArray() {
return (Class<T>[]) new Class[0];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import io.github.ascopes.jct.compilers.JctCompiler;
import io.github.ascopes.jct.compilers.impl.JavacJctCompilerImpl;
import io.github.ascopes.jct.utils.VisibleForTestingOnly;
import org.junit.jupiter.params.support.AnnotationConsumer;

/**
Expand All @@ -29,14 +28,7 @@
public final class JavacCompilersProvider extends AbstractCompilersProvider
implements AnnotationConsumer<JavacCompilerTest> {

/**
* Initialise the provider.
*
* <p>This is only visible for testing purposes, users should have no need to
* initialise this class directly.
*/
@VisibleForTestingOnly
public JavacCompilersProvider() {
JavacCompilersProvider() {
// Visible for testing only.
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @author Ashley Scopes
* @since 0.0.1
*/
public final class FileUtils extends UtilityClass {
public final class FileUtils {

// Exclude any "empty" extensions. At the time of writing, this will just exclude Kind.EMPTY,
// but doing this will prevent future API changes from breaking any assumptions we make. In
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
* @author Ashley Scopes
*/
public final class IoExceptionUtils extends UtilityClass {
public final class IoExceptionUtils {

private IoExceptionUtils() {
// Disallow initialisation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @author Ashley Scopes
* @since 0.0.1
*/
public final class IterableUtils extends UtilityClass {
public final class IterableUtils {

private IterableUtils() {
// Disallow initialisation.
Expand Down Expand Up @@ -184,9 +184,7 @@ public static <T> T[] requireNonNullValues(
throw new NullPointerException(error);
}

//noinspection RedundantCast -- Cast is not redundant as we're casting away any nullability
// annotations for nullness typecheckers. Don't let IntelliJ tell you otherwise as it is a
// bug.
return (T[]) array;
//noinspection NullableProblems
return array;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* @author Ashley Scopes
* @since 0.0.1
*/
public final class LoomPolyfill extends UtilityClass {
public final class LoomPolyfill {

private LoomPolyfill() {
// Static-only class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @author Ashley Scopes
* @since 0.0.1
*/
public final class ModuleDiscoverer extends UtilityClass {
public final class ModuleDiscoverer {

private static final Logger log = LoggerFactory.getLogger(ModuleDiscoverer.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @author Ashley Scopes
* @since 0.0.1
*/
public final class SpecialLocationUtils extends UtilityClass {
public final class SpecialLocationUtils {

// Files we don't want to propagate by default as they may clash with the environment.
private static final Set<String> BLACKLISTED_FILE_NAMES = Set.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @author Ashley Scopes
* @since 0.0.1
*/
public final class StringUtils extends UtilityClass {
public final class StringUtils {

// Number formatting stuff
private static final BigDecimal THOUSAND = BigDecimal.valueOf(1_000);
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import io.github.ascopes.jct.filemanagers.JctFileManager;
import io.github.ascopes.jct.filemanagers.ModuleLocation;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.file.Path;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package io.github.ascopes.jct.workspaces;

import io.github.ascopes.jct.compilers.JctCompiler;
import io.github.ascopes.jct.utils.UtilityClass;
import io.github.ascopes.jct.workspaces.impl.WorkspaceImpl;

/**
Expand All @@ -25,7 +24,7 @@
* @author Ashley Scopes
* @since 0.0.1
*/
public final class Workspaces extends UtilityClass {
public final class Workspaces {

private Workspaces() {
// Do nothing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import static io.github.ascopes.jct.utils.IoExceptionUtils.uncheckedIo;

import io.github.ascopes.jct.workspaces.PathRoot;
import java.io.Closeable;
import java.io.IOException;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
Expand Down
Loading