Skip to content

Commit 105db66

Browse files
committed
Polish
1 parent e044817 commit 105db66

File tree

26 files changed

+49
-128
lines changed

26 files changed

+49
-128
lines changed

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/AbstractBuildLog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public Consumer<TotalProgressEvent> pullingBuilder(BuildRequest request, ImageRe
4545
}
4646

4747
@Override
48-
public void pulledBulder(BuildRequest request, Image image) {
48+
public void pulledBuilder(BuildRequest request, Image image) {
4949
log(" > Pulled builder image '" + getDigest(image) + "'");
5050
}
5151

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildLog.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public interface BuildLog {
5353
* @param request the build request
5454
* @param image the builder image that was pulled
5555
*/
56-
void pulledBulder(BuildRequest request, Image image);
56+
void pulledBuilder(BuildRequest request, Image image);
5757

5858
/**
5959
* Log that a run image is being pulled.
@@ -73,7 +73,7 @@ public interface BuildLog {
7373
/**
7474
* Log that the lifecycle is executing.
7575
* @param request the build request
76-
* @param version the lifecyle version
76+
* @param version the lifecycle version
7777
* @param buildCacheVolume the name of the build cache volume in use
7878
*/
7979
void executingLifecycle(BuildRequest request, LifecycleVersion version, VolumeName buildCacheVolume);

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildRequest.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class BuildRequest {
4747

4848
private final boolean cleanCache;
4949

50-
private final boolean versboseLogging;
50+
private final boolean verboseLogging;
5151

5252
BuildRequest(ImageReference name, Function<Owner, TarArchive> applicationContent) {
5353
Assert.notNull(name, "Name must not be null");
@@ -57,17 +57,17 @@ public class BuildRequest {
5757
this.builder = DEFAULT_BUILDER;
5858
this.env = Collections.emptyMap();
5959
this.cleanCache = false;
60-
this.versboseLogging = false;
60+
this.verboseLogging = false;
6161
}
6262

6363
BuildRequest(ImageReference name, Function<Owner, TarArchive> applicationContent, ImageReference builder,
64-
Map<String, String> env, boolean cleanCache, boolean versboseLogging) {
64+
Map<String, String> env, boolean cleanCache, boolean verboseLogging) {
6565
this.name = name;
6666
this.applicationContent = applicationContent;
6767
this.builder = builder;
6868
this.env = env;
6969
this.cleanCache = cleanCache;
70-
this.versboseLogging = versboseLogging;
70+
this.verboseLogging = verboseLogging;
7171
}
7272

7373
/**
@@ -78,7 +78,7 @@ public class BuildRequest {
7878
public BuildRequest withBuilder(ImageReference builder) {
7979
Assert.notNull(builder, "Builder must not be null");
8080
return new BuildRequest(this.name, this.applicationContent, builder.inTaggedForm(), this.env, this.cleanCache,
81-
this.versboseLogging);
81+
this.verboseLogging);
8282
}
8383

8484
/**
@@ -90,10 +90,10 @@ public BuildRequest withBuilder(ImageReference builder) {
9090
public BuildRequest withEnv(String name, String value) {
9191
Assert.hasText(name, "Name must not be empty");
9292
Assert.hasText(value, "Value must not be empty");
93-
Map<String, String> env = new LinkedHashMap<String, String>(this.env);
93+
Map<String, String> env = new LinkedHashMap<>(this.env);
9494
env.put(name, value);
9595
return new BuildRequest(this.name, this.applicationContent, this.builder, Collections.unmodifiableMap(env),
96-
this.cleanCache, this.versboseLogging);
96+
this.cleanCache, this.verboseLogging);
9797
}
9898

9999
/**
@@ -103,10 +103,10 @@ public BuildRequest withEnv(String name, String value) {
103103
*/
104104
public BuildRequest withEnv(Map<String, String> env) {
105105
Assert.notNull(env, "Env must not be null");
106-
Map<String, String> updatedEnv = new LinkedHashMap<String, String>(this.env);
106+
Map<String, String> updatedEnv = new LinkedHashMap<>(this.env);
107107
updatedEnv.putAll(env);
108108
return new BuildRequest(this.name, this.applicationContent, this.builder,
109-
Collections.unmodifiableMap(updatedEnv), this.cleanCache, this.versboseLogging);
109+
Collections.unmodifiableMap(updatedEnv), this.cleanCache, this.verboseLogging);
110110
}
111111

112112
/**
@@ -116,7 +116,7 @@ public BuildRequest withEnv(Map<String, String> env) {
116116
*/
117117
public BuildRequest withCleanCache(boolean cleanCache) {
118118
return new BuildRequest(this.name, this.applicationContent, this.builder, this.env, cleanCache,
119-
this.versboseLogging);
119+
this.verboseLogging);
120120
}
121121

122122
/**
@@ -177,7 +177,7 @@ public boolean isCleanCache() {
177177
* @return if verbose logging should be used
178178
*/
179179
public boolean isVerboseLogging() {
180-
return this.versboseLogging;
180+
return this.verboseLogging;
181181
}
182182

183183
/**

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Builder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ private Image pullBuilder(BuildRequest request) throws IOException {
8181
Consumer<TotalProgressEvent> progressConsumer = this.log.pullingBuilder(request, builderImageReference);
8282
TotalProgressPullListener listener = new TotalProgressPullListener(progressConsumer);
8383
Image builderImage = this.docker.image().pull(builderImageReference, listener);
84-
this.log.pulledBulder(request, builderImage);
84+
this.log.pulledBuilder(request, builderImage);
8585
return builderImage;
8686
}
8787

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuilderMetadata.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ interface CreatedBy {
233233
*/
234234
static final class Update {
235235

236-
private ObjectNode copy;
236+
private final ObjectNode copy;
237237

238238
private Update(BuilderMetadata source) {
239239
this.copy = source.getNode().deepCopy();

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Lifecycle.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,16 @@ class Lifecycle implements Closeable {
7070
* @param log build output log
7171
* @param docker the Docker API
7272
* @param request the request to process
73-
* @param runImageReferece a reference to run image that should be used
73+
* @param runImageReference a reference to run image that should be used
7474
* @param builder the ephemeral builder used to run the phases
7575
*/
76-
Lifecycle(BuildLog log, DockerApi docker, BuildRequest request, ImageReference runImageReferece,
76+
Lifecycle(BuildLog log, DockerApi docker, BuildRequest request, ImageReference runImageReference,
7777
EphemeralBuilder builder) {
7878
checkPlatformVersion(builder);
7979
this.log = log;
8080
this.docker = docker;
8181
this.request = request;
82-
this.runImageReference = runImageReferece;
82+
this.runImageReference = runImageReference;
8383
this.builder = builder;
8484
this.version = LifecycleVersion.parse(builder.getBuilderMetadata().getLifecycle().getVersion());
8585
this.layersVolume = createRandomVolumeName("pack-layers-");
@@ -258,7 +258,7 @@ private static class Folder {
258258
* convention of using {@code '/workspace'}.
259259
* <p>
260260
* Note that application content is uploaded to the container with the first phase
261-
* that runs and saved in a volume that is passed to supsequent phases. The folder
261+
* that runs and saved in a volume that is passed to subsequent phases. The folder
262262
* is mutable and buildpacks may modify the content.
263263
*/
264264
static final String APPLICATION = "/workspace";

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Phase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ void apply(ContainerConfig.Update update) {
114114
}
115115
update.withCommand("/lifecycle/" + this.name, StringUtils.toStringArray(this.args));
116116
update.withLabel("author", "spring-boot");
117-
this.binds.forEach((source, dest) -> update.withBind(source, dest));
117+
this.binds.forEach(update::withBind);
118118
}
119119

120120
}

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,8 @@ public ContainerReference create(ContainerConfig config, ContainerContent... con
227227
private ContainerReference createContainer(ContainerConfig config) throws IOException {
228228
URI createUri = buildUrl("/containers/create");
229229
try (Response response = http().post(createUri, "application/json", config::writeTo)) {
230-
ContainerReference containerReference = ContainerReference
230+
return ContainerReference
231231
.of(SharedObjectMapper.get().readTree(response.getContent()).at("/Id").asText());
232-
return containerReference;
233232
}
234233
}
235234

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerSchemePortResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929
class DockerSchemePortResolver implements SchemePortResolver {
3030

31-
private static int DEFAULT_DOCKER_PORT = 2376;
31+
private static final int DEFAULT_DOCKER_PORT = 2376;
3232

3333
@Override
3434
public int resolve(HttpHost host) throws UnsupportedSchemeException {

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/Http.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ interface Response extends Closeable {
8282

8383
/**
8484
* Return the content of the response.
85-
* @return the reseponse content
85+
* @return the response content
8686
* @throws IOException on IO error
8787
*/
8888
InputStream getContent() throws IOException;

0 commit comments

Comments
 (0)