Skip to content

Commit

Permalink
Checkstyle fixes (#878)
Browse files Browse the repository at this point in the history
  • Loading branch information
altro3 authored Nov 24, 2023
1 parent 12b3b18 commit b2b17e9
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.gradle.api.tasks.TaskAction;
import org.gradle.jvm.toolchain.JavaLanguageVersion;

import java.io.IOException;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ public TeeStringWriter(Logger logger) {

@Override
@SuppressWarnings("java:S2629") // This is done by Gradle
public void write(char[] cbuf, int off, int len) throws IOException {
public void write(char[] cbuf, int off, int len) {
delegate.write(cbuf, off, len);
logger.lifecycle(new String(cbuf, off, len).trim());
}

@Override
public void flush() throws IOException {
public void flush() {
delegate.flush();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public MicronautDockerfile() {
this.targetWorkingDirectory = objects.property(String.class).convention(DEFAULT_WORKING_DIR);
}

@Override
public Property<String> getTargetWorkingDirectory() {
return targetWorkingDirectory;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,18 @@ public abstract class NativeImageDockerfile extends Dockerfile implements Docker
*/
@Input
@Optional
@Override
public abstract Property<String> getBaseImage();

/**
* @return The arguments to pass to the native image executable when starting up in the docker container.
*/
@Input
@Override
public abstract ListProperty<String> getArgs();

@Input
@Override
public abstract ListProperty<Integer> getExposedPorts();

/**
Expand All @@ -117,6 +120,7 @@ public abstract class NativeImageDockerfile extends Dockerfile implements Docker

@Input
@Optional
@Override
public abstract Property<String> getDefaultCommand();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public class FingerprintingEditor implements Editor {
private final List<String> fingerprint;

// We use Optional because Gradle doesn't support injecting null values
@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
@Inject
public FingerprintingEditor(ObjectFactory objects,
List<String> fingerprint) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
/**
* Prepares a docker build context directory by copying a number of
* directories into the output directory.
*
* <p>
* We cannot use the regular Copy task because of laziness and the
* fact that the directories to copy are generated by the build itself.
*
* <p>
* However, using `Copy` task is considered harmful in general.
*/
public abstract class PrepareDockerContext extends DefaultTask {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import spock.lang.Shared
class KotlinLibraryFunctionalTest extends AbstractEagerConfiguringFunctionalTest {

@Shared
private final String kotlinVersion = System.getProperty("kotlinVersion");
private final String kotlinVersion = System.getProperty("kotlinVersion")

@Shared
private final String kspVersion = System.getProperty("kspVersion");
private final String kspVersion = System.getProperty("kspVersion")


def "test apply defaults for micronaut-library and KSP with kotlin DSL for #plugin"() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.micronaut.gradle;

import org.gradle.api.artifacts.Configuration;
import org.gradle.api.tasks.SourceSet;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static void copyAttributes(ProviderFactory providers, Configuration from,
AttributeContainer runtimeClasspathAttributes = to.getAttributes();
Set<Attribute<?>> keySet = runtimeClasspathAttributes.keySet();
for (Attribute<?> attribute : keySet) {
//noinspection unchecked,DataFlowIssue
// noinspection unchecked
attrs.attributeProvider((Attribute<Object>) attribute, providers.provider(() -> runtimeClasspathAttributes.getAttribute(attribute)));
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ interface ClientParameters extends AbstractOpenApiWorkAction.OpenApiParameters {
ListProperty<String> getAdditionalClientTypeAnnotations();
}

@Override
protected void configureBuilder(MicronautCodeGeneratorBuilder builder) {
var parameters = getParameters();
builder.forClient(spec -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ interface ServerParameters extends OpenApiParameters {
Property<Boolean> getUseAuth();
}

@Override
protected void configureBuilder(MicronautCodeGeneratorBuilder builder) {
var parameters = getParameters();
builder.forServer(spec -> {
Expand Down
2 changes: 1 addition & 1 deletion openapi-plugin/src/test/resources/petstore.json
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@
},
"petstore_auth": {
"type": "oauth2",
"authorizationUrl": "http://petstore.swagger.io/api/oauth/dialog",
"authorizationUrl": "https://petstore.swagger.io/api/oauth/dialog",
"flow": "implicit",
"scopes": {
"write:pets": "modify pets in your account",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ private static Configuration createTestResourcesClientConfiguration(Project proj
return client;
}

@Override
public void apply(Project project) {
PluginManager pluginManager = project.getPluginManager();
pluginManager.apply(JavaPlugin.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public interface TestResourcesConfiguration extends KnownModules {
* reuse that server, effectively ignoring the
* existing configuration. This can be used to share
* a server between multiple independent builds.
*
* <p>
* If an explicit port is set, then security is lowered
* and a token is no longer requested. Any client from
* the loopback address can access the server.
Expand Down

0 comments on commit b2b17e9

Please sign in to comment.