From b9e037b88f3a94367a8e8a42792d7e879b57a311 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Fri, 4 Feb 2022 15:56:51 -0800 Subject: [PATCH] Polish --- .../boot/docs/cli/usingthecli/run/WebApplication.groovy | 2 +- .../multiple/CustomDependencyManagement.groovy | 4 ++-- .../single/CustomDependencyManagement.groovy | 4 ++-- .../testing/utilities/testresttemplate/MyTests.java | 4 ++-- .../docs/web/servlet/springmvc/json/MyJsonComponent.java | 6 ++---- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/main/groovy/org/springframework/boot/docs/cli/usingthecli/run/WebApplication.groovy b/spring-boot-project/spring-boot-docs/src/main/groovy/org/springframework/boot/docs/cli/usingthecli/run/WebApplication.groovy index d034a7c062e..91154cc9a52 100644 --- a/spring-boot-project/spring-boot-docs/src/main/groovy/org/springframework/boot/docs/cli/usingthecli/run/WebApplication.groovy +++ b/spring-boot-project/spring-boot-docs/src/main/groovy/org/springframework/boot/docs/cli/usingthecli/run/WebApplication.groovy @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.cli.usingthecli.run; +package org.springframework.boot.docs.cli.usingthecli.run import org.springframework.web.bind.annotation.RestController import org.springframework.web.bind.annotation.RequestMapping diff --git a/spring-boot-project/spring-boot-docs/src/main/groovy/org/springframework/boot/docs/cli/usingthecli/run/customdependencymanagement/multiple/CustomDependencyManagement.groovy b/spring-boot-project/spring-boot-docs/src/main/groovy/org/springframework/boot/docs/cli/usingthecli/run/customdependencymanagement/multiple/CustomDependencyManagement.groovy index 39d19a3c976..969e4f290cc 100644 --- a/spring-boot-project/spring-boot-docs/src/main/groovy/org/springframework/boot/docs/cli/usingthecli/run/customdependencymanagement/multiple/CustomDependencyManagement.groovy +++ b/spring-boot-project/spring-boot-docs/src/main/groovy/org/springframework/boot/docs/cli/usingthecli/run/customdependencymanagement/multiple/CustomDependencyManagement.groovy @@ -14,9 +14,9 @@ * limitations under the License. */ -package org.springframework.boot.docs.cli.usingthecli.run.customdependencymanagement.multiple; +package org.springframework.boot.docs.cli.usingthecli.run.customdependencymanagement.multiple -import org.springframework.boot.groovy.DependencyManagementBom; +import org.springframework.boot.groovy.DependencyManagementBom // tag::code[] @DependencyManagementBom([ diff --git a/spring-boot-project/spring-boot-docs/src/main/groovy/org/springframework/boot/docs/cli/usingthecli/run/customdependencymanagement/single/CustomDependencyManagement.groovy b/spring-boot-project/spring-boot-docs/src/main/groovy/org/springframework/boot/docs/cli/usingthecli/run/customdependencymanagement/single/CustomDependencyManagement.groovy index 8184af33341..e8a3d81a621 100644 --- a/spring-boot-project/spring-boot-docs/src/main/groovy/org/springframework/boot/docs/cli/usingthecli/run/customdependencymanagement/single/CustomDependencyManagement.groovy +++ b/spring-boot-project/spring-boot-docs/src/main/groovy/org/springframework/boot/docs/cli/usingthecli/run/customdependencymanagement/single/CustomDependencyManagement.groovy @@ -14,9 +14,9 @@ * limitations under the License. */ -package org.springframework.boot.docs.cli.usingthecli.run.customdependencymanagement.single; +package org.springframework.boot.docs.cli.usingthecli.run.customdependencymanagement.single -import org.springframework.boot.groovy.DependencyManagementBom; +import org.springframework.boot.groovy.DependencyManagementBom // tag::code[] @DependencyManagementBom("com.example.custom-bom:1.0.0") diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/utilities/testresttemplate/MyTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/utilities/testresttemplate/MyTests.java index 04c9210217d..112c86cc766 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/utilities/testresttemplate/MyTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/utilities/testresttemplate/MyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import static org.assertj.core.api.Assertions.assertThat; class MyTests { - private TestRestTemplate template = new TestRestTemplate(); + private final TestRestTemplate template = new TestRestTemplate(); @Test void testRequest() throws Exception { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/json/MyJsonComponent.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/json/MyJsonComponent.java index 659edbfa171..ad2c98dfd90 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/json/MyJsonComponent.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/json/MyJsonComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import java.io.IOException; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.ObjectCodec; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; @@ -46,8 +45,7 @@ public class MyJsonComponent { public static class Deserializer extends JsonDeserializer { @Override - public MyObject deserialize(JsonParser jsonParser, DeserializationContext ctxt) - throws IOException, JsonProcessingException { + public MyObject deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException { ObjectCodec codec = jsonParser.getCodec(); JsonNode tree = codec.readTree(jsonParser); String name = tree.get("name").textValue();